Last active
August 29, 2022 09:30
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# /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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /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