Linux serverNETWORK ADMINISTRATIONS

Setting Up NFS Server And Client On CentOS 7

NFS, stands for Network File System, is a server-client protocol used for sharing files between linux/unix to unix/linux systems. NFS enables you to mount a remote share locally. You can then directly access any of the files on that remote share.
yum install nfs-utils -y
mkdir /var/oj && chmod 777 /var/oj/
nano /etc/exports
/var/oj/ 192.168.72.153/24(rw,sync,no_root_squash,no_all_squash)
systemctl enable rpcbind nfs-server nfs-lock nfs-idmap && systemctl start rpcbind nfs-server nfs-lock nfs-idmap
firewall-cmd –permanent –add-port=111/tcp && firewall-cmd –permanent –add-port=54302/tcp
firewall-cmd –permanent –add-port=20048/tcp && firewall-cmd –permanent –add-port=2049/tcp
firewall-cmd –permanent –add-port=46666/tcp && firewall-cmd –permanent –add-port=42955/tcp
firewall-cmd –permanent –add-port=875/tcp
firewall-cmd –reload

Mount NFS shares On clients:-
yum install nfs-utils
systemctl enable rpcbind nfs-server nfs-lock nfs-idmap && systemctl start rpcbind nfs-server nfs-lock nfs-idmap
firewall-cmd –permanent –add-port=111/tcp && firewall-cmd –permanent –add-port=54302/tcp
firewall-cmd –permanent –add-port=20048/tcp && firewall-cmd –permanent –add-port=2049/tcp
firewall-cmd –permanent –add-port=46666/tcp && firewall-cmd –permanent –add-port=42955/tcp
firewall-cmd –permanent –add-port=875/tcp
firewall-cmd –reload
mkdir /var/nfs_share
mount -t nfs 192.168.72.153:/var/oj/ /var/nfs_share/
mount
nano /etc/fstab
192.168.72.153:/var/oj/ /var/nfs_share/ nfs rw,sync,hard,intr 0 0
mount
df -hT
======================================================

source

centos 7

Leave a Reply

Your email address will not be published. Required fields are marked *