如下NFS启动后的端口: [root@linux2 ~]# rpcinfo -p localhost program vers proto port 100000 2 tcp 111 portmapper 100000 2 udp 111 portmapper 100011 1 udp 954 rquotad 100011 2 udp 954 rquotad 100011 1 tcp 957 rquotad 100011 2 tcp 957 rquotad 100003 2 udp 2049 nfs 100003 3 udp 2049 nfs 100003 4 udp 2049 nfs 100021 1 udp 31718 nlockmgr 100021 3 udp 31718 nlockmgr 100021 4 udp 31718 nlockmgr 100003 2 tcp 2049 nfs 100003 3 tcp 2049 nfs 100003 4 tcp 2049 nfs 100021 1 tcp 29916 nlockmgr 100021 3 tcp 29916 nlockmgr 100021 4 tcp 29916 nlockmgr 100005 1 udp 990 mountd 100005 1 tcp 993 mountd 100005 2 udp 990 mountd 100005 2 tcp 993 mountd 100005 3 udp 990 mountd 100005 3 tcp 993 mountd分配端口,编辑配置文件 vi /etc/sysconfig/nfs RQUOTAD_PORT=30001 LOCKD_TCPPORT=30002 LOCKD_UDPPORT=30002 MOUNTD_PORT=30003 STATD_PORT=30004重启portmap和nfs: service portmap restart service nfs restartiptables设置: iptables -I INPUT 5 -s 192.168.1.0/24 -p tcp -m state --state NEW -m tcp --dport 111 -j ACCEPT iptables -I INPUT 6 -s 192.168.1.0/24 -p udp --dport 111 -j ACCEPT iptables -I INPUT 7 -s 192.168.1.0/24 -p tcp -m state --state NEW -m tcp --dport 2049 -j ACCEPT iptables -I INPUT 8 -s 192.168.1.0/24 -p udp --dport 2049 -j ACCEPT iptables -I INPUT 9 -s 192.168.1.0/24 -p tcp -m state --state NEW -m tcp --dport 30001:30004 -j ACCEPT iptables -I INPUT 10 -s 192.168.1.0/24 -p udp --dport 30001:30004 -j ACCEPT 转载请保留固定链接: https://linuxeye.com/configuration/1920.html |