赞
踩
**
**
1.防火墙状态查看
sudo systemctl status firewalld
2.防火墙关闭
sudo systemctl stop firewalld
永久关闭
sudo systemctl disable firewalld
3.防火墙开启
sudo systemctl start firewalld
永久开启,需重启系统
sudo systemctl enable firewalld
4.重启防火墙
sudo systemctl restart firewalld
**
**
1.安装防火墙命令,有则不需安装
yum install firewalld firewalld-config
2.开放端口tcp/udp
sudo firewall-cmd --zone=public --add-port=80/tcp --permanent
sudo firewall-cmd --zone=public --add-port=91/udp --permanent
批量操作
sudo firewall-cmd --zone=public --add-port=80-89/udp --permanent
sudo firewall-cmd --zone=public --add-port=90-99/tcp --permanent
3.关闭端口tcp/udp
sudo firewall-cmd --zone=public --remove-port=80/tcp --permanent
sudo firewall-cmd --zone=public --remove-port=91/udp --permanent
4.查看开放的端口列表
sudo firewall-cmd --permanent --list-port
5.端口修改玩后,需重置防火墙
sudo firewall-cmd --reload
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。