https://blog.csdn.net/codewarrior_/article/details/79570086
https://blog.csdn.net/sdd220/article/details/77716824/
https://www.cnblogs.com/leoxuan/p/8275343.html
查看状态:
firewall-cmd --state
systemctl status firewalld
查看端口开放情况:
firewall-cmd --list-ports
开放端口:
firewall-cmd --zone=public --add-port=80/tcp --permanent
返回success为成功
命令含义:
--zone #作用域
--add-port=80/tcp #添加端口,格式为:端口/通讯协议
--permanent #永久生效
重启防火墙:
systemctl restart firewalld.service
关闭防火墙:
systemctl stop firewalld.service
禁止firewall开机启动
systemctl disable firewalld.service
查看监听(Listen)的端口
netstat -lntp
检查端口被哪个进程占用
netstat -lnp|grep 8080