USB Ethernet adapter - Booting sequence - Interface persistence

Gents,

Below I show my current setup from my OpenWrt Firewall running in a PC.

Kernel Version:6.6.86

Model:Hewlett-Packard HP t620 Dual Core TC

Architecture:AMD GX-217GA SOC with Radeon(tm) HD Graphics

Firmware Version:OpenWrt 24.10.1 r28597-0425664679

1ea. onboard gigabit ethernet adapter working as WAN (eth0)

1ea. USB gigabit ethernet adapter working as LAN(eth1)

It is working flawless up to the moment.

Issue is, I decided to move a step ahead and implement VLAN’s, but I wanted to use a separate ethernet to implement and test the new enviroment prior to migrate the whole network to the new interface. To be able to do so, I attached another USB 2.5 gigabit ethernet adapter, and configuring everything properly, the new interface works well, but once I reboot the OpenWrt machine, the sequence of the adapters change, and everything stops working.

Tried to isntall Luci Persistent Interface (got to download the ipk and install manually since it is not shown in opkg or in lucy software), configured accordingly and no luck as well.

Have some of you Guys faced this issue before? If so, did you get success addressing it? How was it, please?

openwrt doesn't lock on MAC, NIC assignments/naming can change.
pulling the USB NICs could trigger this too.

24.10.1 already comes with Luci, there's nothing to install.
it's also EOL, you should install 25.12.1.

Thanks for inputs, frollic. By Luci-Persistent-Interface I meant the app below.

You are then stating there is no solution to what I intend to do, is it you mean?

You cannot just state that I should upgrade to the latest. I do have an stable setup and I am seeking to improve it.

I’m not sure about Openwrt it may use the kernel parameter net.ifnames=0 or have the way interfaces are named like ordinary Linux distros patched out.

Since you have an x86 machine you are running Openwrt on, you should be able to edit /boot/grub/grub.cfg and look for the line that boots the kernel and try adding net.ifnames=1 to it

If it works though, your interface names will change and so you will need local access to be able to reconfigure network access.

Actually yes sorry this won’t work.

1 Like

where did the screen shot come from, I can't see any related package in https://downloads.openwrt.org/snapshots/packages/x86_64/luci/.

EDIT: I guess it's from https://github.com/turusudiro/luci-app-persistent-interface ?
it's not an official package, but it might still work, trial and error.

there's also Ethernet port order and status on X86.

I ran in to this problem myself some time ago (also on an HP thin client funnily enough). I don’t have the exact script I used to solve it anymore, but I used openwrt’s hotplug scripts to fix it.

These are simple scripts that get run everytime a certain hardware event occurs (like a new network interface shows up). They get passed some parameters like what interface it was, etc.

This allows you to change the interface name whenever it shows up based on the mac address.

For inspiration, see the wiki page on hotplug, it actually describes exactly this problem.
Note I have not tested this with recent versions of openwrt, so I can't say if it is up to date.

1 Like

Basically, you set the mac address of the interface in its configuration in uci and look it up in the hotplug script, changing the name to the correct one if the new network interface matches one of the known mac adresses.

1 Like

There’s potentially a hack you can use to edit /etc/rc.local
eg…

rmmod r8169

rmmod r8152



modprobe r8169

sleep 5

modprobe r8152


It’s a hack but it might be a way to make sure which interface name gets used for each device. I made a guess with r8169 since you didn’t mention the exact type of ethernet adapter you have.