admin管理员组

文章数量:1642331

创建的文件在/etc/firewalld/ipsets/目录下

列出所有的ipset types:firewall-cmd --get-ipset-types

列出当前所有的ipsets:firewall-cmd --get-ipsets

增加ipset:firewall-cmd --permanet --new-ipset=ipsetname --type=types

在ipset里加入入口:firewall-cmd --permanent --ipset=ipsetname --add-entry=ip,port

将ipset加入到区域:firewall-cmd --permanent --add-source=ipset:ipsetname

* ipset的一个优势是集合可以动态的修改,即使iptables的规则正在使用这个集合

-------------------------------------

加黑名单:firewall-cmd --ipset=blacklist --add-entry=ip

在默认区域中添加一个富规则,用于删除黑名单上的所有条目:
firewall-cmd --add-rich-rule='rule source ipset=blacklist drop'

要为 IPv6 创建 ipset 黑名单6,请执行以下操作:
firewall-cmd --permanent --new-ipset=blacklist6 --type=hash:ip --option=family=inet6

在默认区域中添加一个丰富的规则,用于删除黑名单上的所有条目6:
firewall-cmd --add-rich-rule='rule source ipset=blacklist6 drop'

本文标签: Firewallcmdipset