Please find below output . Client is able to ping using hostname. Still same error.
[root@client ~]# mount -t nfs -o nfsvers=3 server1.example.com:/nfs /mnt/nfs
mount.nfs: access denied by server while mounting server1.example.com:/nfs
[root@client ~]# mount -t nfs -vvvv server.example.com:/nfs /mnt/nfs
mount.nfs: timeout set for Tue Aug 30 17:22:48 2016
mount.nfs: trying text-based options ‘vers=4,addr=192.168.0.2,clientaddr=192.168.100.209’
mount.nfs: mount(2): Network is unreachable
mount.nfs: Network is unreachable
[root@client ~]# ping server1.example.com
PING server1.example.com (192.168.100.156) 56(84) bytes of data.
64 bytes from server1.example.com (192.168.100.156): icmp_seq=1 ttl=64 time=0.651 ms
64 bytes from server1.example.com (192.168.100.156): icmp_seq=2 ttl=64 time=0.779 ms
64 bytes from server1.example.com (192.168.100.156): icmp_seq=3 ttl=64 time=0.317 ms
64 bytes from server1.example.com (192.168.100.156): icmp_seq=4 ttl=64 time=1.02 ms
^C
— server1.example.com ping statistics —
4 packets transmitted, 4 received, 0% packet loss, time 3001ms
rtt min/avg/max/mdev = 0.317/0.692/1.021/0.254 ms
But now I am able mount using IP
[root@client ~]# mount -t nfs -o nfsvers=3 192.168.100.156:/nfs /mnt/nfs
[root@client ~]# cd /mnt/nfs
[root@client nfs]# ls
file1
[root@client nfs]#
Could you please explain why I am not able mount using hostname which I am able to ping. Please find /etc/export for reference.
once kindly check the hostname and also once share the content of /etc/hosts form both the servers client and server and also once check the SELinux whether it is enabled or disabled
#vim /etc/sysconfig/selinux
SELINUX=disabled
and also once check the log messages from client
and also verify that the portmap service is running.
Hiii
I hope you have got a solution to your problem.
though I am a bit late to reply nut would like to add to the solution for the why actually you are not able to mount or ping using hostname .I think you should mention the ip and the hostname in /etc/hosts.For eg: 192.168.5.11 server1.example.com.