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

    Changing Network Interface Names

    Scheduled Pinned Locked Moved General pfSense Questions
    11 Posts 4 Posters 1.8k Views
    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
      scott.ackerman
      last edited by

      I know this one has 'kind of' been asked before. I have to deploy about 60 instances of pfSense in HA configuration. I have deployed 3 instances already by copying the XML files from a working instance and then making changes, etc.. Not the best method to avoid mistakes and there are things we end up having to add or subtract from that. I want to build a 'lab' in VirtualBox that I can use as a master. The problem is that the interface names in Virtual Box are em0, em1, etc. and the interface names that we are deploying to are igb0 and ix0. Is there a way for me to change the interface name in Virtual Box to reflect this so I don't end up with a mess when I try to import an xml file to VBox from one our 7100 pairs and then back again? I can do it from the command line by using 'ifconfig em0 name igb0' but that doesn't survive a reboot.

      1 Reply Last reply Reply Quote 0
      • V
        viragomann
        last edited by

        Edit the config file and change the interface names to match the interfaces on the destination machine before importing it.

        1 Reply Last reply Reply Quote 0
        • S
          scott.ackerman
          last edited by

          Thanks, I understand that I have that option but that isn't what I asked. I would prefer to not introduce more variables into the process than necessary. It seems like changing the interface names on the VBox setup once would be preferable to changing the XML files 60+ times.

          1 Reply Last reply Reply Quote 0
          • V
            viragomann
            last edited by

            So you will have to go to VirtualBox and ask there for an igb and ix compatible virtual network interface.

            1 Reply Last reply Reply Quote 0
            • S
              scott.ackerman
              last edited by

              So if I understand correctly even though I can change the interface name on the command line in FreeBSD temporarily, there is absolutely no way to make that survive a reboot.

              1 Reply Last reply Reply Quote 0
              • V
                viragomann
                last edited by

                pfSense or FreeBSD uses the drivers name + a sequential number for handling the interfaces internally, even if you add a friendly name like DMZ to it.
                So since VirtualBox doesn't provide virtual NICs for the igb and ix driver, it will fall back to its real name like em, vnet or what ever you assigned in VB.

                1 Reply Last reply Reply Quote 0
                • S
                  scott.ackerman
                  last edited by scott.ackerman

                  Thank you, I do understand that. What I don't understand is that I can go to the command line and issue the following 'ifconfig em2 name ibg0' and it changes that name in FreeBSD and FreePBX immediately recognizes that change. So I could start the VM in VBox and not start pfSense, issue the command above, then start pfSense and my problem would be solved. But there isn't any way to automate that on boot? If I was just running FreeBSD I could absolutely do this by editing the /etc/rc.conf file, but my understanding is that pfSense essentially ignores that file. So I am simply asking how do I do something that the underlying OS absolutely supports in light of how pfSense runs on top of the OS.

                  1 Reply Last reply Reply Quote 0
                  • V
                    viragomann
                    last edited by viragomann

                    You may try to put the commands for changing the NIC names into the /boot/loader.conf.local. This file survives a reboot. If it isn't already present you may create one.
                    Maybe that works, I haven't done that ever.

                    1 Reply Last reply Reply Quote 0
                    • S
                      scott.ackerman
                      last edited by

                      Thank you sir :-)

                      K 1 Reply Last reply Reply Quote 0
                      • K
                        kevin-scott-uk @scott.ackerman
                        last edited by

                        @scott-ackerman Did you ever get this to work? I am in the same situation and can't get the interface names to survive a reboot. I've tried the :

                        ifconfig em0 name igb0
                        

                        command in the /boot/loader.conf.local but I still can't get the name to stick. What syntax did you use in the file?

                        S 1 Reply Last reply Reply Quote 0
                        • S
                          sackerman @kevin-scott-uk
                          last edited by

                          @kevin-scott-uk
                          Sorry, never really did. I ended up making a python script that parsed the XML and changed the IF name to be compatible with the IF on the underlying OS.

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