linux centos开启端口方案

1、设定

[root@localhost~]#/sbin/iptables-IINPUT-ptcp--dport80-jACCEPT

[root@localhost~]#/sbin/iptables-IINPUT-ptcp--dport22-jACCEPT

[root@localhost~]#/sbin/iptables-IINPUT-ptcp--dport3306-jACCEPT

2、保存

[root@localhost~]#/etc/rc.d/init.d/iptablessave

3、重启防火墙

[root@localhost~]#serviceiptablesrestart

4、查看

[root@localhost~]#/etc/init.d/iptablesstatus

相关推荐