防火墙设置-端口只对本机开放

设置端口只对本机开放

查看规则列表

iptables --line -nvL INPUT

根据id删除规则

iptables -t filter -D INPUT 3

更多命令示例:http://www.zsythink.net/archives/1517

端口只对本机开放 — 具体操作

iptables -F  #清除预设表filter中的所有规则链的规则 
iptables -I INPUT -p tcp --dport 9000 -j DROP
iptables -I INPUT -s <本机IP> -ptcp --dport 9000 -j ACCEPT
service iptables save
service iptables restart

© 版权声明
THE END
如果内容对您有所帮助,就支持一下吧!
点赞0 分享
评论 抢沙发

请登录后发表评论

    暂无评论内容