Configure NFS Server2015/01/10 |
Configure NFS Server to share directories on your Network.
This example is based on the environment below. +----------------------+ | +----------------------+ | [ NFS Server ] |10.0.0.30 | 10.0.0.31| [ NFS Client ] | | dlp.srv.world +----------+----------+ www.srv.world | | | | | +----------------------+ +----------------------+ |
|
[1] | Configure NFS Server. |
[root@dlp ~]#
yum -y install nfs-utils
[root@dlp ~]#
vi /etc/idmapd.conf # line 5: uncomment and change to your domain name Domain = srv.world
[root@dlp ~]#
vi /etc/exports # write settings for NFS exports /home 10.0.0.0/24(rw,no_root_squash)
/etc/rc.d/init.d/rpcbind start Starting rpcbind: [ OK ][root@dlp ~]# /etc/rc.d/init.d/nfs start Starting NFS services: [ OK ] Starting NFS mountd: [ OK ] Starting NFS daemon: [ OK ] Starting RPC idmapd: [ OK ][root@dlp ~]# chkconfig rpcbind on [root@dlp ~]# chkconfig nfs on |
[2] | If IPTables is running, allow ports like follows. RPC ports used by NFS are asigned dynamically, so change them to fixed ports and allow them by IPTables. For "-I INPUT *" section below example, Replace it to your own environment. |
[root@dlp ~]#
vi /etc/sysconfig/nfs # line 20,22: uncomment LOCKD_TCPPORT=32803 LOCKD_UDPPORT=32769 # line 57: uncomment MOUNTD_PORT=892 # line 63: uncomment STATD_PORT=662
[root@dlp ~]#
/etc/rc.d/init.d/rpcbind restart [root@dlp ~]# /etc/rc.d/init.d/nfs restart
# allow 111, 2049 and fixed ports above [root@dlp ~]# for port in 111 662 892 2049 32803; do iptables -I INPUT 5 -p tcp -m state --state NEW -m tcp --dport $port -j ACCEPT; done [root@dlp ~]# for port in 111 662 892 2049 32769; do iptables -I INPUT 6 -p udp -m state --state NEW -m udp --dport $port -j ACCEPT; done |
For basic options of exports
|
Sponsored Link |