Learn how to configure NFS server on CentOS 6.x! NFS stands for a Network File System. Network File System is a protocol which allows user on a client computer to access files and folders over a network. It is a network file sharing protocol built on the Open Network Computing Remote Procedure Call (ONC RPC) system. NFS is a server/client oriented protocol, which means that in order to share files and folders with your NFS clients you first need to configure NFS server!
Let’s start our How To configure NFS server guide!
1. Install nfs-utils and dependencies.
[root@foo1 ~]# yum install nfs-utils -y
2.Edit /etc/exports file
Next we need to edit /etc/exports file and add information about the folder we desire to share via NFS, IP addresses of the NFS clients that will be allowed to mount the NFS server share and NFS options for the share (you can add multiple hosts with different mount options or use a wildcard * for any – read more about this HERE).
syntax for /etc/exports is:
IP address of NFS server in our example is 192.168.1.100 and NFS clients address 192.168.1.101
[root@foo1 ~]# mkdir /nfsshare [root@foo1 ~]# echo "/nfsshare 192.168.1.101(rw,sync,no_
root_squash,no_subtree_check)" >> /etc/exports
3. Export NFS filesystems
[root@foo1 ~]# exportfs -a
4. Start rpcbind and NFS
[root@foo1 ~]# /etc/init.d/rpcbind start [root@foo1 ~]# /etc/init.d/nfs start
Now you can check if the NFS shares were exported with showmount command.
[root@foo1 ~]# showmount -e 192.168.1.100 Export list for 192.168.61.100: /nfsshare 192.168.1.101
Read my post “How to mount NFS on CentOS 6” for more information!