vim /etc/firewalld/zones/public.xml
# 仅192.168.2.5可访问18080端口
<rule family=;ipv4;>
<source address=;192.168.2.5;/>
<port portocol=;tcp; port=;18080;/>
<accept/>
</rule>
#所有IP可访问10022端口
<rule family=;ipv4;>
<port portocol=;tcp; port=;10022;/>
<accept/>
</rule>
重新加载firewalld
firewall-cmd --reload
查看已经设置的规则
firewall-cmd --zone=public --list-rich-rules