I have two ethernet ports and one wireless port on a router I am setting up. I am using systemd-networkd. I am renaming the ports first then creating a bridge then am bridging one of the the ethernet ports and the wireless board to create on combined lan port with a single IP and DHCP/DNSMASQ. The other ethernet being the wan port. Here you see the the networkctl output. lan is the bridge. You see wlan has same status as lan2 (which is the NIC and is working fine). So the bridge and all the routing is fine.
IDX LINK TYPE OPERATIONAL SETUP
1 lo loopback carrier unmanaged
2 wan ether routable configured
3 lan2 ether carrier configuring
4 wlan wlan carrier configuring
5 lan ether routable configured
So.....I am pretty close. It's only getting hostapd to start at the right time using systemd-networkd. The AP comes up but it looks like the wireless interface is not getting bound to the bridge. A client can enter WPA password and it is accepted but then it never connects. The logs aren't helping me to identify the issue but I am pretty sure the wireless port is not getting fixed to the bridge. That would explain why the AP functions seems fine but then there is not actual connection with an IP address being given out.
Anyone with some experience have some tips? As you can see the hostapd.service I wrote tries to delay starting hostapd until networkd is done, in particular until the bridge has been created. Maybe it's something to do with hostapd delaying for networkd but networkd adding wlan to the lan bridge before hostapd has started...kinda a catch22.
hostapd.conf
interface=wlan
# the interface used by the AP
hw_mode=g
# g simply means 2.4GHz band
channel=10
# the channel to use
#ieee80211d=1
# limit the frequencies used to those allowed in the country
#country_code=US
# the country code
ieee80211n=1
# 802.11n support
#wmm_enabled=1
# QoS support
#ignore_broadcast_ssid=0
ssid=645-gateway
# the name of the AP
auth_algs=1
# 1=wpa, 2=wep, 3=both
wpa=2
# WPA2 only
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP
wpa_passphrase=elf645Keb1920
hostapd.service
[Unit]
Description=Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
Wants=network-online.target
After=systemd-networkd.service
After=sys-subsystem-net-devices-wlan.device
After=sys-subsystem-net-devices-lan.device
BindsTo=sys-subsystem-net-devices-lan.device
[Service]
Type=forking
PIDFile=/run/hostapd.pid
ExecStart=/usr/sbin/hostapd /etc/hostapd/hostapd.conf -P /run/hostapd.pid -B
[Install]
WantedBy=multi-user.target
30-br-wlan-lan.network
[Match]
Name=wlan
[Network]
Bridge=lan