I want to use a RPi Zero W as a completely wireless router. The built-in wireless device (wlan0) will be used to provide a local wireless network, and a secondary usb wireless device (wlan1) will be used to connect to a WAN. (rough diagram below) That is, I want to share the internet connection of the usb wireless device to the internal network created by the built-in wifi device.
xxx.xxx.xxx.xxx (WAN) <---> wlan1 <---> RPi W <---> wlan0 <---> 10.3.141.* (local network)
Steps I figured out so far:
- Stash any current wifi connection config.
sudo cp /etc/wpa_supplicant/wpa_supplicant.conf /etc/wpa_supplicant/wpa_supplicant.conf.sav sudo cp /dev/null /etc/wpa_supplicant/wpa_supplicant.conf
- Install RaspAp and Reboot
sudo wget -q https://git.io/voEUQ -O /tmp/raspap && bash /tmp/raspap
(after reboot, the new WiFi network created by RaspApp should be available, connect to it)
- Re-enable WiFi Config
sudo cp /etc/wpa_supplicant/wpa_supplicant.conf.sav /etc/wpa_supplicant/wpa_supplicant.conf
- Reboot Again
(at this point wlan0 should be providing the internal network, and wlan1 should be connected to the network defined in the credentials in wpa_supplicant.conf)
- Make wlan0 and wlan1 communicate with each other
And this is the step I am missing.
If I "ping -I < name of wlan1 interface > 22.214.171.124" I get a connection, so every adapter is doing what is supposed to. The issue here is make wlan0 re-route traffic from the internal network to the external one, wlan1, when necessary.
OS: Raspbian Stretch Lite
Hardware: RPi Zero W + WiFi Dongle
Software: RaspAP 1.5.1