# 编辑防火墙文件vi /etc/firewalld/zones/public.xml
# 允许某个IP访问某个端口或者端口段# 框架<?xml version="1.0"encoding="utf-8"><zone><short>Public</short><descripion>For use in public areas.You do not trust the other computers on networks to not harm your computer.Only selected in comming connection are accepted.</descripion><service name="dhcpv6-client"/># 加入允许的IP和端口</zone># 规则# 10022访问限制<rule family="ipv4"><source address="10.120.179.80"/><port protocol="tcp"port="10022"/><accept/></rule># 全端口开放<rule family="ipv4"><source address="10.120.179.80"/><accept/></rule># 端口段配置<rule family="ipv4"><source address="10.120.179.80"/><port protocol="tcp"port="8881-8889"/><accept/></rule>#重启防火墙
systemctl restart firewalld
firewall-cmd --reload