CentOS 防火牆常用命令

2021-10-09 17:09:27 字數 575 閱讀 6929

1.檢視防火牆狀態:

firewall-cmd --state

2.啟動防火牆

systemctl start firewalld

3.關閉防火牆

systemctl stop firewalld

4.檢查防火牆開放的埠

firewall-cmd --permanent --zone=public --list-ports

5.開放乙個新的埠

firewall-cmd --zone=public --add-port=8080/tcp --permanent

6.重啟防火牆

firewall-cmd --reload

7.驗證新增加埠是否生效

firewall-cmd --zone=public --query-port=8080/tcp

8.防火牆開機自啟動

systemctl enable firewalld.service

9.防火牆取消某一開放埠

firewall-cmd --zone=public --remove-port=9200/tcp --permanent

五 cent OS防火牆常用命令

檢視防火牆開閉狀態 systemctl status firewalld 開啟防火牆 systemctl start firewalld 關閉防火牆 systemctl stop firewalld 檢視已開啟埠 firewall cmd zone public list ports 增加防火牆開放...

CentOS7 防火牆常用命令

啟動 systemctl start firewalld 檢視狀態 systemctl status firewalld 禁用,禁止開機啟動 systemctl disable firewalld 停止執行 systemctl stop firewalld 重啟防火牆 systemctl resta...

centos7防火牆常用命令

centos7使用systemctl指令來管理系統的單一服務,在centos7中對於firewalld 防火牆 服務的開啟 關閉 狀態查詢也同樣是使用該指令,操作如下 啟動防火牆 systemctl start firewalld 檢視防火牆狀態 systemctl status firewalld...