[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Sometimes different network interface name?



On Fri 02 Sep 2022 at 13:44:24 (+0300), Anssi Saari wrote:
> 
> I have an LTE module in my Debian router for failover in case my fiber
> goes down. It has this occasional issue that mostly its interface is
> wwan0 but sometimes it's wwx0a697e2d934f.
> 
> When that happens I have something like this in my syslog:
> 
>   Sep  1 08:34:40 animus kernel: [    8.150781] qmi_wwan 2-1.3:1.5 wwx0a697e2d934f: renamed from wwan0
> 
> So did the kernel really go and rename my interface? Why does this
> happen only occasionally? Some race condition? And how can I put a stop
> to it? Should I use a .link file to make sure? I guess I could put
> something like this in a link file:
> 
>     [Match]
>     Path=pci-0000:00:13.0-usb-0:1.3:1.5
> 
>     [Link]
>     Name=wwan0
> 
> The Path parameter is from udevadm output. I think that path should be
> stable if I don't feel the need to move the LTE module to a different
> miniPCI slot and that's fairly unlikely.
> 
> I can query the interface name from the device and pass it around but
> that seems like the wrong thing to do and there are three things that
> need to know the interface.

If you look at how the package iwd keeps the kernel's choice of name,
you'll see it installs:

  $ cat /lib/systemd/network/80-iwd.link 
  [Match]
  Type=wlan

  [Link]
  NamePolicy=keep kernel
  $ 

so I would type:

  $ networkctl list
  IDX LINK  TYPE     OPERATIONAL SETUP
    1 lo    loopback carrier     unmanaged
    3 wlan0 wlan     routable    unmanaged

  2 links listed.
  $ 

to get the Type, and then create /etc/systemd/network/80-lte.link
with contents similar to the above, but the appropriate Type.
(Or, of course, you could name it with a name of your choosing.)

Cheers,
David.


Reply to: