Showing posts with label nfs. Show all posts
Showing posts with label nfs. Show all posts

Wednesday, April 27, 2016

NfsFirewallConfig

개요

NFS 서버에서 rpcbind 프로그램은 동적으로 port를 할당해서 사용하는데 방화벽 뒤에서 사용하기 위해서는 해당 포트를 고정적으로 변경후 ACL을 설정 하는 것이 수월하다.

NFS 서버 설치

$ yum install nfs-utils nfs-utils-lib
$ chkconfig nfs on
$ service rpcbind start
$ service nfs start

NFS 서버 설정

$ vi /etc/exports

/home /nfs          10.10.10.111(rw,sync,no_root_squash,no_subtree_check)

$ exportfs -a

/etc/sysconfig/nfs 편집

사용할 포트 번호 기입

$ vi /etc/sysconfig/nfs

MOUNTD_PORT=4000
STATD_PORT=4001
LOCKD_TCPPORT=4002
LOCKD_UDPPORT=4003

NFS 재시작

$ service nfs restart

포트 확인

$ rpcinfo -p

[root@mirror sysconfig]# rpcinfo -p
   program vers proto   port  service
    100000    4   tcp    111  portmapper
    100000    3   tcp    111  portmapper
    100000    2   tcp    111  portmapper
    100000    4   udp    111  portmapper
    100000    3   udp    111  portmapper
    100000    2   udp    111  portmapper
    100005    1   udp   4000  mountd
    100005    1   tcp   4000  mountd
    100005    2   udp   4000  mountd
    100005    2   tcp   4000  mountd
    100005    3   udp   4000  mountd
    100005    3   tcp   4000  mountd
    100003    2   tcp   2049  nfs
    100003    3   tcp   2049  nfs
    100003    4   tcp   2049  nfs
    100227    2   tcp   2049  nfs_acl
    100227    3   tcp   2049  nfs_acl
    100003    2   udp   2049  nfs
    100003    3   udp   2049  nfs
    100003    4   udp   2049  nfs
    100227    2   udp   2049  nfs_acl
    100227    3   udp   2049  nfs_acl
    100021    1   udp   4003  nlockmgr
    100021    3   udp   4003  nlockmgr
    100021    4   udp   4003  nlockmgr
    100021    1   tcp   4002  nlockmgr
    100021    3   tcp   4002  nlockmgr
    100021    4   tcp   4002  nlockmgr

ACL 설정

/etc/sysconfig/nfs 에서 지정한 포트로 ACL 설정

서비스 포트 프로토콜
NFS 2049 tcp/udp
PORTMAP 111 tcp/udp
MOUNTD 4000 tcp/udp
STATD 4001 tcp/udp
LOCKD 4002 tcp
LOCKD 4003 udp

기타