3

Simply, is there any quick alternative of iptables -F command (that just "deletes everything") for nftables?

Such thing wouldn't have much theoretical purposes, but it's usually a lifesaver for administration of bad/gone-wrong setups.

Colt
  • 2,029
  • 6
  • 21
  • 27
exa
  • 571
  • 4
  • 14

2 Answers2

4

I believe you are looking for nft flush commmand. The syntax is:

$ nft flush table <name>

You can also flush chain:

$ nft flush chain <table> <name>

Alternatively you can always use nft delete rule command to delete any rules that you have just applied.

ek9
  • 2,093
  • 4
  • 19
  • 23
2

To flush the entire ruleset, including all tables and chains in one go.

$ nft flush ruleset
Esa Jokinen
  • 46,944
  • 3
  • 83
  • 129
Gunni
  • 21
  • 1
  • 3
    Welcome to Serverfault! We have two kind of citation methods. The one starting with `>` is for text quotes. By indenting the text with four spaces you can add a code block. I edited this for you. – Esa Jokinen Aug 13 '17 at 08:40