linux开启防火墙端口

即时生效,重启后失效

开启: service iptables start
关闭: service iptables stop

重启后生效
开启: chkconfig iptables on
关闭: chkconfig iptables off 

修改/etc/sysconfig/iptables 文件,增加对应的端口:例如增加一个8099端口
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 8999 -j ACCEPT

#/etc/rc.d/init.d/iptables  restart 重新生效

猜你喜欢

转载自xuguiyi1000.iteye.com/blog/1169136
今日推荐