Skip to contentSkip to conversation

Matching daddr and saddr in single rule?

DISCUSSION Tomas Mudrunka 2 participants 2 messages Nov 3, 2017

lore
Share & tools
lore
#0 lore raw

Hello,
i'd like to drop all traffic that is related to address. is there way to merge these two rules:

nft add rule ip filter output ip daddr 1.2.3.4 counter drop nft add rule ip filter output ip saddr 1.2.3.4 counter drop

to single rule like this:

nft add rule ip filter output ip addr 1.2.3.4 counter drop

i think this would be quite useful to simplify my rule set. especialy when handling vast amount of addresses.

Thanks.

Signature · 3 lines
S pozdravem
Best regards
     Tomáš Mudruňka - SPOJE.NET s.r.o.
#1 lore raw
Quoted 7 lines · Tomas Mudrunka

Hello,
i'd like to drop all traffic that is related to address. is there way to merge these two rules:

nft add rule ip filter output ip daddr 1.2.3.4 counter drop nft add rule ip filter output ip saddr 1.2.3.4 counter drop

Quoted 7 lines

to single rule like this:

nft add rule ip filter output ip addr 1.2.3.4 counter drop

i think this would be quite useful to simplify my rule set. especialy when handling vast amount of addresses.

The amount of addresses should be no problem since you can use native sets:

add rule ip filter output ip saddr @badips counter drop add rule ip filter output ip daddr @badips counter drop