Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

Edit:

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 

Edit:

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.

share|improve this question
    
Do you have firewall enabled on the ubuntu machine? If so, you need to have a look at the rules. Also, you can try to disable it and check. –  Khaled Dec 5 '11 at 11:26
    
Yes, iptables on ubuntu machine is preventing the centos machine from reaching rpc.statd - but you've not provided details of what the iptables settings you switched off to resolve the problem are. –  symcbean Dec 5 '11 at 14:02
    
Which version of NFS are you using 3 or 4? If you are using NFSv4, then you can use only one single port. Otherwise you have to configure portmap to use static ports, or at least a limited range of ports. –  Mircea Vutcovici Dec 5 '11 at 21:10
    
I am using nfs version 3 –  gmemon Dec 6 '11 at 5:20
add comment

2 Answers

you have to install rpc.statd portmap. apt-get install portmap. and you must add the destination nfsserver to /etc/hosts file.

share|improve this answer
add comment

I add the following rule to iptables on the Ubuntu machine and it started working:

iptables -A INPUT -i lo -j ACCEPT
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.