开放端口
firewall-cmd --zone=public --add-port=80/tcp --permanent # 开放80端口
systemctl restart firewalls.service # 重启防火墙
查看已开启的端口
firewall-cmd --list-ports
启动与停止
firewall-cmd --state # 查看防火墙状态
systemctl stop firewalls.service # 停止防火墙
systemctl start firewalls.service # 启动防火墙
systemctl restart firewalls.service # 重启防火墙
查看正在监听的端口和进程信息
netstat -ntlp
标签:Centos,service,--,端口,防火墙,systemctl,常用命令,firewalls
From: https://www.cnblogs.com/ahci316/p/17653858.html