Skip to content

Instantly share code, notes, and snippets.

@afriza
Last active August 29, 2022 09:30
Show Gist options
  • Save afriza/fa4b2deb191ed0c580800be4e9fcf570 to your computer and use it in GitHub Desktop.
Save afriza/fa4b2deb191ed0c580800be4e9fcf570 to your computer and use it in GitHub Desktop.
Access Point using `hostapd`, `systemd-networkd`, `dnsmasq` adapted from https://raspberrypi.stackexchange.com/q/89803/90456
# /etc/systemd/network/ap-wlan0.network
[Match]
Name=wl*
[Network]
LLMNR=no
MulticastDNS=yes
IPMasquerade=ipv4
Address=192.168.90.1/24
DHCPServer=yes
[DHCPServer]
DNS=192.168.90.1
# /etc/hostapd/hostapd.conf
interface=wlan0
driver=nl80211
ssid=MySSID
country_code=ID
hw_mode=g
channel=7
auth_algs=1
wpa=2
wpa_passphrase=MyPassphrase
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP
# /etc/dnsmasq.d/main-dnsmasq.conf
bind-dynamic
no-dhcp-interface=e*
interface-name=fqdn1,wlan0/4
interface-name=fqdn2,wlan0/4
log-queries
#log-debug
#! /bin/sh -x
apt install hostapd rfkill dnsmasq ipset
systemctl reload systemd-networkd
systemctl unmask hostapd
systemctl enable --now dnsmasq hostapd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment