开放端口
永久开放2个端口
firewall-cmd --permanent --zone=public --add-port=80/tcp
firewall-cmd --permanent --zone=public --add-port=443/tcpfirewall-cmd --reload
在 /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"/><port protocol="tcp" port="80"/><port protocol="tcp" port="443"/>
</zone>