答案就是修改配置文件!
在/etc/firewalld/zones/public.xml中
[root@xxx ~]# vim /etc/firewalld/zones/public.xml
<?xml version="1.0" encoding="utf-8"?>
<zone>
<short>Public</short>
<description>For use in public areas. You do not trust the other computers on networks to not harm your computer. Only selected incoming connections are accepted.</description>
<service name="ssh"/>
<service name="dhcpv6-client"/>
<service name="http"/>
<service name="https"/>
<!--此处是开放端口-->
<port protocol="tcp" port="80"/>
<!--此处是开放端口规则-->
<rule family="ipv4">
<source address="172.17.0.0/16"/>
<accept/>
</rule>
</zone>
如果要添加规则或者端口的话直接按照他的格式写就可以了。
标签:xml,查看,端口,防火墙,firewalld,zones,etc,public From: https://www.cnblogs.com/Vikyanite/p/17085618.html