Skip to content

Networking

Dave Townsend edited this page Oct 27, 2025 · 3 revisions

The recommended way to set up networking on a Raspberry Pi is to use hostapd to provide the Wifi access point and systemd-networkd to manage the network interfaces. This guide assumes you have used the recommended way to setup flick-sync as a systemd service.

Basic Network

Create the following files:

  • /etc/hostapd/hostapd.conf (adjust the channel etc. to meet your needs)
interface=wlan0
driver=nl80211
ssid=<your SSID>
hw_mode=a
channel=36
country_code=GB
ieee80211d=1
ieee80211n=1
ieee80211ac=1
ieee80211w=0
wmm_enabled=1

auth_algs=1
wpa=2
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_passphrase=<passphrase>
wpa_group_rekey=86400
  • /etc/dnsmasq.conf
interface=wlan0
except-interface=lo
listen-address=10.10.80.254
bind-interfaces
no-resolv
domain=travel.local

dhcp-range=10.10.80.1,10.10.80.150,60m

host-record=media.travel.local,10.10.80.254
  • /etc/systemd/network/20-eth0.network
[Match]
Name=eth0

[Network]
DHCP=yes

[Link]
RequiredForOnline=no
  • /etc/systemd/network/30-wlan0.network
[Match]
Name=wlan0

[Network]
Address=10.10.80.254/24
ConfigureWithoutCarrier=yes
  • /etc/networkd-dispatcher/routable.d/10-eth0.sh (must be executable)
#! /bin/sh

[ "$IFACE" = "eth0" ] || exit 0
systemctl is-active --quiet flick-sync.service && systemctl reload flick-sync.service
  • /etc/networkd-dispatcher/configured.d/10-wlan0.sh (must be executable)
#! /bin/sh

[ "$IFACE" = "wlan0" ] || exit 0
systemctl is-active --quiet flick-sync.service && systemctl reload flick-sync.service

Then run the following commands:

$ sudo apt install networkd-dispatcher dnsmasq systemd-resolved
$ sudo systemctl unmask hostapd
$ sudo systemctl enable hostapd
$ sudo systemctl disable NetworkManager
$ sudo systemctl enable networkd-dispatcher dnsmasq systemd-resolved
$ sudo reboot

Clone this wiki locally