1.获取动态ip地址
ip a | grep dynamic | awk '{print $2}' | cut -f1 -d '/'
2.指定ip段访问端口
firewall-cmd --permanent --add-rich-rule 'rule family=ipv4 source address=192.168.0.1/2 port port=80 protocol=tcp accept'
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.2.0/24" port protocol="tcp" port="5432" accept"