Firewalld 错误: INVALID_RULE: attribute 'ipset' outside of any element
这个错误是由于在rich rule中使用了无效的语法。正确的语法应该是在rule元素中指定ipset属性。
要解决这个错误,您需要修改命令如下:
firewall-cmd --permanent --add-rich-rule='rule family="ipv4" source ipset="destDenyIP" drop'
在这个命令中,我们将ipset属性移到了rule元素中的source属性中。
firewalld中一些类似source的元素包括:
- source:指定源IP地址或IP地址范围。
- destination:指定目标IP地址或IP地址范围。
- port:指定端口或端口范围。
- service:指定服务名称,如http、ssh等。
- icmp-block:指定要阻止的ICMP类型。
这些元素可以在firewall-cmd命令中使用,以根据您的需求设置防火墙规则。
原文地址: https://www.cveoy.top/t/topic/bsDb 著作权归作者所有。请勿转载和采集!