Thursday, February 24, 2022

How To Setup NFS Server & Client On Rocky Linux 8.5

 in This Tutorial you will Learn " Configure NFS Server To share Directories on Your Network "    

NFS stands for Network File Share.
+----------------------+                                  +----------------------+
| [    NFS Server    ] |192.168.1.20 | 192.168.1.80| [    NFS Client    ]
|   www.primaryhost.com     +----------+----------+   www.tertiary.com   |
|                             |                                |
+----------------------+                                     +----------------------+
_________________________________________________________________________________________
Testing Environment - Os:  Rocky Linux 8.5  64Bit | IP -192.168.1.20 | Hostname - www.primaryhost.com
_________________________________________________________________________________________
cat /etc/system-release ; sestatus ; hostname ; hostname -I ; dnf groupinstall "Development Tools" -y
dnf -y install nfs-utils  
nano /etc/exports
# create new
# for example, set [/home/nfsshare] as NFS share
/home/nfsshare  192.168.1.80(rw,no_root_squash)
cat /etc/exports ; exportfs -v
mkdir /home/nfsshare
systemctl enable --now rpcbind nfs-server ; systemctl restart nfs-server
firewall-cmd --add-service={nfs,nfs3,rpc-bind,mountd} --permanent ; firewall-cmd --reload
systemctl daemon-reload  ; systemctl restart nfs-server
_________________________________________________________________________________________
Configure NFS Client -
cat /etc/system-release ; sestatus ; hostname -I ; dnf groupinstall "Development Tools" -y
dnf -y install nfs-utils
mount -t nfs 192.168.1.20:/home/nfsshare /mnt
mount -t nfs -o vers=3 192.168.1.20:/home/nfsshare /mnt
df -hT /mnt
showmount -e 192.168.1.20
_________________________________________________________________________________________












No comments:

Post a Comment