防火牆的基本操作命令
查詢防火牆狀態:[root@localhost ~]# service iptables status<回車>
停止防火牆:[root@localhost ~]# service iptables stop <回車>
啟動防火牆:[root@localhost ~]# service iptables start <回車>
重啟防火牆:[root@localhost ~]# service iptables restart <回車>
永久關閉防火牆:[root@localhost ~]# chkconfig iptables off<回車>
永久關閉後啟用:[root@localhost ~]# chkconfig iptables on<回車>
1、查看防火牆狀態

2、編輯/etc/sysconfig/iptables文件。我們實例中要打開8080端口和9990端口
用編輯器打開/etc/sysconfig/iptables
3、依葫蘆畫瓢,我們添加8080端口和9990端口
4、保存/etc/sysconfig/iptables文件,並在終端執行
[root@localhost ~]# service iptables restart <回車>

5、從新查看防火牆狀態
[root@localhost ~]# service iptables status<回車>

6、這時候,服務器的8080和9990端口就可以對外提供服務了。
7、其他端口的開放模式就是類似如此開放模式。