文章詳情頁
CentOS7防火墻和端口相關命令介紹
瀏覽:9日期:2023-03-07 14:40:08
目錄
- 1、查看防火墻當前狀態
- 2、啟動防火墻服務
- 3、關閉防火墻服務
- 4、開放指定端口
- 5、移除指定端口,需重啟防火墻服務才能生效
- 6、重啟防火墻
- 7、設置防火墻開機自啟動
- 總結
以下情況對應的linux系統版本為CentOS7,若使用的環境為CentOS6請使用service iptables state/start/stop/restart替換對應的systemctl status /start/stop/restart firewalld.service命令;
1、查看防火墻當前狀態
方法1
[root@hu ~]# firewall-cmd --state not running ---未運行 [root@hu ~]# firewall-cmd --state running ---運行中
方法2
[root@hu ~]# systemctl status firewalld.service
正常運行中
相關文章:
排行榜