Vinod Balakrishnan Vinod Balakrishnan - 1 year ago 113
Linux Question

How to get the list of clients connected to an NFS server within a local network?

I have an NFS server with folder permissions as follows. There are 50 clients which need to connect to this server within the same network. I would like to know what's the command to lookup which are the clients accessing this server from the server.

NFS Server configuration file looks like this.

[[email protected] ~]# cat /etc/exports
/home/guests *(rw,sync)
/india *(rw,sync)

Below are the list of shared folders

[[email protected] ~]# showmount -e
Export list for
/india *
/home/guests *

For testing purpose I have now connected one client to the server. Below output is from the "client2" machine.

[[email protected] ~]# showmount -e
Export list for
/india *
/home/guests *
[[email protected] ~]# mount -t nfs /test
[[email protected] ~]# mount
/dev/sda2 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda1 on /boot type ext4 (rw)
/dev/sda3 on /home type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
gvfs-fuse-daemon on /root/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw) on /test type nfs (rw,vers=4,addr=,clientaddr=

I tried using
showmount -a
showmount -d
but not sure what am missing which's not list the client machines connected.

[[email protected] ~]# showmount -a
All mount points on
[[email protected] ~]# man showmount
[[email protected] ~]# showmount -d
Directories on
[[email protected] ~]# netstat -an | grep
[[email protected] ~]# netstat -an | grep
[[email protected] ~]# cat /var/lib/nfs/rmtab
[[email protected] ~]#

Note : The firewall is disabled on the server temporarily during this testing.
Please advise.

Answer Source

I know this question is quite old but its on the first page of a Google search and I only recently found the answer. You can find connected NFS clients by running the following on the NFS server:

netstat -a | grep nfsd
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download