centos8 防火墙相关指令
查看防火墙某个端口是否开放
Section titled “查看防火墙某个端口是否开放”firewall-cmd --query-port=6379/tcp开放防火墙端口
Section titled “开放防火墙端口”firewall-cmd --zone=public --add-port=6379/tcp --permanentfirewall-cmd --zone=public --remove-port=6379/tcp --permanent重新载入配置,让开放或关闭的端口配置生效
Section titled “重新载入配置,让开放或关闭的端口配置生效”firewall-cmd --reload查看防火墙状态
Section titled “查看防火墙状态”systemctl status firewalldsystemctl stop firewalldsystemctl start firewalldsystemctl restart firewalld开放一段端口
Section titled “开放一段端口”firewall-cmd --zone=public --add-port=40000-45000/tcp --permanent查看开放的端口列表
Section titled “查看开放的端口列表”firewall-cmd --zone=public --list-ports