Difference between revisions of "Raspberry Pi as Standalone Access Point"
|Line 1:||Line 1:|
I had a case (
I had a case (), where I needed an Raspberry Pi Zero WH to act as access point, including DHCP-Server. Standalone, not connected to any network.
= Installation =
= Installation =
Revision as of 17:32, 29 November 2020
I had a case (Creating Raspberry Pi Zero ePaper Nametag), where I needed an Raspberry Pi Zero WH to act as access point, including DHCP-Server. Standalone, not connected to any network.
apt-get install hostapd dnsutils traceroute udhcp
If the Pi was used before, WPA-supplicant was most likely set up. Disable it.
start 10.178.42.100 # This is the range of IPs that the hostspot will give to client devices. end 10.178.42.199 interface wlan0 # The device uDHCP listens on. remaining yes opt dns 10.178.42.1 opt subnet 255.255.255.0 opt router 10.178.42.1 # The Pi's IP address on wlan0 which we will set up shortly. opt lease 864000 # 10 day DHCP lease time in seconds
…and comment this out…
Enable and Configure Access Point
Explanation: The hostapd reads the configfile, to find this configfile. I don't get what this is good for. I think I'm just net getting the whole concept. If anyone cares to enlighten me, please do. :)
and set something like this:
interface=wlan0 driver=nl80211 hw_mode=g channel=7 ieee80211n=1 wmm_enabled=1 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=2 wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP ssid=HMS_Camden_Lock wpa_passphrase=42_42_42_42 country_code=DE
…and comment this and set path:
Set static IP-Address
interface wlan0 static ip_address=10.178.42.1/24 static routers=10.178.42.1 static domain_name_servers=10.178.42.1
Launch AP and DHCPd
service hostapd start service udhcpd start
root@pi00:~# service hostapd start Failed to start hostapd.service: Unit hostapd.service is masked. root@pi00:~#
systemctl unmask hostapd systemctl enable hostapd
Also remember: Try setting WiFi-Country with…
Later. Not mattering right now.
Don't touch this file. dhcpcd gets jealous...