1

I shared /data directory using nfs

This is the content of /etc/exports

/data   *(rw,sync)

I started these two services

service rpcbind restart
service nfs restart

This is my firewall configuration

*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 111 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 20049 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 2020 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 32769 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 32803 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 662 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 875 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 892 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT

In client side I can access the data and I can mount also

[root@client ~]# showmount -e server
Export list for server:
/data *
[root@client ~]# mount -t nfs server:/data /mnt/

If I try to mount using autofs it's not working, in /var/log/messages it's showing this

client automount[29971]: lookup_read_master: lookup(nisplus): couldn't locate nis+ table auto.master

This is my /etc/auto.misc configuration

public          -ro,nfs,intr            192.168.122.123:/data

If I stop iptables in server side , then autofs will work.

To allow autofs which firewall port should I open ?

1 Answer 1

3

On my system (Debian) it's ports 111 (rpc) and 2049 (nfs), both UDP and TCP

Also, let me give you a hint. When you have this kind of doubts, you may check on which ports different applications are listening by issuing the follwoing commands:

  sudo ss -lntp 
  sudo ss -lnup

The flags work like this:

  -l list listening sockets
  -n do not resolve service names
  -t list TCP sockets
  -u list UDP sockets
  -p show the process using the socket
1
  • 1
    @max I have added just a bit of info, to explain where that came from. You might perhaps find it useful... Commented Feb 6, 2014 at 12:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .