开启指定端口:
firewall-cmd --zone=public --add-port=端口号/tcp --permanent
开启指定端口后必须重启防火墙,重启命令
systemctl restart firewalld.service
下面介绍一些防火墙查用命令
查看防火墙状态:
systemctl status firewalld.service
开启防火墙:
systemctl start firewalld.service
关闭防火墙:
systemctl stop firewalld.service
禁止开机启动:
systemctl disable firewalld.service
开启开机启动:
systemctl enable firewalld.service
查看已开放端口:
firewall-cmd --list-ports