CentOS调整防火墙设置

 CentOS:调整防火墙设置


首先编辑iptables
vi /etc/sysconfig/iptables
注意规则的顺序,最后一条语句是禁止所有的,放行的规则要放在它前面
插入:
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 3306 -j ACCEPT
即打开3306端口
然后重起防火墙服务,使配置文件生效
[root@lyhome ~]# cd /etc/rc.d/init.d
[root@lyhome init.d]# ./iptables
Usage: ./iptables {start|stop|restart|condrestart|status|panic|save}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章