- portmap 서비스는 NIS와 NFS와 같은 RPC 서비스에 사용되는 동적 포트 할당 데몬이다. 이 데몬은 허술한 인증 메커니즘을 갖추고 있으며 데몬이 제어하는 서비스에 광범위한 포트를 할당 가능하다. 보안 문제로 NFS version 4 부터는 사용되지 않는다.
- NFS Version 4는 default 로 TCP 2049 port 를 사용한다.
- NFS Version 2 또는 3를 특정한 목적으로 사용하려면 /etc/nfsmount.conf 를 수정한다.
시험 등의 이유로 TCP 111 portmap 을 사용하려면 version 3과 같이 변경하여 재실행한다.
[root@sv ~]# vim /etc/nfsmount.conf 1 # 2 # /etc/nfsmount.conf - see nfsmount.conf(5) for details 3 # 4 # This is an NFS mount configuration file. This file can be broken 5 # up into three different sections: Mount, Server and Global 6 # 7 # [ MountPoint "Mount_point" ] 8 # This section defines all the mount options that 9 # should be used on a particular mount point. The '<Mount_Point>' 10 # string need to be an exact match of the path in the mount 11 # command. Example: 12 # [ MountPoint "/export/home" ] 13 # background=True 14 # Would cause all mount to /export/home would be done in 15 # the background 16 # 17 # [ Server "Server_Name" ] 18 # This section defines all the mount options that 19 # should be used on mounts to a particular NFS server. 20 # Example: 21 # [ Server "nfsserver.foo.com" ] 22 # rsize=32k 23 # wsize=32k 24 # All reads and writes to the 'nfsserver.foo.com' server 25 # will be done with 32k (32768 bytes) block sizes. 26 # 27 [ NFSMount_Global_Options ] 28 # This statically named section defines global mount 29 # options that can be applied on all NFS mount. 30 # 31 # Protocol Version [2,3,4] 32 # This defines the default protocol version which will 33 # be used to start the negotiation with the server. 34 # Defaultvers=4 35 Defaultvers=3 |
- NFS mount 등록
[Client] [root@backupsv ~]# cat /etc/fstab ### TEST ### 1.2.3.4:/backup /mnt/test nfs _netdev 0 0 [Server] root@mantis:~# cat /etc/exports # /etc/exports: the access control list for filesystems which may be exported # to NFS clients. See exports(5). # # Example for NFSv2 and NFSv3: # /srv/homes hostname1(rw,sync,no_subtree_check) hostname2(ro,sync,no_subtree_check) # # Example for NFSv4: # /srv/nfs4 gss/krb5i(rw,sync,fsid=0,crossmnt,no_subtree_check) # /srv/nfs4/homes gss/krb5i(rw,sync,no_subtree_check) # /backup 1.2.3.1(rw,sync,no_root_squash,insecure) #1.2.3.1 -> Client IP |
- NFS 상태보기
root@mantis:~# 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 100024 1 udp 55221 status 100024 1 tcp 45292 status 100003 2 tcp 2049 nfs 100003 3 tcp 2049 nfs 100003 4 tcp 2049 nfs 100227 2 tcp 2049 100227 3 tcp 2049 100003 2 udp 2049 nfs 100003 3 udp 2049 nfs 100003 4 udp 2049 nfs 100227 2 udp 2049 100227 3 udp 2049 100021 1 udp 35303 nlockmgr 100021 3 udp 35303 nlockmgr 100021 4 udp 35303 nlockmgr 100021 1 tcp 54568 nlockmgr 100021 3 tcp 54568 nlockmgr 100021 4 tcp 54568 nlockmgr 100005 1 udp 38059 mountd 100005 1 tcp 60772 mountd 100005 2 udp 56138 mountd 100005 2 tcp 42808 mountd 100005 3 udp 34607 mountd 100005 3 tcp 57931 mountd root@mantis:~# nfsstat Server rpc stats: calls badcalls badclnt badauth xdrcall 61998948 16 16 0 0 Server nfs v3: null getattr setattr lookup access readlink 14 100% 0 0% 0 0% 0 0% 0 0% 0 0% read write create mkdir symlink mknod 0 0% 0 0% 0 0% 0 0% 0 0% 0 0% remove rmdir rename link readdir readdirplus 0 0% 0 0% 0 0% 0 0% 0 0% 0 0% fsstat fsinfo pathconf commit 0 0% 0 0% 0 0% 0 0% Server nfs v4: null compound 365 0% 61998558 99% Server nfs v4 operations: op0-unused op1-unused op2-future access close commit 0 0% 0 0% 0 0% 25983 0% 13734 0% 0 0% create delegpurge delegreturn getattr getfh link 0 0% 0 0% 0 0% 159412 0% 25851 0% 0 0% lock lockt locku lookup lookup_root nverify 0 0% 0 0% 0 0% 12323 0% 0 0% 0 0% open openattr open_conf open_dgrd putfh putpubfh 13785 0% 0 0% 404 0% 0 0% 61968742 49% 0 0% putrootfh read readdir readlink remove rename 784 0% 61807956 49% 1661 0% 0 0% 1 0% 0 0% renew restorefh savefh secinfo setattr setcltid 28157 0% 0 0% 0 0% 0 0% 0 0% 417 0% setcltidconf verify write rellockowner bc_ctl bind_conn 417 0% 0 0% 0 0% 0 0% 0 0% 0 0% exchange_id create_ses destroy_ses free_stateid getdirdeleg getdevinfo 0 0% 0 0% 0 0% 0 0% 0 0% 0 0% getdevlist layoutcommit layoutget layoutreturn secinfononam sequence 0 0% 0 0% 0 0% 0 0% 0 0% 0 0% set_ssv test_stateid want_deleg destroy_clid reclaim_comp 0 0% 0 0% 0 0% 0 0% 0 0% Client rpc stats: calls retrans authrefrsh 4 0 4 root@mantis:~# |
'Engineering > __00. Linux' 카테고리의 다른 글
maximum file count (0) | 2018.03.13 |
---|---|
[Ubuntu] system boot problem (0) | 2017.04.24 |
[SSH] alive (0) | 2016.11.08 |
[LVM] LVM 관련 (0) | 2016.06.09 |
[MAN] ip command (0) | 2016.04.20 |