文章目录
- 1.查看已开放的端口
- firewall-cmd --list-ports
- 2.查询端口号8080 是否开启
- firewall-cmd --query-port=8080/tcp
- 3.开放端口(开放后需要要重启防火墙才生效)
- firewall-cmd --zone=public --add-port=8080/tcp --permanent
- 4.重启防火墙
- firewall-cmd --reload
- 5.关闭端口(关闭后需要要重启防火墙才生效)
- firewall-cmd --zone=public --remove-port=8080/tcp --permanent
- 6.重启防火墙
- firewall-cmd --reload
- 7.查看防火墙状态
- systemctl status firewalld
- 8.开启
- sudo service firewalld start
- systemctl start firewalld
- 9.关闭
- sudo service firewalld stop
- systemctl stop firewalld
1.查看已开放的端口
firewall-cmd --list-ports
2.查询端口号8080 是否开启
firewall-cmd --query-port=8080/tcp
3.开放端口(开放后需要要重启防火墙才生效)
firewall-cmd --zone=public --add-port=8080/tcp --permanent
4.重启防火墙
firewall-cmd --reload
5.关闭端口(关闭后需要要重启防火墙才生效)
firewall-cmd --zone=public --remove-port=8080/tcp --permanent
6.重启防火墙
firewall-cmd --reload
7.查看防火墙状态
systemctl status firewalld
8.开启
sudo service firewalld start
systemctl start firewalld
9.关闭
sudo service firewalld stop
systemctl stop firewalld