davesteele / comitup

Bootstrap Wifi support over Wifi
https://davesteele.github.io/comitup/
GNU General Public License v2.0
320 stars 54 forks source link

Forward from eth0 to wlan0 #88

Closed Anjum9694 closed 4 years ago

Anjum9694 commented 4 years ago

I'd like the RPi to have internet access when comitup asks for connection to use as a hotspot. Internet connection is provided through the ethernet cable.

davesteele commented 4 years ago

You'll need to do three things:

Anjum9694 commented 4 years ago

1) I'm not quite sure what that meant.

2) Used sudo iptables -A FORWARD -i wlan0 -j ACCEPT sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

3) Uncommented ipv4 forwarding line in sysctl.

No internet connection on the hotspot yet..

davesteele commented 4 years ago

"ip route" to see the routes. "ip route add default via x.x.x.x" "ip route del default via x.x.x.x"

Though you should fix the routes using NetworkManager (using e.g. nmtui) to make the changes persistent.

The ip forwarding change requires a reboot (or sysctl -p)