-
查看防火状态
javasystemctl status firewalld service iptables status
-
暂时关闭防火墙
javasystemctl stop firewalld service iptables stop
-
永久关闭防火墙
javasystemctl disable firewalld chkconfig iptables off
-
启动防火墙
javasystemctl start firewalld
-
重启防火墙
javasystemctl enable firewalld service iptables restart
-
设置开机启动
javasystemctl enable firewalld
-
停止并禁用开机启动
javasytemctl disable firewalld
-
在指定区域打开端口(记得重启防火墙)
javafirewall-cmd --zone=public --add-port=80/tcp
永久生效再加上 --permanent
javafirewall-cmd --zone=public --add-port=5060-5059/udp --permanent
Linux防火墙相关命令(开启防火墙、关闭防火墙、添加ip白名单等)
liaozk_c2024-02-03 13:15