Dynamically appending addresses to a named set

Lars Noodén <[email protected]>
Newsgroups gmane.comp.security.firewalls.netfilter.general
Message-ID <[email protected]>
Hello,

In NFTables, I have created a named set called 'bar' in the chain input
in the table foo.  I can add elements to the set manually,

# nft add element ip foo bar { 192.168.2.2 }

However, I am not able to guess the syntax to have a regular NFTables
rule do the appending automatically.  I've tried a lot of permutations
of the following, but always with fatal errors,

# nft add rule foo input tcp dport 22 counter add @bar { ip saddr }
Error: Could not process rule: Operation not supported
add rule foo input tcp dport 22 counter add @bar { ip saddr }

# nft add rule foo input tcp dport 22 add element @bar { ip saddr }
Error: syntax error, unexpected element, expecting @ or '$'
add rule foo input tcp dport 22 add element @bar { ip saddr }

What would be the correct syntax to have a rule which automatically adds
a source IP address to the named set when certain conditions are met?

/Lars
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.