1
0
mirror of https://github.com/billz/raspap-webgui.git synced 2023-10-10 13:37:24 +02:00

Updated RPi Zero W AP STA mode (markdown)

Bill Zimmerman 2020-08-18 10:34:22 +02:00
parent 33aeac7b6a
commit 57209c846a

@ -1,6 +1,6 @@
### Preamble
This walkthrough describes an installation of RaspAP on the [Raspberry Pi Zero W](https://www.raspberrypi.org/products/raspberry-pi-zero-w/). A managed mode AP, variously known as **WiFi client AP mode**, a **micro-AP** or simply **AP-STA**, works "out-of-the-box" with the Quick Installer if the steps below are followed carefully. This feature was added to RaspAP specifically to support Internet of Things (IoT) and embedded applications for the Pi Zero W, however it is equally useful for a broad range of use cases.
This walkthrough describes an installation of RaspAP on the [Raspberry Pi Zero W](https://www.raspberrypi.org/products/raspberry-pi-zero-w/). A managed mode AP, variously known as **WiFi client AP mode**, a **micro-AP** or simply **AP-STA**, works "out-of-the-box" with the Quick Installer if the steps below are followed carefully. This feature was added to RaspAP specifically to support Internet of Things (IoT) and embedded applications for the Pi Zero W, however it is equally useful for a broad range of projects.
Continue reading for an explanation of AP-STA mode, or [skip to the installation](#installation).
@ -29,10 +29,10 @@ There are many scenarios in which AP-STA mode might be useful. These are some of
2. A a hub for Internet of Things devices, while also creating a bridge between them and the internet.
3. A guest interface to your home wireless network.
Security is an important consideration with Internet of Things and it can be beneficial to keep your IoT devices on a separate network for safetys sake. No one wants a random internet user turning your lights on and off.
Security is an important consideration with IoT and it can be beneficial to keep your devices on a separate network for safetys sake. No one wants a random internet user turning your lights on and off.
### How does AP-STA work?
In this configuration, we create a virtual network interface (called `uap0` here) and use it instead of `wlan0` on the AP side. This virtual interface is used by several of the services used to manage an AP. Relevant sections are displayed below as examples.
In this configuration, we create a virtual network interface (here `uap0`) and use it instead of `wlan0` on the AP side. This virtual interface is used by several of the services needed to operate a software access point. RaspAP manages these configurations in the background for you. Relevant sections are displayed below as examples.
`dhcpcd.conf`:
```
@ -48,13 +48,25 @@ nohook wpa_supplicant
interface=uap0
```
RaspAP manages these configurations in the background for you. On AP-STA startup and system reboots, RaspAP's service control script adds the virtual `uap0` interface and brings it up, like so:
`dnsmasq.conf`:
```
# RaspAP uap0 configuration
interface=lo,uap0 # Use interfaces lo and uap0
bind-interfaces # Bind to the interfaces
server=8.8.8.8 # Forward DNS requests to Google DNS
domain-needed # Don't forward short names
bogus-priv # Never forward addresses in the non-routed address spaces
```
On AP-STA startup and system reboots, RaspAP's service control script adds the virtual `uap0` interface and brings it up, like so:
```
iw dev wlan0 interface add uap0 type __ap
ifconfig uap0 up
```
With the virtual `uap0` interface added to the `wlan0` physical device, we can then start up `hostapd`. It is important that the virtual interface is brought up first, otherwise it will fail with the message "could not configure driver mode". We also need to be sure that the interface is not managed by `systemd-networkd`, so this service should be disabled. These steps are handled by the RaspAP daemon `raspapd.service`.
### Installation
1. Begin by flashing an SD card with the latest release of [Raspberry Pi OS (32-bit) Lite](https://www.raspberrypi.org/downloads/raspbian/).