2

I'm using Archlinux on a Raspberry Pi 3. The wireless adapter was working with systemd-networkd and wpa_supplicant. I named the device to "wlan0" using a 00-wlan0.link file containing:

[Match]
MacAddress=b8:27:eb:20:a4:a5

[Link]
Name=wlan0

After trying to bridge the wired and the wireless adapter which resulted in neither of one working anymore, I deleted all files from /etc/systemd/network except 00-lan0.link and lan0.network which give a static IP to my wired adapter so I can access the machine via cable. No I observe that after rebooting, the wireless interface's name still is wlan0, although the .link file giving it that name is not in place anymore. Furthermore, if I add another .link file trying to give the interface a new name (wlan1), this is ignored and the device still shows up under the name wlan0. What could cause this and how can you debug this problem?

3
  • 1
    From systemd.link man page, The first (in lexical order) of the link files that matches a given device is applied. So, if you add another link file for the same device, one of them is ignored. Also, you should assign static IPs via your router, since you never know who might lease the IP you want while your the Raspberry PI is shutdown. (Had to learn this the hard way.)
    – Munir
    Commented Dec 13, 2016 at 22:20
  • @Munir As I described, I deleted the first link file, so at least in the /etc/systemd/network folder there is nothing to mask my new link file.
    – jan
    Commented Dec 14, 2016 at 13:21
  • Ahh..sorry. Misunderstood what you did there.
    – Munir
    Commented Dec 14, 2016 at 15:20

2 Answers 2

2

Systemd-networkd respects files in multiple locations, namely, /etc/systemd/network, /run/systemd/network and finally /lib/systemd/network. If a file whose base name is lexically before your file, it takes precedence, even if its location doesn't prevail. You should find out if such file exists and delete it. networkctl status <iface> will show information about the interface. Look for the line about Link File.

1

systemd-networkd ignores .link files, indeed. This is expected. What interprets .link files is called systemd-udevd. You can easily check this by introducing (e.g.) a nonexistent option into a configuration file and then restarting the particular daemon. You'll see that errors in .network files will be reported by systemd-networkd whereas errors in .link files will be reported by systemd-udevd.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .