使用firewall-cmd命令删除指定的富规则: 一旦你确定了要删除的富规则,可以使用 firewall-cmd 的--remove-rich-rule 选项来删除它。例如,如果要删除上面列出的第一个规则,可以执行: bash firewall-cmd --permanent --remove-rich-rule='rule family="ipv4" source address="192.168.1.100" accept' 注意:--per...
firewall-cmd --permanent --remove-rich-rule 'rule family="ipv4" source address="0.0.0.0/0" forward-port port="8077" protocol="tcp" to-port="80" to-addr="192.168.4.245"' 下面是示例操作: #显示规则列表[root@new-center~]# firewall-cmd--list-rich-rules rule family="ipv4"source address...
firewall-cmd --add-rich-rule="RULE" #删除富规则 firewall-cmd --remove-rich-rule="RULE" #查看富规则 firewall-cmd --query-rich-rule="RULE" #列出所有的富规则 firewall-cmd --list-rich-rule="RULE" 富规则模板 rule [ family= "IP协议"] [ source | destination ] address="IP地址 | MASK...
5、针对特定IP地址开放端口(删除规则--remove-rich-rule) 6、开放端口(删除端口--remove-port) 7、禁止IP访问 8、禁止IP地址段 注意: Centos7防火墙可以通过命令行模式的firewall-cmd和图形界面的firewall-config进行规则配置。本文主要列举了firewall-cmd的常用规则的命令行例子,供参考。 firewall-config Gnome启动...
1.列出规则:通过使用“firewall-cmd list-rich-rules”命令,我们可以列出所有当前生效的Rich Rules。 2.修改规则:通过使用“firewall-cmd permanent add-rich-rule”命令,我们可以修改先前创建的规则。我们只需指定新的参数即可。 3.删除规则:使用“firewall-cmd permanent remove-rich-rule”命令,我们可以删除指定的...
禁止ip登录特定的端口 drop:外网 firewall-cmd --zone=public--add-rich-rule="rule family='ipv4' source address='10.0.0.1/24' port port=80 protocol=tcp drop"--permanent 取消drop ip firewall-cmd --zone=public--remove-rich-rule="rule family='ipv4' source address='10.0.0.1/24' port port=...
firewall-cmd --permanent --remove-rich-rule="rule family="ipv4" source address="192.168.142.166" port protocol="tcp" port="11300" accept" systemctl restart firewalld.service 5.规则查询端口是否打开 firewall-cmd --query-port=80/tcp
firewall-cmd --permanent --zone=public -remove-rich-rule='rule family="ipv4" source address="IP" accept' 9、重载firewalld firewall-cmd -reload 10、禁用ssh端口 firewall-cmd --permanent --remove-service=ssh --permanent永久生效,重启后规则不消失 不执行firewall-cmd --reload命令配置不生效 syst...
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='rulefamily="ipv4"source address="172.10.10.0/24"port protocol="tcp"port=8080accept' ...
firewall-cmd --zone=public --add-port=1521/tcp --permanent # 开放1521端口给信任ip firewall-cmd --permanent --remove-rich-rule="rule family="ipv4"source address="ip"port protocol="tcp"port="1521"accept" # 配置生效 firewall --reload ...