CentOS7查看開放端口命令及開放端口號

查看已開放的端口

firewall-cmd --list-ports

開放端口(開放後需要要重啓防火牆才生效

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

重啓防火牆

firewall-cmd --reload

關閉端口(關閉後需要要重啓防火牆才生效

firewall-cmd --zone=public --remove-port=3338/tcp --permanent

開機啓動防火牆

systemctl enable firewalld

開啓防火牆

systemctl start firewalld

禁止防火牆開機啓動

systemctl disable firewalld

停止防火牆

systemctl stop firewalld

發佈了64 篇原創文章 · 獲贊 39 · 訪問量 7萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章