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

    Config restore on new hardware - maintaining 'interfaces'

    Scheduled Pinned Locked Moved General pfSense Questions
    8 Posts 4 Posters 1.5k Views 4 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.
    • S Offline
      saqibs
      last edited by

      Hi all,

      I'm throwing out a few ideas here to see if anyone has any suggestions, or options to help.

      Issue: Moving config from one machine to another, losing interfaces (and firewall rules)
      I have a few interfaces, (vlans mainly) along with LAN, WAN, and associated firewall rules. I move my config from my bare metal machine onto a virtual machine and I recall the vlan interfaces were still there after the restore, and I was able to assign then interfaces to different 'hardware' in the assignments section.
      Recently when moving my config to another vm (similar physical interfaces) I loose all the vlans interfaces (GUEST / LAB / DEV etc), I still have the VLAN but nothing in the assignments sections so I need to recreate the interface and associated firewall rules.

      Questions:
      Editing XML config
      I hear I can manually edit the config xml file and can probably save the interfaces or re-create them on the new machine, but I am wondering if anyone has any experience with this and if there any other easier ways to do this?

      Pfsense feature req?
      Can we have pfsense 'keep' any interfaces & firewall rules that are associated with them, and just have them unassigned, and choose to assign them in the assignments section? I believe I had a version of this when moving my config from my hardware machine to my vm.

      I am currently on CE 2.8.1.

      JKnottJ S 2 Replies Last reply Reply Quote 0
      • JKnottJ Offline
        JKnott @saqibs
        last edited by

        @saqibs said in Config restore on new hardware - maintaining 'interfaces':

        Editing XML config
        I hear I can manually edit the config xml file and can probably save the interfaces or re-create them on the new machine, but I am wondering if anyone has any experience with this and if there any other easier ways to do this?

        A few years ago, I moved pfSense to a new mini PC. I copied over the config file and then, in a shell, configured the interfaces. That was all I had to do. I did not edit the file manually.

        PfSense running on Qotom mini PC
        i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel 1 Gb Ethernet ports.
        UniFi AC-Lite access point

        I haven't lost my mind. It's around here...somewhere...

        S 1 Reply Last reply Reply Quote 0
        • S Offline
          saqibs @JKnott
          last edited by

          @JKnott
          Can you elaborate on what you did, or can you point me to any online references to do so.

          JKnottJ 1 Reply Last reply Reply Quote 0
          • S Offline
            SteveITS Galactic Empire @saqibs
            last edited by

            @saqibs if you edit the config file be careful a search and replace does not replace text in certificates etc. done correctly you can just restore.

            Only install packages for your version, or risk breaking it. Select your branch in System/Update/Update Settings.
            When upgrading, allow 10-15 minutes to reboot, or more depending on packages, CPU, and/or disk speed.
            Upvote 👍 helpful posts!

            S 1 Reply Last reply Reply Quote 0
            • S Offline
              saqibs @SteveITS
              last edited by

              @SteveITS

              I was thinking of feeding the xml into powershell and use that to analyse and modify the config. To your point I will be careful as to which sections the find and replace edits.

              1 Reply Last reply Reply Quote 0
              • stephenw10S Offline
                stephenw10 Netgate Administrator
                last edited by

                Unless you have a very large number of vlans you probably just edit the xml file by hand.

                If you have a number of sub-interface types, like VLANs, that's often the easiest way.

                It should be possible to resave the VLANs in the gui to the new parent NICs and then reassign the interfaces to those in the gui before rebooting. However it's easy to get the ordering wrong there and end up in the CLI with invalid interfaces.

                S 1 Reply Last reply Reply Quote 0
                • S Offline
                  saqibs @stephenw10
                  last edited by

                  @stephenw10
                  thanks for your response, that's really helpful.

                  1 Reply Last reply Reply Quote 0
                  • JKnottJ Offline
                    JKnott @saqibs
                    last edited by

                    @saqibs

                    Boot the computer running pfSense and use the keyboard & monitor as the console. Go into the menu and select 1 to assign interfaces and then, if needed, 2 to assign IP addresses.

                    PfSense running on Qotom mini PC
                    i5 CPU, 4 GB memory, 32 GB SSD & 4 Intel 1 Gb Ethernet ports.
                    UniFi AC-Lite access point

                    I haven't lost my mind. It's around here...somewhere...

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