Set up Linux machine as wireless access point

From AcrodusWiki

How to configure a linux machine to operate as a wireless access point.

Ensure that the hostapd package is installed on the machine, to install apt-get install hostapd.

Go to the file /etc/default/hostapd and edit the line DAEMON_CONF="" with the path to the hostapd.conf file. This is advised to be put at /etc/hostapd/hostapd.conf, this file may need to be created on first use. The config file needs to include the contents shown below, obviously changed for specific use case.

/etc/hostapd/hostapd.conf

interface=wlp2s0

bridge=br0

driver=nl80211

country_code=UK

ssid=alex_laptop

hw_mode=g

channel=6

wpa=2

wpa_passphrase=password

wpa_key_mgmt=WPA-PSK

wpa_pairwise=TKIP

rsn_pairwise=CCMP

auth_algs=1

macaddr_acl=0


Ensure there are no spaces as this will make the service shit itself when you try start it. Once configured start the hostapd.service. You may be required to unmask the service on first use, this can be done with the command sudo systemctl unmask hostapd.service.

Hopefully now you should be able to connect to laptop from another device. Further configuration can be provided in /etc/network/interfaces for persistent configuration on reboot. Usually this will be used in one of two way. One will be to bridge the wireless interface to a wired interfaces connected to a LAN or even an Internet gateway. The second is for a temporary connection to a device such as a raspberry pi zero w 2. This will allow an ssh connection from the laptop. For this use case remember to add an ip address onto the bridged domain.