-
开启防火墙:
systemctl start firewalld
-
关闭防火墙:
systemctl stop firewalld
-
查看防火墙状态:
systemctl status firewalld
-
设置开机启动:
systemctl enable firewalld
-
禁用开机启动:
systemctl disable firewalld
-
重启防火墙:
firewall-cmd --reload
-
开放端口(修改后需要重启防火墙方可生效):
firewall-cmd --zone=public --add-port=8080/tcp --permanent
-
查看开放的端口:
firewall-cmd --list-ports
-
关闭端口:
firewall-cmd --zone=public --remove-port=8080/tcp --permanent
Linux firewall 常用命令
最新推荐文章于 2024-07-09 08:52:09 发布