I got it to work with the help of these links: 1, 2, 3, 4
This is the sequence, which worked for me (WiFi in n-Mode, static IP):
- Install hostapd:
apt-get update
, apt-get install hostapd
- unmask & enable it:
sudo systemctl unmask hostapd
, sudo systemctl enable hostapd
- create /etc/hostapd/hostapd.conf and cut&paste:
# the interface used by the AP
interface=wlan0
driver=nl80211
# "g" simply means 2.4GHz band
hw_mode=g
# the channel to use
channel=1
# limit the frequencies used to those allowed in the country
ieee80211d=1
# the country code
country_code=DE
# 802.11n support
ieee80211n=1
# QoS support
wmm_enabled=1
# the name of the AP
ssid=yourSSID
macaddr_acl=0
# 1=wpa, 2=wep, 3=both
auth_algs=1
ignore_broadcast_ssid=0
# WPA2 only
wpa=2
wpa_passphrase=yourpassphrase
wpa_key_mgmt=WPA-PSK
#wpa_pairwise=TKIP
rsn_pairwise=CCMP
- Edit the file /etc/default/hostapd and modify the line of DAEMON_CONF like this:
DAEMON_CONF="/etc/hostapd/hostapd.conf"
(Testing to verify is AP is visible i.e. on phone: sudo service hostapd start
; then sudo service hostapd stop
again to continue setup)
- cut&paste this into `/etc/netplan/network.yaml file (no tabs, just spaces, follow indentation exactly - yaml is picky...):
network:
version: 2
renderer: networkd
ethernets:
# My Ethernet adapter
eth0:
# For some reason it seems I must specify at least something here.
dhcp4: no
# My Wi-Fi adapter
wlan0:
dhcp4: no
bridges:
br0:
interfaces:
- eth0
- wlan0
# Using a static IP for this box.
addresses:
- 192.168.1.xxx/24
gateway4: 192.168.1.x
nameservers:
addresses: [1.1.1.1,1.0.0.1]
- Apply the new configuration:
sudo netplan generate
,sudo netplan apply