lukicdarkoo / rpi-wifi

Configures simultaneous AP and Managed Mode Wifi on Raspberry Pi
GNU General Public License v3.0
532 stars 120 forks source link

WLAN0 not connecting to broader internet #15

Open xthursdayx opened 4 years ago

xthursdayx commented 4 years ago

I tried using this script with the updates @mahesh2000 mentioned here on my Raspberry Pi Zero W, however I'm unable to get wlan0 to connect to the broader internet. My AP SSID works and I'm able to connect to my RPi W 0 via ssh, however not able to ping any external website (or run any apt commands). If I run ip addr both wlan0 and ap0 seem to be up and have correct IP addresses. Any ideas?

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/96267835-wlan0-not-connecting-to-broader-internet?utm_campaign=plugin&utm_content=tracker%2F97445956&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F97445956&utm_medium=issues&utm_source=github).
lukicdarkoo commented 4 years ago

Do you have internet connection on your router (or whatever the Raspberry Pi is connecting to)? Also, can you check whether you have the following 3 lines in /bin/rpi-wifi.sh:

sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -s ${AP_IP_BEGIN}.0/24 ! -d ${AP_IP_BEGIN}.0/24 -j MASQUERADE
sudo systemctl restart dnsmasq

Also, maybe it is related to #10