Physical interface assignment changes randomly

All,

I have an Openwrt snapshot running on a raspberry pi 4B with two usb-to-ethernet adapters attached to the two usb 3 ports of the pi. Physical interface eth0 (the integrated pi 4 ethernet device) is assigned to my LAN. With the 2 additional usb-to-ethernet adapters, I get eth1 and eth2 which I have respectively assigned to my broadband provider and a failover 4G LTE modem. Failover has been configured over mwan3.

Usually the set up works fine with mwan3 properly honouring assigned metrics and weights allocated to member interfaces. However, sometimes when I reboot the router, eth1 and eth2 get interchanged. It is clear that sometimes the MAC address for my broadband connection gets assigned to eth2 instead of eth1 after a reboot. This obviously upsets my mwan3 configuration hopelessly.

Is there anyway to ensure my usb-to-ethernet adapters always correctly get mapped to the desired physical interfaces (eth1 and eth2)?

Regards

Dipak Jha

Set the MAC addresses explicitly in /etc/config/network.

2 Likes

Many thanks @iplaywithtoys . The following kind of configuration in /etc/config/network seems to do the mapping properly:

config device 'lte_dev'
	option name 'eth1'
	option macaddr '4A:E1:71:22:49:7E''

config interface 'lte'
	option ifname 'eth1'
	option macaddr '4A:E1:71:22:49:7E'
	option proto 'dhcp'

I an not sure if macaddr is required at two places but have left them since there were no errors. I now have a consistent mapping of physical devices to logical interfaces

1 Like

You're welcome!

MAC address = device
Interface = logical mapping between operating system and device.

1 Like

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