I setup the NFS server without any issues.
On the NFS server, the following are already taken care:
- rpcbind service is running.
- nfs service is running.
- I’ve exported a local directory using client-ip using exportfs
However, on the client side, when I do “showmount -e”, I got the following error message: “clnt_create: RPC: Port mapper failure – Unable to receive: errno 113 (No route to host)”
showmount output:
# showmount -e 192.168.101.1 clnt_create: RPC: Port mapper failure - Unable to receive: errno 113 (No route to host)
In the above case, that 192.168.101.1 is where the NFS server is running.
If you get the above, error message, go through the following check-list to identify the problem.
1. Check Connectivity between the server
From the NFS client machine, ping the NFS server ip-address to make sure it is working properly.
ping 192.168.101.1
If ICMP is disabled on the NFS server, do other appropriate checks to make sure you can connect to that server. May be you can ssh to it.
ssh 192.168.101.1
2. Execute portinfo
On the NFS client machine execute the following, which will display the RPC information of the remote NFS server.
# rpcinfo -p 192.168.102.23 program vers proto port service 100000 4 tcp 111 portmapper 100000 3 tcp 111 portmapper 100011 1 udp 875 rquotad 100005 1 udp 59353 mountd 100003 2 tcp 2049 nfs 100003 3 tcp 2049 nfs 100003 4 tcp 2049 nfs 100227 2 tcp 2049 nfs_acl 100227 3 tcp 2049 nfs_acl 100003 2 udp 2049 nfs 100003 3 udp 2049 nfs 100003 4 udp 2049 nfs 100227 2 udp 2049 nfs_acl 100227 3 udp 2049 nfs_acl 100021 1 udp 34104 nlockmgr 100021 3 udp 34104 nlockmgr ...
As you see from the above output, rpcinfo can talk to NFS server, and it also shows that NFS service is running on the NFS server.
If you don’t have the NFS server running, start it on the NFS server:
service nfs start
3. Open-up Appropriate Ports
Check if you are running IPTables on the NFS server.
service iptables status
If you are running IPTables, make sure you open-up port 111 and 2049 as shown below.
iptables -A INPUT -p tcp --dport 111 -j ACCEPT iptables -A INPUT -p udp --dport 111 -j ACCEPT iptables -A INPUT -p tcp --dport 2049 -j ACCEPT iptables -A INPUT -p udp --dport 2049 -j ACCEPT
Also, please note that if you are running SELinux, by default it allows NFS to share the mount points. So, you don’t need to do anything specific to SELinux. But, if you like, you can check the audit.log file to make sure SELinux is not blocking anything related to NFS.