4 Port NIC wrong interface order

I’ve installed a 4 port NIC with Realtek 8125 chip.
Following the ethernet name sequence in Vyos :

eth0         -                98:b7:85:bb:c1:40   
eth1         -                98:b7:85:bb:c1:41   
eth2         -                98:b7:85:bb:c1:42   
eth3         -                98:b7:85:bb:c1:43   

Physically the ethernet card layout is Eth3 Eth0 Eth1 Eth2

Why ? Is it possible to have the right ethernet port layout Eth0 Eth1 Eth2 Eth3 ??

thanks

Sure is.

Please look at the “hw-id” command:

set interfaces ethernet ethX hw-id '<mac>'

the Mac address is correctly associated to the right eth number as you can see above.
it is a strange thing that Mac address is not physically in the right sort.

Right, but assign the MACs to the ports in the order you want them.

Just note that you may have to reboot VyOS for the interfaces to operate correctly in the new order. At least that’s been my experience.

1 Like

Also easiest is to manually edit the /config/boot.config and reboot the box and tada! :slight_smile:

1 Like

ok, but why the Nic card port layout hasn’t the right sequence ? ( eth0 eth1 eth2 eth3 ) ?

Look at the MAC addresses. How is VyOS supposed to know that your hardware manufacturer physically placed the NICs in a different order than the hardware addresses?

4 Likes

Because your hardware vendor is insane. Probably it’s one of those cheap Chinese x64 boxes? I’ve got one myself and it’s got exactly this stupid port layout issue.

It’s hardly Linux’s fault that they don’t wire things up properly in the hardware.

1 Like

not box but Chinese Nic card on a fijitsu pc

I met this issue before. How to fix it ? – Delete all the interface settings in vyos and save configuration, then reboot vyos. run set interface xxx again.

it’s not a configuration matter.

Yes, it’s not configuration, it’s a hardware issue.

MAC address probably isn’t the order the OS detects NICs , most likely uses something like bus/port