Creating an Access Point on wlan0

Setting a static IP for wlan0

Edit the /etc/systemd/network/wlan0.network to give the interface a static IP

[Match]
Name=wlan0

[Network]
Address=192.168.90.1/24

Restart the systemd-networkd.service

systemctl restart systemd-networkd

Installing hostapd

pacman -S hostapd

Configure hostapd by following this guide and the hostapd site, creating the following config.

# Basics
interface=wlan0
driver=nl80211
ssid=landy
hw_mode=g
channel=1

# Security Settings - wpa2 only
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_passphrase=*****REPLACE_ME*******
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP
rsn_pairwise=CCMP

Enable the hostapd service

systemctl enable hostapd

Configure dhcp on the interface

Set up dhcpd following the Arch Linux dhcp guide. Note that I only want this to be enabled on wlan0 and not other interfaces, so I followed the specifics of Listening on only one interface

So create a new unit definition file for the service in /etc/systemd/system/dhcpd4@.service The contents of this file differ from the example as I want the wlan0 interface to be up before dhcpd4 starts

[Unit]
Description=IPv4 DHCP server on %I
Wants=network.target
After=network.target

[Service]
Type=forking
PIDFile=/run/dhcpd4.pid
ExecStart=/usr/bin/dhcpd -4 -q -pf /run/dhcpd4.pid %I
KillSignal=SIGINT

[Install]
WantedBy=multi-user.target

Edit the config file /etc/dhcpd.conf

# dhcpd.conf
#
# Sample configuration file for ISC dhcpd
#

# option definitions common to all supported networks...
default-lease-time 600;
max-lease-time 7200;

# If this DHCP server is the official DHCP server for the local
# network, the authoritative directive should be uncommented.
authoritative;

# This is a very basic subnet declaration.

subnet 192.168.90.0 netmask 255.255.255.0 {
  range 192.168.90.2 192.168.90.5;
}

Enable the service on the single interface:

systemctl enable dhcpd4@wlan0
Go Top