[Bug 1696] "nft -s list ruleset" should include "flush ruleset" as first line

bugzilla-daemon at netfilter.org bugzilla-daemon at netfilter.org
Wed Aug 2 00:58:46 CEST 2023


https://bugzilla.netfilter.org/show_bug.cgi?id=1696

--- Comment #8 from Apachez <apachez at gmail.com> ---
> We could ship an nft-save shell script:
> 
> | #!/bin/sh
> | 
> | echo "flush ruleset"
> | exec nft "$@" list ruleset
> 
> What would a "restore option" do from your perspective?

To me a "restore option" would do the same as -f but with the addition that it
would append "flush ruleset" if that doesnt already exists as the first line in
the file thats being read as input (I guess it could do this blindly because it
wouldnt matter if the file already had one "flush ruleset" so the result is two
"flush ruleset" after each other?).

This way it doesnt matter if the file you restore from have that "flush
ruleset" as first line or not.

That is restore from these two outputs would work equally well:

# nft -s list ruleset > /path/backup1.nft

# nft save ruleset /path/backup2.nft

# nft restore /path/backup1.nft

# nft restore /path/backup2.nft

-- 
You are receiving this mail because:
You are watching all bug changes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.netfilter.org/pipermail/netfilter-buglog/attachments/20230801/8042cd80/attachment.html>


More information about the netfilter-buglog mailing list