https://blog.csdn.net/xyy1028/article/details/104787061
一.系统防火墙
1.启动防火墙
systemctl start firewalld
2.关闭防火墙
systemctl stop firewalld
3.查看状态
systemctl status firewalld
4.开机启用防火墙
systemctl enable firewalld
5.开机禁用防火墙
systemctl disable firewalld
二.某个端口的防火墙
1.开放某个端口,如8080端口
firewall-cmd --zone=public --add-port=8080/tcp --permanent
重新加载配置
firewall-cmd --reload
2.查看防火墙锁开放的端口
firewall-cmd --zone=public --list-ports
3.查看某个端口的访问权限,如8080
firewall-cmd --zone=public --query-port=8080/tcp
4.关闭某个端口的防火墙,如8080端口
firewall-cmd --zone=public --remove-port=8080/tcp --permanent