redhat6.5文件共享

以下操作均需要root用户

a端:

固定nfs端口
#vi /etc/sysconfig/nfs
将里面的RQUOTAD_PORT、LOCKD_TCPPORT、LOCKD_UDPPORT、MOUNTD_PORT、STATD_PORT前面注释去掉,保存退出

编辑共享目录配置
#vi /etc/exports
添加
/usr/irsapp/irs_upload_files/ 10.1.90.14(insecure,rw,sync,no_root_squash)
保存退出

重启nfs服务
#service nfs restart

将以上端口和 nfs 2049、portmapper111 添加进防火墙规则
#vi /etc/sysconfig/iptables

-A INPUT -m state --state NEW -m udp -p udp --dport 111 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 111 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 2049 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 2049 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 892 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 892 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 662 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 662 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 875 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 875 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 32803 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 32803 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 32769 -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 32769 -j ACCEPT 保存退出,重启防火墙 #service iptables restart b端 #mount
10.1.90.13:/usr/irsapp/irs_upload_files/ /usr/irsapp/irs_upload_files/ 设置开机自动挂载 #vi /etc/rc.local 在最后面添加上面的挂载命令
原文地址:https://www.cnblogs.com/live365wang/p/5070203.html