I have an nfs server running on Cent OS. iptables is setup, and I have fixed ports setup. So, the server works fine. I tried mounting the nfs volumes on a Fedora machine, and everything works.
When I try mounting nfs volumes on an ubuntu machine, I get the error message implying that rpc.statd is not running, and remote locks wont work. I have checked and it is running. When I disable iptables on ubuntu machine, everything works fine. It leads me to think that iptables on ubuntu machine is preventing the centos machine from reaching rpc.statd on ubuntu machine.
Any ideas what is going on?
I added the nfs server to /etc/hosts file. portmap and rpc.statd are already installed. I have opened the tcp and udp ports for portmap in iptables. My iptables rules are as follows:
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT iptables -A INPUT -m state --state NEW -m tcp -p tcp --dport 111 -j ACCEPT iptables -A INPUT -m state --state NEW -m udp -p udp --dport 111 -j ACCEPT iptables -A INPUT -j REJECT --reject-with icmp-host-prohibited
I did some more digging,and I found that if I open only all udp ports (instead of disabling the complete firewall) in the iptables on ubuntu machine, everything works fine. This is surprising, because I am using proto=tcp option. Moreover, if I do tcpdump on nfs client (ubuntu) or nfs server (centos) machines, I do not see any udp packets.