centos防火墻的開(kāi)關(guān)
-
systemctl status firewalld.service
狀態(tài) -
systemctl start firewalld.service
開(kāi)啟 -
systemctl stop firewalld.service
關(guān)閉 -
firewall-cmd --reload
重啟
端口開(kāi)放
-
firewall-cmd --list-ports
查看已經(jīng)開(kāi)放的端口
firewall-cmd --zone=public --add-port=22122/tcp --permanent
- --permanent 表示重啟后仍有效(永久添加)
firewall-cmd --reload
firewall-cmd --query-port=22122/tcp
- 查看指定端口有沒(méi)有開(kāi)放