linux防火牆相關操作

2021-08-28 21:24:37 字數 1315 閱讀 6388

關閉 iptables –f

重啟防火牆 service iptables restart

編輯防火牆  vi /etc/sysconfig/iptables

閘道器允許埠通過指令 -a rh-firewall-1-input -m state --state new -m tcp -p tcp --dport 3306 -j accept

systemctl status firewalld(檢視防火牆狀態)

這樣的說明沒有問題

systemctl stop firewalld(關閉防火牆狀態)

systemctl start irewalld(啟動防火牆狀態)

表示防火牆為執行裝狀態,啟動成功

3.配置firewalld-cmd

檢視版本: firewall-cmd --version

檢視幫助: firewall-cmd --help

顯示狀態: firewall-cmd --state

檢視所有開啟的埠: firewall-cmd --zone=public --list-ports

更新防火牆規則: firewall-cmd --reload

檢視區域資訊:  firewall-cmd --get-active-zones

檢視指定介面所屬區域: firewall-cmd --get-zone-of-inte***ce=eth0

拒絕所有包:firewall-cmd --panic-on

取消拒絕狀態: firewall-cmd --panic-off

檢視是否拒絕: firewall-cmd --query-panic

防火牆服務埠操作

新增firewall-cmd --zone=public --add-port=80/tcp --permanent    (--permanent永久生效,沒有此引數重啟後失效)

重新載入

firewall-cmd --reload

檢視firewall-cmd --zone= public --query-port=80/tcp

刪除firewall-cmd --zone= public --remove-port=80/tcp –permanent

linux防火牆相關操作

關閉防火牆 systemctl stop firewalld.service 或者 service firewalld stop 開啟防火牆 systemctl start firewalld 重啟防火牆 firewall cmd reload 重新載入配置,在新增規則之後,需要執行此命令 禁止防火...

防火牆相關操作

1 防火牆相關操作 centos7中firewall cmd tab命令時總是not running,系統其它命令是可以正常tab的啊 以為是核心版本的問題,公升級核心和系統還是無效.幾經折騰原來是firewalld服務沒有開,這個服務系統沒有自動開啟讓人有點意外.centos7中啟用firewal...

linux防火牆相關

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