centos7防火牆命令

2022-07-31 03:42:16 字數 641 閱讀 6244

一、防火牆的開啟、關閉、禁用命令

(1)設定開機啟用防火牆:systemctl enable firewalld.service

(2)設定開機禁用防火牆:systemctl disable firewalld.service

(3)啟動防火牆:systemctl start firewalld

(4)關閉防火牆:systemctl stop firewalld

(5)檢查防火牆狀態:systemctl status firewalld 

二、使用firewall-cmd配置埠

(1)檢視防火牆狀態:firewall-cmd --state

(3)檢視開放的埠:firewall-cmd --list-ports

(4)開啟防火牆埠:firewall-cmd --zone=public --add-port=3306/tcp --permanent

命令含義:

–zone #作用域

–add-port=3306/tcp #新增埠,格式為:埠/通訊協議

–permanent #永久生效,沒有此引數重啟後失效

(5)關閉防火牆埠:firewall-cmd --zone=public --remove-port=3306/tcp --permanent

centos7 防火牆命令

1 firewalld的基本使用 啟動 systemctl start firewalld 關閉 systemctl stop firewalld 檢視狀態 systemctl status firewalld 開機禁用 systemctl disable firewalld 開機啟用 system...

CentOS7 防火牆命令

firewall cmd state 檢視防火牆狀態,是否是running firewall cmd reload 重新載入配置,比如新增規則之後,需要執行此命令 firewall cmd get zones 列出支援的zone firewall cmd get services 列出支援的服務,在...

CentOS7防火牆命令

我上次裝了乙個centos8的linux系統,試了一下防火牆的相關命令,和centos7差不多 現在市面上應該主流centos7,哈哈,個人見解 firewall cmd list ports例如 開放8080埠 firewall cmd zone public add port 8080 tcp ...