我在Debian Jessie上使用了ipset 6.23-2。 我创build了一个hash:net set和一个iptables规则来删除集合中地址的所有stream量。
Chain INPUT (policy ACCEPT) target prot opt source destination DROP all -- anywhere anywhere match-set Example-Set src
我习惯于'不匹配'选项来添加我的内部服务器的networking。 我认为它会像一个排除工作,所以它基本上是傻瓜式的,我不会意外地把自己锁在我的服务器(或我的一个同事)之外。
Name: Example-Set Type: hash:net Revision: 6 Header: family inet hashsize 1024 maxelem 65536 comment Size in memory: 3424 References: 1 Members: 10.50.7.0/24 nomatch comment "# 2017-09-14"
但是,当我在子网内添加一个特定的IP(例如10.50.7.30)并且丢弃了该IP的所有stream量时,它仍然匹配。
Name: Example-Set Type: hash:net Revision: 7 Header: family inet hashsize 1024 maxelem 65536 comment Size in memory: 3424 References: 1 Members: 10.50.7.0/24 nomatch comment "# 2017-09-14" 10.50.7.21 comment "# 2017-09-14"
我认为我错了“不匹配”的方式?
它只能用于从较大的子网中排除较小的子网吗?
有没有解决这个问题,而不创build额外的集?