System environment:
SLES SP4
NFS Server ip:192.168.74.141
NFS Client ip:192.168.74.142
The NFS suite is installed by default in the SLEs environment and can be confirmed using Zypper se NFS.
#service nfsserver Start /etc/exports #添加以下内容 192.168. 74.142(rw,no_root_squash,no_all_squash,sync,anonuid=501, anongid=501-RV -E #服务器上确认导出NFS状态正常
Next, configure the Firewall on NFS server ( This is the focus )
# # Rpcinfo-p program vers proto Port service100000 4Tcp111Portmapper100000 3Tcp111Portmapper100000 2Tcp111Portmapper100000 4Udp111Portmapper100000 3Udp111Portmapper100000 2Udp111Portmapper100005 1Udp53075Mountd100005 1Tcp42607Mountd100005 2Udp49948Mountd100005 2Tcp48332Mountd100005 3Udp53662Mountd100005 3Tcp60244Mountd100024 1Udp57614Status100024 1Tcp45583Status100003 2Tcp2049NFS100003 3Tcp2049NFS100003 4Tcp2049NFS100227 2Tcp2049Nfs_acl100227 3Tcp2049Nfs_acl100003 2Udp2049NFS100003 3Udp2049NFS100003 4Udp2049NFS100227 2Udp2049Nfs_acl100227 3Udp2049Nfs_acl100021 1Udp43109Nlockmgr100021 3Udp43109Nlockmgr100021 4Udp43109Nlockmgr100021 1Tcp53998Nlockmgr100021 3Tcp53998Nlockmgr100021 4Tcp53998Nlockmgr
The NFS server is seen primarily by Portmapper (Port 111), NFS (Port 2049), Mountd (port random), and nlockmgr (Port random) consisting of four services. The ports for Portmapper and NFS are fixed, The mountd,nlockmgr port is not fixed, so it cannot be configured directly on the firewall.
Customize Mountd tcp/udp port=20048, nlockmgr tcp/udp port=51000, open/etc/sysconfig/nfs file
#vi/etc/sysconfig/nfsmountd_port="20048"lockd_tcpport=" 51000 " lockd_udpport="51000"
Change these three lines to secure the mountd,nlockmgr port, reboot the NFS service to make the changed configuration file take effect
#service nfsserver restart# rpcinfo-p program vers proto Port service100000 4Tcp111Portmapper100000 3Tcp111Portmapper100000 2Tcp111Portmapper100000 4Udp111Portmapper100000 3Udp111Portmapper100000 2Udp111Portmapper100005 1Udp20048Mountd100005 1Tcp20048Mountd100005 2Udp20048Mountd100005 2Tcp20048Mountd100005 3Udp20048Mountd100005 3Tcp20048Mountd100024 1Udp33747Status100024 1Tcp43717Status100003 2Tcp2049NFS100003 3Tcp2049NFS100003 4Tcp2049NFS100227 2Tcp2049Nfs_acl100227 3Tcp2049Nfs_acl100003 2Udp2049NFS100003 3Udp2049NFS100003 4Udp2049NFS100227 2Udp2049Nfs_acl100227 3Udp2049Nfs_acl100021 1Udp51000Nlockmgr100021 3Udp51000Nlockmgr100021 4Udp51000Nlockmgr100021 1Tcp51000Nlockmgr100021 3Tcp51000Nlockmgr100021 4Tcp51000Nlockmgr
Next, nfs,111,20048,51000 four ports into the firewall configuration file
#vi/etc/sysconfig/susefirewall2fw_services_ext_tcp="SSH ftp 30000:30100 NFS 111 20048 51000 "fw_services_ext_udp="NFS 111 20048 51000"
Restart the Firewall service for the configuration file to take effect
#/sbin/rcsusefirewall2 restart
Because the NFS suite is installed by default in the SLEs environment, the client does not need to install additional software.
192.168. 74.141 192.168. 74.141:/tmp/mnt
Finally, test the file read/write on NFS.
SLES Suse Linux One-SP4 Environment for NFS Building