Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Appending Firewall Rules

    Scheduled Pinned Locked Moved Firewalling
    5 Posts 3 Posters 1.1k Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N Offline
      needhelp404
      last edited by

      I have a sort of template of rules I would like to import to my firewall. The problem is, when importing them, the existing rules get overwritten. Is there a way I can append the rules without clearing out the existing ones, whether GUI or CLI?

      R mytsuuM 2 Replies Last reply Reply Quote 0
      • R Offline
        rcoleman-netgate Netgate @needhelp404
        last edited by

        @needhelp404 Not without manually adding them to the firewall by hand individually or modifying the config you're importing to have the other rules as well.

        Ryan
        Repeat, after me: MESH IS THE DEVIL! MESH IS THE DEVIL!
        Requesting firmware for your Netgate device? https://go.netgate.com
        Switching: Mikrotik, Netgear, Extreme
        Wireless: Aruba, Ubiquiti

        N 1 Reply Last reply Reply Quote 0
        • mytsuuM Offline
          mytsuu @needhelp404
          last edited by

          Hi @needhelp404 In case to avoid the "existing rules get overwritten". All you have to do is to "backup" the current configuration, edit the .xml file adding your "template rules" in the order so that you don't delete existing rules.

          STEP 1
          Diagnostics > Backup & Restore > Backup Configuration

          • Select the target rules
            Screen Shot 2022-04-26 at 15.10.47.png

          • Edit and Apply
            Diagnostics > Backup & Restore > Restore Backup

          • Restore area "Rules Edited"

          • Choose File "Edited Files"
            Screen Shot 2022-04-26 at 15.18.00.png

          Just it. Good luck!

          1 Reply Last reply Reply Quote 0
          • N Offline
            needhelp404 @rcoleman-netgate
            last edited by

            @rcoleman-netgate Bummer, I figured but thought I'd see what the pros had to say. I appreciate your response.

            R 1 Reply Last reply Reply Quote 0
            • R Offline
              rcoleman-netgate Netgate @needhelp404
              last edited by

              @needhelp404 One of the issues you have with appending is that rules are read in a top-to-bottom order and where would appended rules go? It's a PITB, yeah, but the best solution is manually changing the file and reimporting.

              Ryan
              Repeat, after me: MESH IS THE DEVIL! MESH IS THE DEVIL!
              Requesting firmware for your Netgate device? https://go.netgate.com
              Switching: Mikrotik, Netgear, Extreme
              Wireless: Aruba, Ubiquiti

              1 Reply Last reply Reply Quote 0
              • First post
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.