CentOS 7.x Configure basic NFSv4 server for sharing folders between two machines

From Notes_Wiki

Home > CentOS > CentOS 7.x > File sharing > NFS > CentOS 7.x Configure basic NFSv4 server for sharing folders between two machines

There is updated article on this at CentOS 9.x Configure basic NFSv4 server for sharing folders between two machines

On NFS4 server where folder to be shared is present, edit /etc/exports and add:

   <folder-to-be-shared>   *(rw,no_root_squash,crossmnt)

Ensure that nfsserver is running:

   systemctl enable nfsserver
   systemctl start nfsserver

On the NFS4 server disable firewall and SELinux for easy configuration:

   systemctl disable firewalld
   systemctl stop firewalld
   setenforce 0
   #edit /etc/sysconfig/selinux and set SELINUX=disabled

To verify that folders are exported properly use:

   showmount -e
   exportfs -v

to see exported filesystems and related export options.


Finally, on client test using:

   mount -t nfs4 <nfs4-server-ip-or-fqdn>:<exported-folder> <client-mount-point>

If this test is successful, add appropriate lines in /etc/fstab to automatically mount the nfs share on client boot.


Home > CentOS > CentOS 7.x > File sharing > NFS > CentOS 7.x Configure basic NFSv4 server for sharing folders between two machines