centos7 firewall指定IP访问端口
指定IP与端口
firewall-cmd --permanent --add-rich-rule="rule family="ipv4" source address="192.168.0.1" port protocol="tcp" port="22" accept"
重新载入,使配置生效
systemctl restart firewalld.service
查看配置结果
firewall-cmd --list-all
删除规则
firewall-cmd --permanent --remove-rich-rule="rule family="ipv4" source address="192.168.0.1" port protocol="tcp" port="22" accept"
重新载入,使配置生效