Skip to content

Instantly share code, notes, and snippets.

@rollwagen
Last active December 20, 2019 18:19
Show Gist options
  • Save rollwagen/871fad74c0c23a300ac7cc22b9df9619 to your computer and use it in GitHub Desktop.
Save rollwagen/871fad74c0c23a300ac7cc22b9df9619 to your computer and use it in GitHub Desktop.
Configuring wifi interface on Raspberry as WLAN access point. #raspi #wlan

Configuring wifi interface on Raspberry as WLAN access point

Configuration steps

sudo apt-get install hostapd
sudo apt-get install dnsmasq
sudo systemctl stop hostapd
sudo systemctl stop dnsmasq

vi /etc/dhcpcd.conf

interface wlan0
static ip_address=192.168.8.10/24
denyinterfaces eth0
denyinterfaces wlan0

sudo vi /etc/dnsmasq.conf

interface=wlan0
	dhcp-range=192.168.8.11,192.168.8.30,255.255.255.0,24h
	nohook wpa_supplicant

sudo vi /etc/hostapd/hostapd.conf

interface=wlan0
driver=nl80211
ssid=NameOfNetwork
hw_mode=g
channel=7
wmm_enabled=0
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=AardvarkBadgerHedgehog
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

sudo vi /etc/default/hostapd

DAEMON_OPTS="-dd -t -f /home/pi/hostapd.log"
DAEMON_CONF="/etc/hostapd/hostapd.conf"

Static wlan interface naming if >1

/etc/udev/rules.d/72-wlan.rules

ACTION=="add", SUBSYSTEM=="net", DRIVERS=="brcmfmac", NAME="wlan0"
ACTION=="add", SUBSYSTEM=="net", DRIVERS=="r8188eu", NAME="wlan1"

Finding wlan interface driver name:

udevadm test /sys/class/net/wifi1 | grep -i driver

Links / Documentation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment