coova / coova-chilli

CoovaChilli is an open-source software access controller for captive portal hotspots.
Other
516 stars 258 forks source link

Using CoovaChilli without internet access #212

Closed denizerdi closed 8 years ago

denizerdi commented 8 years ago

Hello

I am trying to make an offline media server with raspberry Pi. And i want to redirect people to the main page (IP of the device) when they connect to it through wifi hotspot. I managed to install coova and it works when Pi is connect to internet through eth0. But when i unplug the eth cable it doesnt work. I think i need to install a dns server inside Pi and make coova use it. But i cant seem to do this. Can anyone help me please?

Thanks

gbaligh commented 8 years ago

Can you try to force coovachilli to resolve only for local domain ?

"uamaliasip" - "Special IP Address aliased (redirect) to uamlisten/uamport" 
"uamaliasname" - "Special simple hostname (no dots) to be resolved to uamaliasip"
"uamhostname"  - "Special simple hostname (no dots) to be resolved to uamlisten"
"domaindnslocal" - "Option to consider all hostnames in domain as local"
denizerdi commented 8 years ago

HS_UAMALIASNAME=

will i add like this to the config file in chilli?

denizerdi commented 8 years ago

My whole purpose is actually just triggering something that is gonna redirect people when they connect to wifi or type another adress. ATM I don't need an authorization system.

gbaligh commented 8 years ago

The client must issue a HTTP request to be redirected, and it can only send HTTP if the DNS server respond. So, What I'm suggesting is to try to resolve all FQDN suffixed by the localdomain to the uamlisten address. Client will try to resolve FQDN directly, if this fail it will try to resolve FQDN.localdomain. Just an idea.

denizerdi commented 8 years ago

Thanks for your answers. I am still trying and i discovered something. I unplugged ADSL cable from my router but Pi is still connected to it via eth0. So no internet access (in coova config dns are google dns). When i connect to wi-fi coova works great. Whatever i type i am still redirected to coova login page. So i am guessing my router somehow is acting like a DNS server?

muratbeser commented 8 years ago

Deniz use iptables for redirecting users for 80 If you want just a media server and dont want to serve any wifi hotspot service I think it's a good solution.

sevan commented 8 years ago

Hi, There is now a mailing list for questions such as these, the issues section will be used solely for bug reports in code from now on, can I ask you to subscribe & take the discussion there (give it a few days as the system is freshly setup without any subscribers at the moment).

antoniovalenzuela commented 6 years ago

add 2 zones into local DNS (bind server too resolves on UAMLISTEN IP, Port UDP 53)

Example: HS_UAMLISTEN=10.10.10.1 HS_DNS1=10.10.10.1

Windows 10 and above use http://www.msftconnecttest.com/connecttest.txt Windows 8.1 and earlier versions use http://www.msftncsi.com/ncsi.txt

zone: msftncsi.com www IN A 190.46.255.40 (or any public IP)

zone: msftconnecttest.com www IN A 13.107.4.52 (or any public IP)


Another and best option, uses RPZ (Response Policy Zones)

in local zone: response-policy { zone "rpz"; } qname-wait-recurse no; zone "rpz" { type master; file "/etc/bind/db.rpz"; };

file db.rpz: www.msftconnecttest.com IN A 13.107.4.52 www.msftncsi.com IN A 190.46.255.40

190.46.255.40 and 13.107.4.52 are the real IP addresses of each URL. It does not matter that you do not have internet, since coovachilli before login always responds to TCP ports 80 for any IP (not dropped on a Firewall or IPTABLES)

In this way the DNS resolves the hosts and the browser redirects the page.

Windows 10 it works perfect.

For Android devices: connectivitycheck.gstatic.com IN A 216.58.222.163 connectivitycheck.android.com IN A 216.58.222.174 clients1.google.com IN A 216.58.222.174 clients3.google.com IN A 216.58.222.174

I have scrips that check the status of the internet, so when there is no connection it redirects to an "internet temporarily out of service" page. The captive portal also has several interventions according to the needs of my clients.

s13884 commented 5 years ago

@denizerdi Can you help me to configure it without internet? Also does it still sending the login page of coova when no ethernet attached to pi?