How to rename network cards and determine their order?

Hey guys!
I am installing FreePBX on a dedicated server that will have one onboard network card and two offboard cards.

The idea is to use the onboard card for LAN, and the two offboards will be used to receive SIP Trunking (from two different providers).

My idea of organization would be:

Onboard NIC: eth0
Offboard NIC 01: eth1
Offboard NIC 02: eth2

however, when installing SNG7/FreePBX 16, the OS automatically names the cards in this order:

Offboard NIC 02: eth0
Offboard NIC 01: eth2
Onboard NIC: eth1

I’ve already tried to make the change by changing the ifcfg-ethX files, using udev rules (persistent-rules) and I even managed to change the name/order of the cards using the following commands:

/sbin/ip link set eth1 down
/sbin/ip link set eth1 name nic0
/sbin/ip link set nic0 up
(and continuing like this for the other boards)

However, after restarting the server, the original order returns.
Is there any definitive way to change the names/ordering of NICs in SangomaOS?
Thanks for the support!

All you need to do is make sure that the ifcfg-ethx files have the right MAC addresses, and then rename the interfaces in /etc/udev/rules.d/70-persistent-net.rule file. After, run:

service network restart
1 Like

I added the HWADDR field in the ifcfg-ethx files, and added the rules in the /etc/udev/rules.d/70-persistent-net.rule file, executed the commands, but unfortunately the cards were still not renamed

check your work twice, then reboot

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.