Re: nftables expressions and operators

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Nov 06, 2023 at 08:11:09AM -0500, Aurel Wisse wrote:
> Hi,
> 
> I am starting to learn nftables (only superficial previous experience with iptables) and I can't find certain syntax rules for expressions and operators in the wiki or the man page.
> 
> I am learning by listing the rulesets of certain predefined firewalls (fw4/OpenWRT, UFW) and I notice that certain listed rules contain operators which I can guess (hopefully correctly) from context and the original syntax in the imported file, but I would like to be sure in order not to make mistakes while building my own firewall.
> 
> Examples:
> 
> tcp flags & (fin|syn|rst|ack) != syn jump syn_flood
> 
> becomes
> 
> tcp flags syn / fin,syn,rst,ack jump syn_flood 

That is a bug in nftables v1.0.2, here with recent version it shows:

tcp flags != syn / fin,syn,rst,ack

> So, from context, commas without spaces around them are equivalent to logical or with precedence over "/", and "/" is somehow "!=" ?? . Where did the & (logical AND?) operator go?
> 
> This is just one example. I would like to learn the full operator syntax rules in nftables. Any ideas where I should look ? Do I have to dig into the source code ?
> 
> Thanks
> 
> Aurel
> 
> nftables v1.0.2 (Lester Gooch)
> Pop-OS (6.5.6-76060506-generic)



[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux