Close

Raspberry Pi networking the systemd way

Back to overview

Set up Raspberry Pi 3 or Zero W networking using systemd. Including simultaneous AP + STA.

Discussions

StB wrote 10/30/2023 at 14:19 point

why using hostapd when networkd can host an ap by itself ?

  Are you sure? yes | no

Ray Foss wrote 12/04/2020 at 20:59 point

In buster, hostapd does support systemctl natively... just name the config file `/etc/hostapd/ap0.conf`

Also make sure to set the locale in iw reg set and crda.

I got everything working... except the default route seems to be a dead end, maybe I need masquerade.

Got it fixed... ip forwarding was not enabled. Also used netfilter-persistent to make a masquerade rule `sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE`. For some reason the DNS server is not exposed or being given in DHCP. The routing is fine now... will bork this and start over.

  Are you sure? yes | no

Dimitry wrote 02/23/2020 at 21:00 point

@simonlock sorry for the delay (I didn't get notified). Make sure you've created udev rule in step 12.a. I've just tried it on a fresh RPi4 and it works fine.

  Are you sure? yes | no

simonlock wrote 08/17/2019 at 20:20 point

A nice concise write up. Thanks. I've recently taken up systemd-networkd on my pi4 and your instructions nicely summarised how to set this up. However, regarding your setup of a virtual ap (step d) for hostapd failed for me. 

networkctl status ap0

returns:

Failed to request link: No such device

Perhaps you possibly suggest what might have since changed or what I might have done wrong? Thanks in advance.

  Are you sure? yes | no