<html>
    <head>
      <base href="https://bugzilla.netfilter.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - "nft -s list ruleset" should include "flush ruleset" as first line"
   href="https://bugzilla.netfilter.org/show_bug.cgi?id=1696">1696</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>"nft -s list ruleset" should include "flush ruleset" as first line
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>nftables
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>1.0.x
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86_64
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P5
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>nft
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>pablo@netfilter.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>apachez@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Doing a backup using:

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

will often fail to restore because a first line of "flush ruleset" is missing.

Request that when doing "nft -s" that should include "flush ruleset" as the
first line of its output.

If that is not possible due to legacy or other reasons then perhaps a new
switch could be added that will include "flush ruleset" as its first line?

Such as:

# -b, --backup   Create backup of current ruleset.

Example of suggested full syntax:

# nft -b /path/backup.nft

Which then can be restored with (for example):

# nft -o -f /path/backup.nft

The above would then not bring the errors one otherwise would get if you try to
restore a nft-file created by "-s list ruleset".</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are watching all bug changes.</li>
      </ul>
    </body>
</html>