Configuring as access point
You can configure an Industrial PC as an access point under TwinCAT/BSD. This feature requires the hostapd
packet to be installed. Install the hostapd
packet with: doas pkg install hostapd
The hostapd
daemon takes care of client authentication and key management on the WPA2-enabled access point.
Make sure the correct regulatory domain is used for the respective country. This includes, for example, the permitted channels, permitted transmission power and DFS activation for certain 5 GHz channels.
Requirements:
- Installing the
hostapd
packet. - Internet connection.
- Reinsert the WLAN stick if it was plugged in at startup.
Proceed as follows:
- 1. Open the file
rc.conf
withdoas ee /etc/rc.conf
and add the following lines:
Example:
hostapd_enable="YES" #starts the hostapd daemon automaticaly after boot
wlans_rtwn0="wlan0" #wireless interface used for access point
create_args_wlan0="wlanmode hostap ssid yourSSIDname authmode WPA2"
ifconfig_wlan0="inet 192.168.0.1 netmask 255.255.255.0 country DE"
- 2. Use the command
doas ee /etc/hostapd.conf
to open the filehostapd.conf
and add the following lines:
Example:
interface=wlan0
debug=1
ctrl_interface=/var/run/hostapd
ctrl_interface_group=wheel
ssid=yourSSIDname
wpa=2
wpa_passphrase=freebsdmall #password for wlan network
wpa_key_mgmt=WPA-PSK
wpa_pairwise=CCMP
channel=6 #Channel for the desired radio band (default: 0 stands for ACS, automatic Channel Selection)
hw_mode=g #Operation mode, in this case g=IEEE802.11g (2.4 GHz)
country_code=DE #used to set the right regulatory domain for your country
ieee80211d=1 #advertises the country_code an the set of allowed channels and transmit power levels based on the regulatory limits (default=0)
- 3. Enter the command
doas service hostapd forcestart
to start the access point.
- You have successfully configured the Industrial PC as an access point. WLAN devices can now connect to the network using the SSID and the password from the
hostapd.conf
file.
For further information see: https://www.freebsd.org/doc/handbook/network-wireless.html