CentOs6.4防火牆設置


文章轉載自:http://my.oschina.net/u/593517/blog/297941

注:這里以centos6.4(CentOS-6.4-x86_64-bin-DVD1.iso)為例。

CentOS 配置防火牆操作實例(啟、停、開、閉端口):

注:防火牆的基本操作命令:

查詢防火牆狀態:

[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、查看防火牆狀態

[root@localhost ~]# service iptables status<回車>

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、其他端口的開放模式就是類似如此開放模式


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM