Digi Embedded Yocto uses the hostapd package to manage the software access point (SoftAP) mode. When configured in this mode, client stations can connect to the device to communicate with other stations on the same Basic Service Set (BSS). The default configuration includes SoftAP mode by adding a wlan1 entry in /etc/network/interfaces. The hostapd daemon is started when the interface is brought up and stopped when it is brought down.
The wlan1 interface is disabled by default to improve the performance of the wlan0 interface in client infrastructure mode. You can bring it up manually with the following command:
~# ifup wlan1
You can also enable automatic bring-up by uncommenting the "auto wlan1" line in /etc/network/interfaces.
Digi Embedded Yocto provides a mechanism to support a different configuration file per Wi-Fi interface, allowing you to run multiple hostapd instances at the same time.
The hostapd@.service systemd service automatically selects the appropriate configuration file /etc/hostapd_X.conf (where X is the interface that is passed to the service) for each interface.
The hostapd package provides a default configuration file /etc/hostapd.conf as a reference for the different available settings. This file is not used by Digi Embedded Yocto init scripts.
See http://w1.fi/cgit/hostap/tree/hostapd/hostapd.conf for a reference of all hostapd configuration options.
For example, a static wlan1 configuration entry configured in SoftAP mode would be:
auto wlan1 iface wlan1 inet static address 192.168.46.30 netmask 255.255.255.0 post-up systemctl start email@example.com pre-down systemctl stop firstname.lastname@example.org
This configures wlan1 to run the email@example.com systemd service. This service launches the hostapd daemon using the configuration file /etc/hostapd_wlan1.conf. SoftAP configuration examples are described below.
802.11a/n/ac WPA2-PSK authentication with CCMP/AES encryption
This is the default configuration used by Digi Embedded Yocto.
ctrl_interface=/var/run/hostapd ctrl_interface_group=0 interface=wlan1 driver=nl80211 # WPA2-AES encryption ssid=ap-wlan1-wpa2aes-a auth_algs=1 wpa=2 wpa_key_mgmt=WPA-PSK wpa_pairwise=CCMP wpa_passphrase=password-wpa2aes # IEEE 802.11ac channel 36 hw_mode=a channel=36 ieee80211ac=1 ieee80211n=1
802.11b/g/n WPA2-PSK authentication with CCMP/AES encryption
ctrl_interface=/var/run/hostapd ctrl_interface_group=0 interface=wlan1 driver=nl80211 # WPA2-AES encryption ssid=ap-wlan1-wpa2aes-n auth_algs=1 wpa=2 wpa_key_mgmt=WPA-PSK wpa_pairwise=CCMP wpa_passphrase=password-wpa2aes # IEEE 802.11n auto channel hw_mode=g channel=10 ieee80211n=1