I am trying to apply below nftables rule which I adopted from this guide:

nft add rule filter INPUT tcp flags != syn counter drop

somehow this is ending up with:

Error: Could not process rule: No such file or directory

Can anyone spot what exactly I might be missing in this rule?


You're probably missing your table or chain.

nft list ruleset

will give you what you are working with. If it prints out nothing, you're missing both.

nft add table ip filter # create table
nft add chain ip filter INPUT { type filter hook input priority 0 \; } # create chain

Then you should be able to add your rule to the chain.

NOTE: If you're logged in with ssh, your connection will be suspended.

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.