指定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"

重新载入,使配置生效

标签: centos7, firewall, 指定IP, 端口访问

添加新评论