iptables防火墙只允许某IP访问某端口程序.doc

iptables防火墙 只允许某IP访问某端口、访问特定网站 2012-11-15 0 个评论 收藏 我要投稿 1.先备份iptables # cp /etc/sysconfig/iptables /var/tmp 需要开80端口,指定IP和局域网 下面三行的意思: 先关闭所有的80端口 开启ip段/24端的80口 开启ip段23/24端ip段的80口 # iptables -I INPUT -p tcp --dport 80 -j DROP # iptables -I INPUT -s /24 -p tcp --dport 80 -j ACCEPT # iptables -I INPUT -s 23/24 -p tcp --dport 80 -j ACCEPT 以上是临时设置。 2.然后保存iptables # service iptables save 3.重启防火墙 #service iptables restart ===============以下是转载================================================ 以下是端口,先全部封再开某些的IP iptables -I INPUT -p tcp --dport 9889 -j DROP iptables -I INPUT -s /24 -p tcp --dport 9889

文档评论(0)

1亿VIP精品文档

相关文档