CentOS 8 开放、关闭防火墙端口

查看防火墙某个端口是否开放:

firewall-cmd --query-port=80/tcp

开放防火墙端口80:

firewall-cmd --zone=public --add-port=80/tcp --permanent

关闭80端口:

firewall-cmd --zone=public --remove-port=80/tcp --permanent

配置立即生效:

firewall-cmd --reload

查看防火墙状态:

systemctl status firewalld

关闭防火墙:

systemctl stop firewalld

打开防火墙:

systemctl start firewalld

开放一段端口:

firewall-cmd --zone=public --add-port=8121-8124/tcp --permanent

查看开放的端口列表:

firewall-cmd --zone=public --list-ports

参考链接 https://www.cnblogs.com/suhq/p/13539287.html

Linux技术

Linux的SSH无法连接 报错ssh: connect to host 192.168.40.128 port 22: Connection refused

2021-8-13 23:05:00

Linux技术网络

Nginx 常用配置清单

2021-6-30 12:27:00