I have a number of rules in table mytable
chain mychain
:
> sudo nft -a list table mytable
table ip mytable { # handle 8
chain mychain { # handle 1
type filter hook input priority filter; policy accept;
tcp dport 5550 accept # handle 18
tcp dport 5551 accept # handle 19
tcp dport 5552 accept # handle 20
tcp dport 5553 accept # handle 21
tcp dport 5554 accept # handle 22
}
}
According to nftables wiki it should be possible to remove all rules from the specified chain. However the following command returns error:
> sudo nft delete rule mytable mychain
Error: syntax error, unexpected newline, expecting handle
delete rule mytable mychain
^
What is the proper command to remove all rules from mychain
without iterating over rule handles?