linux防火牆的常用命令

2021-10-07 15:21:19 字數 1024 閱讀 1876

以下的*號,表示你要開啟或者關閉的埠號

安裝firewall命令:

yum install firewalld firewalld-config

firewall對外開啟永久埠號命令:

firewall-cmd --zone=public–add-port=*/tcp --permanent

firewall關閉常見埠命令:

firewall-cmd --zone=public–remove-port=*/tcp --permanent

批量新增區間埠

firewall-cmd --zone=public–add-port=-/udp --permanent

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

開啟防火牆命令:

systemctl start firewalld.service

重啟防火牆命令:

firewall-cmd --reload 或者 service firewalld restart

檢視埠列表:

firewall-cmd --permanent --list-port

禁用防火牆

systemctl stop firewalld

設定開機啟動

systemctl enable firewalld

停止並禁用開機啟動

sytemctl disable firewalld

檢視防火牆狀態

systemctl status firewalld或者firewall-cmd --state

#/etc/init.d/iptables status

關閉防火牆服務:

#/etc/init.d/iptables stop

檢視埠號的狀態

ps -ef | grep *

nginx的開啟和關閉命令

./nginx -s stop

./nginx

./nginx -s reload

linux 防火牆常用命令

檢視防火牆狀態 service iptables status 停止防火牆 service iptables stop 啟動防火牆 service iptables start 重啟防火牆 service iptables restart 關閉防火牆 chkconfig iptables off 關...

CentOS 防火牆常用命令

1.檢視防火牆狀態 firewall cmd state 2.啟動防火牆 systemctl start firewalld 3.關閉防火牆 systemctl stop firewalld 4.檢查防火牆開放的埠 firewall cmd permanent zone public list po...

Linux 防火牆 常用命令 基於Centos7

啟動 systemctl start firewalld 關閉 systemctl stop firewalld 檢視狀態 systemctl status firewalld 開機禁用 systemctl disable firewalld 開機啟用 systemctl enable firewa...