Configure NFS SERVER
Configure NFS Server to share directories on your Network.
This example is based on the environment below.
[NFS Server] |192.0.0.20 ---------------- 192.0.0.30| [NFS Client]
Server.example.com <---------------------> Client.example.com
Server Configuration:-
[root@server ~]# yum -y install nfs-utils
[root@server ~]# vi /etc/idmapd.conf
# line 5: uncomment and change to your domain name
Domain = example.com
[root@server ~]# vi /etc/exports
# write settings for NFS exports
/home 192.0.0.0/24(rw,no_root_squash)
[root@server ~]# systemctl start rpcbind nfs-server
[root@server ~]# systemctl enable rpcbind nfs-server
# allow NFSv4
[root@server ~]# firewall-cmd --add-service=nfs --permanent
success
[root@server ~]# firewall-cmd --reload
success
Client Configuration:-
[root@Client~]# yum -y install nfs-utils
[root@Client~]# vi /etc/idmapd.conf
# line 5: uncomment and change to your domain name
Domain = example.com
[root@Client~]# systemctl start rpcbind
[root@Client~]# systemctl enable rpcbind
[root@Client~]# mount -t nfs Server.example.com:/home /home
[root@Client~]# df -hT
Filesystem Type Size Used Avail Use% Mounted on
Server.example.com:/home nfs4 45G 1.4G 63G 5% /home
# /home from NFS server is mounted
Mount it on fstab so it remains after the system boots.
[root@Client ~]# vi /etc/fstab
# add like follows to the end
server.example.com:/home /home nfs defaults 0 0