Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SERVER(192.168.1.200):
- Install NFS in Server system
- yum install nfs* -y or yum install nfs-utils nfs-utils-lib
- Start NFS service
- service rpcbind start
- chkconfig rpcbind on
- service nfs start
- chkconfig nfs on
- Create shared directories
- mkdir /srv/nfs_share
- chmod 755 /srv/nfs_share/
- Export shared directories
- vi /etc/exports
- ----------------------------------------------------------------------------
- /srv/nfs_share/ 192.168.1.0/24(rw,sync,no_root_squash,no_all_squash)
- /srv/shared/ 192.168.1.250/255.255.255.0(rw,sync)
- ----------------------------------------------------------------------------
- note:
- /srv/nfs_share – shared directory
- 192.168.1.0/24 – IP address range of clients
- rw – Writable permission to shared folder
- sync – Synchronize shared directory
- no_root_squash – Enable root privilege
- no_all_squash – Enable user’s authority
- enter command to export
- exportfs -a
- Restart the NFS service
- service nfs restart
- allow nfs in iptables
- iptables -A INPUT -p tcp --dport 2049 -j ACCEPT
- iptables -A INPUT -p tcp --dport 111 -j ACCEPT
- iptables -A INPUT -p tcp --dport 32803 -j ACCEPT
- iptables -A INPUT -p tcp --dport 892 -j ACCEPT
- iptables -A INPUT -p tcp --dport 875 -j ACCEPT
- iptables -A INPUT -p tcp --dport 662 -j ACCEPT
- service iptables save
- service iptables restart
- =================================================
- CLIENT(192.168.1.250):
- Install NFS in Client System
- yum install nfs* -y or yum install nfs-utils nfs-utils-lib
- Start NFS service
- service rpcbind start
- chkconfig rpcbind on
- service nfs start
- chkconfig nfs on
- Mount the share directory
- mkdir /mnt/nfsshare
- mount -t nfs 192.168.1.250:/srv/nfs_share/ /mnt/nfsshare/
- automount nfs share
- vi /etc/fstab
- ----------------------------------------------------------------------------
- 192.168.1.200:/srv/nfs_share/ /mnt/nfsshare/ nfs rw,sync,hard,intr 0 0
- ----------------------------------------------------------------------------
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement