davesteele / comitup

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

Quiestion - access to internet in AP mode #208

Open Ataraxiall opened 2 years ago

Ataraxiall commented 2 years ago

Hi!

It´s possible have internet access if the ethernet cable is connected. In some cases, i want to access to internet.

Thanks!

davesteele commented 2 years ago

If the Ethernet connection has an upstream connection and is using DHCP, then it will configure to use that when connected.

davesteele commented 2 years ago

Note that this capability is part of the Comitup image, not the package itself.

Ataraxiall commented 2 years ago

Thanks for the reply.

I have already been able to make it work, the only thing I added is this command "iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE" and "echo 1 > /proc/sys/net/ipv4/ip_forward "The "problem" is that from another connected computer I can put a manual dns on it and the internet works, but from the mobile it does not browse, it always takes me to the comitup website for wifi selection. Can it be changed so that comitup assigns a dns different from the original (10.41.0.1)?

Tranks!

davesteele commented 2 years ago

The current DNS behavior is key to make the captive portal work. Changing the DNS IP would break that.

You probably would be interested in the proposed enhancement in https://github.com/davesteele/comitup/issues/168

davesteele commented 2 years ago

Upon reflection, there are multiple strategies for implementing the captive portal - both defined in dns-hotspot.conf. Option 160 explicitly defines a captive portal url. Option 6 defines a dns server to be used, which, in this case, returns the IP of the device for all requests.

You MAY be able to switch option 6 to a real dns server and still have a working captive portal, relying on option 160. I have no idea which platforms would break from this.

If it does work "correctly", you probably won't like it. It will still show the portal pages for all web requests (in HOTSPOT mode), while routing all other traffic over the external connection.

It's been several years since I worked through this, and, at the time, determined that I needed both.

Bottom line, #168.