Vitaliy Makkoveev said on Mon, 21 Nov 2022 03:48:21 +0300

>> On 20 Nov 2022, at 18:06, Odd Martin Baanrud <[email protected]>
>> wrote:
>> 
>> Hello,
>> 
>> I have a Raspberry Pi 4 with 2 USB NIC’s attached.
>> One via USB3 (ure0), and the other via USB2 (ure1).
>> Since they are connected to different USB interfaces, I thaught they
>> would get configured the same way on reboot. But that’s not the case.
>> They became swapped on reboot.
>> Is there a way to “lock” the configuration I want?
>> So the USB3 NIC always become ure0, and the USB2 ure1.
>> 
>> Regards, Martin
>>   
>
>You could parse ifconfig(8) output to determine which names network
>interfaces received. But unfortunately, you can’t rename interfaces.

During your parsing you could assign each one to an environment
variable such that, for instance, $lan contains the network card name
of the LAN one, and $wan contains the network name of the one going to
the Internet. Unfortunately, this would probably mean changing a lot of
existing shellscripts, but it's doable.

SteveT

Steve Litt 
Autumn 2022 featured book: Thriving in Tough Times
http://www.troubleshooters.com/bookstore/thrive.htm

Reply via email to