0

I want to always assign a specific interface name to the raspberry pi onbaord wifi device so that I can be sure that i always pick the right device. This is a problem because once multiple wifi adapters (e.g. an USB wifi dongle) come into play chances are that the devices are initialized in random order and wlan0 will not always refer to the same device.

What I have is this:

/etc/systemd/network/09-wlan1.link

[Match]
MACAddress=<adapter MAC address> <--- this is impractical because I have to manually type the MAC of the pi's wifi device

[Link]
Name=wifi_onboard

However, the problem as you can see is, that I always have to enter the mac address manually which is very time-consuming if I have multiple raspis. Is there another option to always match the onboard wifi device to a specifi interface name?

4
  • You can't use "slot numbers" because the Pi hardware doesn't have them. You need to explain why you don't just use the default wlan0
    – Milliways
    Mar 29, 2021 at 7:12
  • @Milliways: that's unfortunate. I want to use it because interface names like wlan0 tend to get mixed up once multiple wifi adapters come into play (e.g. with a wifi dongle). This is also the reason why the pi has a feature "predictable network interfaces" which uses the mac-address as a specifier. I edited my op
    – glades
    Mar 29, 2021 at 10:12
  • If you use Predictable Network Interface Names the internal WiFi will ALWAYS be wlan0 - there is no possible confusion. The potential confusion only arises if you don't use it - this creates a race condition in interface enumeration which occurs when there are no rules.
    – Milliways
    Mar 29, 2021 at 11:10
  • Ahh thank you very much I thought that the onboard interface would also get a name like wlx74da3828a76f or something but I just checked and it stays wlan0.
    – glades
    Mar 30, 2021 at 6:42

1 Answer 1

1

If you use Predictable Network Interface Names the internal WiFi will ALWAYS be wlan0 - there is no possible confusion.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.