1.下载安装firewall-cmd
yum install firewalld systemd -y
2.查看服务器上是否安装了firewall
systemctl status firewalld
3.开启防火墙
systemctl start firewalld.service
4.关闭防火墙
systemctl stop firewalld.service
5.设置开机启动
systemctl enable firewalld.service
6.设置关闭开机启动
systemctl disable firewalld.service
7.查看端口列表
firewall-cmd --list-ports   
8.开启端口
firewall-cmd --zone=public --add-port=80/tcp --permanent   
9.关闭端口
firewall-cmd --zone=public --remove-port=80/tcp --permanent
10.查看端口
firewall-cmd --zone=public --query-port=80/tcp
Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐