linux防火牆相關指令

2021-10-09 17:30:18 字數 643 閱讀 6874

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

10關閉mongodb

use admin

db.runcommand(「shutdown」)

linux防火牆相關

linux 防火牆 selinux設定 sestatus v 檢視selinux執行狀態 semanage fcontext a t httpd sys content t home deploy share portal 設定目錄許可權 nginx403錯誤 restorecon rv home ...

linux防火牆關閉指令

問題 老是關閉防火牆太麻煩,所以選擇徹底關閉防火牆,發現每次都記不住命令 下面是red hat centos7關閉防火牆的命令 systemctl status firewalld service iptables status systemctl stop firewalld service ip...

Linux常用指令 防火牆

sudo firewall cmd add port 1431 tcp permanent sudo firewall cmd add port 1432 tcp permanent sudo firewall cmd add port 1425 tcp permanent sudo firewal...