centos 防火墙

查看防火墙状态

firewall-cmd --state

关闭、启动防火墙

systemctl start firewalld.service
systemctl stop firewalld.service

设置为开机自启、禁用

systemctl enable firewalld.service
systemctl disable firewalld.service

查看端口开放状态

firewall-cmd --query-port=12321/tcp

开放某个端口

firewall-cmd --add-port=12321/tcp --permanent

firewall-cmd --reload

 

你可能感兴趣的:(centos 防火墙)