How to: Configure NFS Server and Client on RHEL 7

Avinash Desireddy
2 min readJun 16, 2019

Network File System (NFS) is a distributed file system protocol designed to share files over a computer network. A machine hosting the network drive is called server, where the machines that connect to access the drive are called clients.

NFS relies on Remote Procedure Calls (RPC) for remote communication. RPC services are controlled by the rpcbind service.

  • rpcbind: The rpcbind server converts RPC program numbers into universal addresses.
  • nfs-server: It enables the NFS server and the appropriate RPC processes to service requests for shared NFS file systems.
  • nfs-lock: Enables necessary components allowing NFS clients to lock files on the server.

Two RHEL 7 servers are used in this tutorial, One acting as a server and another as a client.

  • NFS Server — hostname:, IP:
  • NFS Client — hostname:, IP:

Step 1: Downloading and Installing

Yum package manager is used to install nfs-utils package. “nfs-utils” includes all the needed services to build your NFS server.

$ sudo yum install -y nfs-utils

Step 2: Enable and Start NFS Server

Start the nfs-server and enable to make them bootable on the next reboot

$ sudo systemctl enable rpcbind
$ sudo systemctl start rpcbind
$ sudo systemctl enable nfs-server
$ sudo systemctl start nfs-server

Step 3: Export shared directory

Create a directory for NFS share to share with

$ mkdir /nfs_shared

Edit /etc/exports file



/nfs_share – shared directory – Client address
rw – Writable permission to shared folder
sync – Synchronize shared directory
no_root_squash – Enable root privilege
no_all_squash - Enable user’s authority

The client info can be specified in the following formats to control access to multiple clients. - IP address of the client - Subnet to specify supported client IP addresses

Run the following command to reflect changes in /etc/exports

exportfs -a

Step 4: Client

Similar to the server, using yum package manager is used to install nfs-utils package. “nfs-utils” includes necessary client packages to access the remote share.

$ sudo yum install -y nfs-utils

Verify if the client can access the share using “showmount” command

$ showmount -e server.example.comExport list for
/nfs_share *
mount -t nfs /nfs

Create a directory and mount the share

$ mkdir -p /mnt/dir1
$ mount -t nfs /mnt/dir1

Verify the mount using —

$ mount
# or
$ df -h

The directories mounted using “mount” command are not available upon reboots. To persist the mount points, the following entry should be saved to /etc/fstab file

/etc/fstab /dir1 nfs rsize=8192,wsize=8192,timeo=14,intr

Unmount the share using umount /dir1

Cheers, now we have a successfully configured NFS Server and Client