Renaming interfaces on HA failover machine after reboot

Started by sylvyrfysh, October 12, 2021, 04:54:50 AM

Previous topic - Next topic
Hey all,

I am trying to get HA working with two boxes that are different. One is a high performance router that is the primary, and the second is a VM on an internal server. I have been able to get HA working with proper rule replication if i run the command
ifconfig vtnet1 name igb0
ifconfig vtnet0 name igb1

As this switches the VM's interfaces to have the same interface names as the primary box. I tried following the guide here https://forums.freebsd.org/threads/freebsd-network-interface-names.2540/, but the names are not picked up on startup. I then tried moving that file to /usr/local/etc, as that is where opnSense seems to want to pick up its rc files, but that also did not work.

Any ideas or solutions for this would be greatly appreciated.

Thanks in advance!
Nick

Figured I'd update with how I got it done:

Started with this linkhttps://www.steinkogler.org/2021/08/05/renaming-pfsense-interfaces/, which shows how to do it on pfSense.  However, this did not work on opnSense. It did lead to this link https://docs.opnsense.org/development/backend/autorun.html, which tells us to put a file in the early folder. In that file, I put this.

#!/bin/sh

ifconfig <oldwanname> name <newwanname>
ifconfig <oldlanname> name <newlanname>

You'll then want to modify the file `/conf/config.conf` and update the interface names in there to the new ones, and then perform a reboot.

Thanks!
Nick