Mild Dermatographia

Fixing DHCP when using systemd-networkd


I had the urge to burn a day, and so I reinstalled Arch Linux. I decided not to repeat my past mistakes and stuck with X11 and i3 instead of Wayland and Sway. As expected, there was no blur using Firefox or Electron-based applications. Everything was working just swell, until I rebooted the computer for the first time. I could ping, but when I opened Firefox and tried going to any site, it said the webserver could not be found. Updating software using pacman -Syu also failed to contact any websites. I was using iwd to connect to our home wifi, and systemd-networkd and systemd-resolved for DNS resolution and whatever else they do (networking on Linux is still super opaque to me, despite trying to digest the Arch Wiki). I had made sure to enable and start systemd-networkd and systemd-resolved using:

systemctl enable systemd-networkd.service
systemctl enable systemd-resolved.service
systemctl start systemd-networkd.service
systemctl start systemd-resolved.service

but still nothing.

It turns out systemd-networkd has a built-in DHCP client, but that its default status is “no”. I created /etc/systemd/network/ (I think *.network would have also worked) with the following content:



where wlan0 is the network interface you’re using. If it were ethernet, it would probably be eth0. You can use ip link show to see your options. After restarting systemd-networkd and systemd-resolved, I was able to connect to the internet!

If you’re looking for forums discussing this issue, you can check here and here.