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、查看防火墻狀態
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、其他端口的開放模式就是類似如此開放模式。
總結
以上是生活随笔為你收集整理的CentOS 配置防火墙如何操作(启.停.开.闭端口)?的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 黯字开头的成语有哪些?
- 下一篇: win10系统如何彻底关闭迅雷看看播放器