NFS 防火墙

nfs: /home/workspace 172.16.10.0/24(insecure,rw,sync,no_subtree_check,no_root_squash,anonuid=501,anongid=501)


.修改/etc/service,添加以下内容(端口号必须在1024以下,且未被占用)
# Local services
mountd 1011/tcp #rpc.mountd
mountd 1011/udp #rpc.mountd
rquotad 1012/tcp #rpc.rquotad
rquotad 1012/udp #rpc.rquotad

3.重起nfs服务
service nfs restart
chkconfig nfs on

4.此时rpc相关端口已经被固定,可以添加防火墙规则

#rpc
-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 111 -j ACCEPT
#nfsd
-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 2049 -j ACCEPT

#mountd
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1011 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 1011 -j ACCEPT
#rquotad
-A INPUT -m state --state NEW -m tcp -p tcp --dport 1012 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 1012 -j ACCEPT
#rpc.statd
-A INPUT -m state --state NEW -m tcp -p tcp --dport 32768 -j ACCEPT
-A INPUT -m state --state NEW -m udp -p udp --dport 32768 -j ACCEPT

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值