
2/11/2020
TS-7100 - Technologic Systems Manuals
https://wiki.embeddedarm.com/w/index.php?title=TS-7100&printable=yes
11/44
Systemd auto-start with bridge to eth0
It is possible to configure the auto-start of 'hostapd' through systemd. The configuration outlined below will set up a
bridge with "eth0", meaning the Wi-Fi connection is directly connected to the ethernet network. The ethernet
network is required to have a DHCP server present and active on it to assign Wi-Fi clients an IP address. This setup
will allow Wi-Fi clients access to the same network as the ethernet port, and the bridge interface will allow the
platform itself to access the network.
Set up hostapd
First, create the file "/etc/systemd/system/hostapd_user.service" with the following contents:
[
Unit
]
Description
=Hostapd IEEE 802.11 AP
Wants
=network.target
Before
=network.target
Before
=network.service
After
=sys-subsystem-net-devices-wlan0.device
After
=sys-subsystem-net-devices-br0.device
BindsTo
=sys-subsystem-net-devices-wlan0.device
BindsTo
=sys-subsystem-net-devices-br0.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
Then enable this in systemd:
systemctl
enable
hostapd_user.service
systemctl
enable
systemd-networkd
Set up bridging
Create the following files with the listed contents.
"/etc/systemd/network/br0.netdev"
[
NetDev
]
Name
=br0
Kind
=bridge
"/etc/systemd/network/br0.network"
[
Match
]
Name
=br0
[
Network
]
DHCP
=
yes