Changing Network Interface Names

  • 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.

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

  • 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.

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

  • 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.

  • 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.

  • 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.

  • 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.

  • Thank you sir :-)

Log in to reply