Centos 7 firewall 命令:

SIMBA1949發表於2018-04-07

Centos 7 firewall 命令:

檢視已經開放的埠:

firewall-cmd –list-ports
開啟埠

firewall-cmd –zone=public –add-port=80/tcp –permanent
命令含義:

–zone #作用域

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

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

重啟防火牆

firewall-cmd –reload #重啟firewall
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall開機啟動
firewall-cmd –state #檢視預設防火牆狀態(關閉後顯示notrunning,開啟後顯示running)

相關文章