Skip to content

Wifi Access Point

Jona Saffer edited this page Jan 4, 2021 · 5 revisions

Default configuration

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

Disable / (Re-)Enable the Access Point

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

Re-configuring the Access Point

Changing the SSID

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
⚠️ Warning:
This will terminate all wireless connections until the access point is back up.

Implementation of the dynamic SSID

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.

Changing the Wifi-Password

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).

Changing the IP Address

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.

Clone this wiki locally