cd /etc/firewalld/zones
这个目录下有个public.xml文件,修改或添加:
<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"/>
<port protocol="tcp" port="3306"/>
<port protocol="tcp" port="8080"/>
<port protocol="tcp" port="8088"/>
</zone>
上面的端口号即是配置的可访问端口。
systemctl stop firewalld
systemctl start firewalld