Assign eth0 to USB adapter with MAC

I'm running OpenWRT on Raspberry Pi. I have two USB to ethernet adapters, and I want one to be assigned to WAN, and another to be assigned to LAN. If I disconnect, and reconnect, WAN/LAN are assigned to the wrong physical adapters. I'm not wanting to spoof the MAC, I want eth1 to always be assigned to the adapter with the proper ethernet cable that's plugged into it.

eth0: a local vlan (the native RPI device)
eth1: should be WAN
eth2: should be LAN

@brianmichalk, welcome to the community!

  • The first interface eth0 is enumerated as LAN by default at 192.168.1.1
  • The second interface eth1 is enumerated as WAN by default as a DHCP client
  • The other interfaces can be setup by you - from scratch

You can reconfigure them; but since LAN and WAN are auto created, I would personally start from there. I'd use eth2 for connectivity to the "local VLAN."

Thank you, but if I disconnect and reconnect an ethernet adapter, it gets assigned to a different device.

WAN bound to eth1 (with MAC ending 9A)
LAN bound to eth2 (with MAC ending 65)

If I disconnect these two USB adapters, I now only have eth0 bound to the vlan.
Now, if I connect the adapter that has the ethernet cable plugged into my hub (ending MAC 65), this adapter gets assigned to eth1. It's not eth2 any more, and has been reassigned. The routes don't work anymore.

This would normally be solved with a udev rule.

Maybe with hotplug.
https://openwrt.org/docs/guide-user/base-system/hotplug

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