[SOLVED] Offline Captive Portal

Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking
Author Message
tc655
DD-WRT Novice


Joined: 31 Aug 2014
Posts: 4

PostPosted: Sun Aug 31, 2014 2:48    Post subject: [SOLVED] Offline Captive Portal Reply with quote
I want to set up a captive portal on my router that won't be connected to the internet for a display at my city's upcoming Maker Faire.

I am running dd-wrt.v24-16785_NEWD-2_K2.6_mini_hotspot on a Linksys E1000 V2. I am able connect to it through SSH and UART (because I bricked it a few times).

My goal is to have a splash screen hosted on a Raspberry Pi pop up when people connect to the wifi network. It has buttons that allow people to control what I am displaying. The splash screen works perfectly, and can be found on the network at http://192.168.1.134/index.php.

I have tried using NoCatSplash, but it requires internet and have looked into using WifiDog and ChilliSpot but I think they need internet as well.

I have also tried the following DNSMasq options, but it only redirects to the splash page if you navigate to an address not in the phone's DNS, and doesn't pop up automatically upon connection (like a captive portal):

Code:

expand-hosts
address=/#/192.138.1.134


My understanding is that in order to know when to pop up the splash page, devices try to connect to certain servers whenever they connect to a wifi network. If they see that it is blocked, then the device knows that authentication is needed and opens a browser to show the splash page.

I have no idea what to do at this point, and was wondering if anyone might know a solution?


Last edited by tc655 on Tue Apr 12, 2016 19:20; edited 1 time in total
Sponsor
tc655
DD-WRT Novice


Joined: 31 Aug 2014
Posts: 4

PostPosted: Tue Apr 12, 2016 19:17    Post subject: Reply with quote
Sorry to resurrect a very dead post, but a user PM'd me for my solution:

I was able to solve this problem and get the captive portal working using NoCatSplash by assigning the router a made-up static WAN IP address. As soon as I did this, the captive portal would work offline no problem.
jpscolar
DD-WRT Novice


Joined: 06 Apr 2016
Posts: 4

PostPosted: Wed Apr 13, 2016 3:40    Post subject: Re: Captive Portal Redirection Reply with quote
tc655,

Thank you very much for your help. It is not working yet, probably I'm doing something wrong. Would you mind looking at these conf files and advise any corrections? Thank you very much for your help & time
tc655
DD-WRT Novice


Joined: 31 Aug 2014
Posts: 4

PostPosted: Wed Apr 13, 2016 6:47    Post subject: Reply with quote
You might be missing a made-up gateway IP address on your WAN.

I also think your DNSMasq wildcard (#) has to go to an unreachable IP address (I used 123.123.123.123) so that your client doesn't receive anything when it tests for Internet.

I have taken screenshots of most of my DD-WRT settings and posted them in this Imgur album for you to compare:

https://imgur.com/a/K2aCW

Most of the settings will be irrelevant.

Note that I used a cifs on the Raspberry Pi to host some of the files related to the captive portal. I believe it was a page containing a basic HTML redirect to the Raspberry Pi's IP address, where the actual content was hosted. This was because the router didn't have enough space left.

Homepage redirection might work for you, but I'm not sure.

Sorry I can't be more specific, it's been nearly two years since I set this up. Hope this helps!
jpscolar
DD-WRT Novice


Joined: 06 Apr 2016
Posts: 4

PostPosted: Fri Apr 15, 2016 2:41    Post subject: Re: Offline Captive Portal - No Internet connection Reply with quote
tc655,

Thank you for the pictures. I have trace the problem to Scheduled (Nocat splash) not starting. It complains that there is nothing on the WAN port, even though I have assigned it a dummy IP address (see the messages below from syslog).

Jan 1 02:16:09 OEHotspot daemon.notice NoCat[25436]: splashd start
Jan 1 02:16:09 OEHotspot daemon.err NoCat[25436]: No ExternalDevice detected!

I have see several postings claiming that is possible to build an OFFLINE Captive portal so I guess is possible, to get around the above problem. Hope someone could share some advice on this.
tc655
DD-WRT Novice


Joined: 31 Aug 2014
Posts: 4

PostPosted: Fri Apr 15, 2016 3:40    Post subject: Reply with quote
Could you maybe try playing with the ExternalDevice setting in your nocat.conf? Perhaps try setting it to eth0 (although this may not exist if you are offline) or the loopback device, lo (in an attempt to trick it).

The error you are seeing is being generated here after it fails to automatically detect the network device here.

I am assuming that this version of the NoCatSplash source code is similar enough to the one you are running. You may want to poke around more to see what other ways you can trick it.

Maybe look into setting up a dummy interface (scroll to bottom) on the router.
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> Advanced Networking All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum