使用nftables的ARP请求的速率限制

时间:2016-10-24 14:07:10

标签: arp

我目前正在尝试使用nftables限制ARP流量。我正在使用以下规则:

table arp filter {
        chain input {
                limit rate 15/second accept # handle 3
        }

        chain output {
        }
}

但是,这些没有效果。我做错了什么?我也尝试丢弃所有与第一条规则不匹配的数据包。

table arp filter {
        chain input {
                limit rate 10/second accept # handle 3
                drop # handle 4
        }

        chain output {
        }
}

编辑:我已将以下行添加到链中:

type filter hook input priority 0; policy accept;

这让我有以下配置:

table arp filter {
        chain input {
                type filter hook input priority 0; policy accept;
                limit rate 10/second accept # handle 3
                drop # handle 4
        }

        chain output {
                type filter hook output priority 0; policy accept;
        }
}

这很好,但为什么呢?

1 个答案:

答案 0 :(得分:0)

我认为这是因为在nftables链中没有自动与表关联,所以我们必须明确定义一个钩来激活一个链。请注意,每个地址系列都有一组不同的挂钩:https://www.mankier.com/8/nft#Address_Families