1. 安装防火墙
yum install firewalld systemd -y
2. 手动开放防火墙端口
-
查看防火墙全部设置
firewall-cmd --list-all
-
若防火墙服务未启动可执行
systemctl start firewalld
-
检查端口是否开放
firewall-cmd --query-port 80/tcp
-
设置nexus服务端口防火墙可访问
firewall-cmd --zone=public --add-port=80/tcp --permanent
-
重新加载防火墙设置
firewall-cmd --reload
-
重新查看防火墙全部设置确认添加成功
firewall-cmd --list-all
-
移除端口
firewall-cmd --zone=public --remove-port=9090/tcp --permanent
3. systemctl 命令
-
查看防火墙的状态
systemctl status firewalld.service
-
启动防火墙
systemctl start firewalld.service
-
关闭防火墙
systemctl stop firewalld.service
-
重启防火墙
systemctl restart firewalld.service
-
开机启动防火墙
systemctl enable firewalld.service
-
开机禁用防火墙
systemctl disable firewalld.service
-
查看防火墙是否开机启动
systemctl is-enabled firewalld.service标签:service,--,端口,firewalld,防火墙,firewall,systemctl,Linux From: https://www.cnblogs.com/songweipeng/p/16709980.html