Let's say I want to apply a rule to ip daddr {,, }, but I want to exclude two more specific IPv4 addresses from that. How do I do that?

I was hoping for some more elegant way of doing this:

ip daddr {,, } \
  ip daddr != \
  ip daddr !=

as explained in the nft manpage for negation of addresses or ranges, but it does not show a way to do that with sets.


It appears that negations of sets are working as expected (undocumented):

ip daddr {,, } \
  ip daddr != {, }

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.