放行端口
firewall-cmd --permanent --zone=public --add-port=6379/tcp
删除端口
firewall-cmd --permanent --zone=public --remove-port=6379/tcp
放行网段
firewall-cmd --permanent --zone=public --add-rich-rule='rule family="ipv4" source address="172.10.10.0/24" accept'
删除网段
firewall-cmd --permanent --zone=public --remove-rich-rule='rule family="ipv4" source address="172.10.10.0/24" accept'
添加网段和指定端口
firewall-cmd --permanent --zone=public --add-rich-rule='rule family="ipv4" source address="172.10.10.0/24" port protocol="tcp" port=8080 accept'
删除网段和指定端口
firewall-cmd --permanent --zone=public --add-rich-rule='rule family="ipv4" source address="172.10.10.0/24" port protocol="tcp" port=8080 accept'