Linux環境防火牆配置及開放端口設置(Centos7)


環境:Centos7

一、防火牆配置

① 查看防火牆狀態:systemctl status firewalld

② 啟用防火牆:systemctl start firewalld

③ 禁用防火牆:systemctl stop firewalld

④ 重啟防火牆:systemctl restart firewalld

 

二、對外端口配置

① 查看防火牆規則:firewall-cmd --list-all

② 查詢端口是否開放:firewall-cmd --query-port=端口/tcp

③ 增加開放端口: firewall-cmd --permanent --add-port=端口/tcp

④ 移除端口:firewall-cmd --permanent --remove-port=端口/tcp

⑤ 重啟防火牆:firewall-cmd --reload


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM