NFS Server : 192.168.0.1
NFS Client : 192.168.0.2
NFS Folder : /home/user/session
1. Server (192.168.0.1)
/etc/sysconfig/nfs 파일 수정
#vi /etc/sysconfig/nfs
LOCKD_TCPPORT=32803
# UDP port rpc.lockd should listen on.
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
Server 공유폴더 지정
# vi /etc/exports
/home/user/session 192.168.0.2(rw,sync,no_root_squash)
nfs시작
# service rpcbind start
# service nfs start
iptables
iptables -A INPUT -s 192.168.0.0/24 -d 192.168.0.0/24 -p udp -m multiport --dport 10053,111,2049,32769,875,892 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -s 192.168.0 0/24 -d 192.168.0 0/24 -p tcp -m multiport --dport 10053,111,2049,32803,875,892 -m state --state NEW,ESTABLISHED -j ACCEPT
2. Client (192.168.0.2)
/etc/sysconfig/nfs파일 수정
vi /etc/sysconfig/nfs
LOCKD_TCPPORT=32803
# UDP port rpc.lockd should listen on.
LOCKD_UDPPORT=32769
MOUNTD_PORT=892
iptables -A INPUT -s 192.168.0.0/24 -d 192.168.0 0/24 -p udp -m multiport --sport 10053,111,2049,32769,875,892,32769 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -s 192.168.0.0/24 -d 192.168.0 0/24 -p tcp -m multiport --sport 10053,111,2049,32803,875,892,32803 -m state --state NEW,ESTABLISHED -j ACCEPT
nfs시작
# service rpcbind start
# service nfs strt
NFS폴더 마움트
# mount -t nfs 192.168.0.1:/home/user/session /home/user/session
NFS 마운트 해제
# umount /home/user/session
NFS 마운트 강제 해제
# umount -f -l /home/user/session
끝
'Linux' 카테고리의 다른 글
CentOS 7 SVN iptables (0) | 2016.01.29 |
---|---|
아파치 리다이렉션 apache url redirection www .htaccess rewrite httpd.conf (0) | 2016.01.25 |
CentOS 7 아파치 2.4.6 한글깨짐 AddDefaultCharset (0) | 2016.01.15 |
CentOS 7 apache virtualhost (2) | 2016.01.15 |
CentOS 7 iptables 설정 (1) | 2016.01.15 |