You are not logged in.

#1 2021-01-13 09:33:34

Kotrfa
Member
Registered: 2012-10-25
Posts: 204

how to make network devices naming predictable again after iwd install

Hi,

I have two wifi devices: builtin intel wifi card and then USB TPLINK dongle. I started to use IWD and due to https://wiki.archlinux.org/index.php/Iw … ed_by_udev the devices are no longer getting predictable names and end up just with wlan0 or wlan1. I would be fine with that, but the problem is that the names are sometimes switched and that makes scripts using these names broken... I tried to use udevadm rules:

$ cat /etc/udev/rules.d/20-network-interface-builtin-wifi-name.rules /etc/udev/rules.d/2-network-interface-dongle-name.rules
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="f4:8c:50:84:c7:e0", NAME="cwbuiltinintel"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="d0:37:45:7b:9a:f7", NAME="cwusbtplink"

and even tried masking the iwd file:

# ln -s /dev/null /etc/systemd/network/80-iwd.link

but none of that worked - sometimes, only one of the devices is renamed (or none of them) etc. Is there a way how to achieve this? Thanks

Offline

#2 2021-01-15 10:46:54

justm3
Member
Registered: 2019-11-12
Posts: 29

Re: how to make network devices naming predictable again after iwd install

You may want to try creating /etc/systemd/system/iwd.service.d/override.conf with the following:
[Unit]
Before=network.target
Wants=network.target

[Service]
ExecStart=
ExecStart=/usr/lib/iwd/iwd --nointerfaces "wlp*"

Cheers.

Offline

#3 2021-01-22 08:19:44

Kotrfa
Member
Registered: 2012-10-25
Posts: 204

Re: how to make network devices naming predictable again after iwd install

Thanks. Can you tell me what it does please?

Offline

#4 2021-01-23 15:50:49

Kotrfa
Member
Registered: 2012-10-25
Posts: 204

Re: how to make network devices naming predictable again after iwd install

It didn't work at all. Devices are again renamed randomly (sometimes none of the two, sometimes both, sometimes just one of them).

Offline

#5 2021-01-23 16:02:20

Scimmia
Bug Wrangler
Registered: 2012-09-01
Posts: 8,339

Re: how to make network devices naming predictable again after iwd install

Uninstall IWD.

Offline

#6 2021-01-23 16:16:56

Head_on_a_Stick
Member
From: London
Registered: 2014-02-20
Posts: 5,733
Website

Re: how to make network devices naming predictable again after iwd install

If you want to keep iwd then use a .link file to rename the interfaces according to the MAC address of the NIC.

Something like

[Match]
MACAddress=$address

[Link]
Name=$name

Replace $address with the actual MAC address of the device and replace $name with the desired interface name (but don't use "wlan{0,1}" or "wlp{whatever}" because that may cause a race condition with unpredictable results).

See systemd.link(5) for more on this.

Offline

#7 2021-01-23 16:59:54

progandy
Member
Registered: 2012-05-17
Posts: 4,140

Re: how to make network devices naming predictable again after iwd install

You could possibly try to use the alternative names like this:

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

[Link]
NamePolicy=keep kernel
AlternativeNamesPolicy=database onboard slot path

| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#8 2021-01-24 01:57:10

tbg
Member
Registered: 2017-06-22
Posts: 54

Re: how to make network devices naming predictable again after iwd install

Hopefully one of the above methods will work for you, (the MAC address method sounds like the best solution).

Just spitballing, but if nothing else works and you don't need both adapters up immediately at boot then I have an idea. Blacklist one of the modules, assuming both adapters are not using the same module. I'm thinking the reason the adapters swap places is they get loaded in a different sequence at boot sometimes. If you take one of them out of the picture at boot time, I would think they will always load with predictable names afterwards. The second adapter that has its module blacklisted could then be manually modprobed, or it could be easily loaded automatically by a service at login.

I'm not positive that will work, but I think the probability is fairly good. Sure it's a super hacky workaround, but if other methods don't work I guess it's an option worth testing.

Offline

Board footer

Powered by FluxBB