-
Notifications
You must be signed in to change notification settings - Fork 0
Wifi Access Point
In the image a wifi access point is enabled and configured with:
| Wifi AP Config | ||
|---|---|---|
| SSID | evotrainer-FFFF | where FFFF is last 4 digits of MAC |
| Wifi-Password | evocortex |
|
| IP-Address | 192.168.10.1/24 | connecting devices get assigned an IP via DHCP |
Multiple services are used to provide the access point. Each of theses has to be disabled to completely turn of the access point and not interfere with other functions.
To disable the access point, disable the hostapd and dnsmasq service:
sudo systemctl disable --now hostapd.service
sudo systemctl disalbe --now dnsmasq.servie
To enable the access point, enable the hostapd and dnsmasq services:
sudo systemctl enable --now hostapd.service
sudo systemctl enable --now dnsmasq.service
To change the SSID of the access point, the /etc/hostapd/hostapd.conf configuration
file needs to be adjusted.
Specifically the line ssid=evotrainer-FFFF (note: in your system the FFFF is
replaced by the last 4 digits of the MAC address) should be changed to
ssid=<your desired SSID>.
Afterwards the hostapd service has to be restarted via:
sudo systemctl restart hostapd.service
| This will terminate all wireless connections until the access point is back up. |
Since the hostapd service does not include a function for dynamic SSID, a
SSID-template is overwritten in the config file before each start of the service.
This is accomplished via the systemd service drop-in
/etc/systemd/system/hostapd.service.d/01-update-ssid.conf.
It performs a regex replace of evotrainer-[0-9a-fA-F]{4} with
evotrainer-<last 4 MAC digits>, where the MAC digits are optianed from
/sys/class/net/wl*/address.
The wifi password is set in the /etc/hostapd/hostapd.conf configuration file
with the key wpa_passphrase.
After changing the configuration file the hostapd service needs to be restarted
(see Changing the SSID).
To change the IP address space, multiple modifications have to be made:
- Changing the base address in
/etc/network/interfaces - Changing the DHCP range in
/etc/dnsmasq.conf
For more detail refere to man 5 interfaces and man 8 dnsmasq.
Afterwards the hostapd and/or dnsmasq services have to be restarted.