CentOS配置防火墙操作示例(启动、停止、开启、关闭端口):注:防火墙基本操作命令:查询防火墙状态:[root@localhost~]#serviceiptablesstatusStop防火墙:[root@localhost~]#serviceiptablesstop启动防火墙:[root@localhost~]#serviceiptablesstart重启防火墙:[root@localhost~]#serviceiptablesrestart***关闭防火墙:[root@localhost~]#chkconfigiptablesoff***关闭后启用:[root@localhost~]#chkconfigiptableson1.检查防火墙状态[root@localhost~]#serviceiptablesstatus2.编辑/etc/sysconfig/iptables文件。在我们的例子中,我们需要打开8080端口和9990端口,用编辑器打开/etc/sysconfig/iptables3,照例添加8080端口和99904端口,保存文件/etc/sysconfig/iptables,执行[root@localhost~]#serviceiptablesrestart5.再次检查防火墙状态[root@localhost~]#serviceiptablesstatus6.此时服务器的8080和9990端口就可以对外提供服务了。7、其他端口的开启方式与本开启方式类似。原文链接:http://my.oschina.net/u/593517/blog/297941