Community discussions

MikroTik App
 
User avatar
CyB3RMX
Member Candidate
Member Candidate
Topic Author
Posts: 148
Joined: Thu May 26, 2011 7:08 am

Offline Hotspot.

Sat Jan 25, 2020 9:16 am

Hi all.
I am trying to do like a information hotspot, but the router is not going to be connected on the internet.
What i'm trying to achieve is:

- The user connects to the Wifi,
- The captive portal intercept all traffic and Popup login page
- The page wont have any Login form, only info about schedule and some activities on a simple http web page.
- This will be oriented to mobile devices such as Phones and Tablets, but mostly phones.

The Issue:
Everything is working fine when i have a dhcp-client and the router is connected to the Internet.
If i remove internet connection, and then try to connect to the Hotspot, it wont popup any page, it only works if i open the browser and i write whatever i put on the server-profile ->dns name
if i give internet Connection to the router, everything works again.


What i have tried, i have tried this: viewtopic.php?f=2&t=86552&p=647763#p647763 without any luck.
I try to add the DNS redirection with the RegExp .* to the mikrotik IP address, but when i try to connect with my iphone, it popups a window but immediately sends an error that says something like: "too many redirects ocurrred".

one thing i dont understand, is that if you are not logged, and the browser needs to resolve to check ifs there connection, (some say this is the cause the hotspot page wont popup), how can it check it if you are not logged in yet?..

Please help, im loosing my mind here, in short, everything works as expected when Internet Is on.. but if there is not internet at all in the router, the page wont popup..
Im using rOS 6.46.2 on a RB951Ui-2HnD
Thanks In advance.

JB
 
reinerotto
Long time Member
Long time Member
Posts: 523
Joined: Thu Dec 04, 2008 2:35 am

Re: Offline Hotspot.

Sun Jan 26, 2020 2:32 pm

>the browser needs to resolve to check ifs there connection< AFAIK, this is done trying DNS. In standard hotspots, DNS works.
You should do detailed analysis, whats going on between browser and router. I.e. using tcp-dump.
Be warned, that "Captive Portal Detection" is similar for Andoid and iOS, but not identical. And it differs between versions, at least for Android.
As I did an offline hotspot in the past myself, but not on MT, but on openwrt, because more tricks possible, cause open source.

_May be_, on newer iOS, CP-detection relies on https. Which would make your task even more demanding.
 
Sob
Forum Guru
Forum Guru
Posts: 9188
Joined: Mon Apr 20, 2009 9:11 pm

Re: Offline Hotspot.

Sun Jan 26, 2020 5:50 pm

I try to add the DNS redirection with the RegExp .* to the mikrotik IP address, ...
I don't know it it's that, but I'd try some other address. It will be redirected anyway. And it will be clear that original connection wasn't to router.

Edit: It's not good either, because it also affects hotspot's hostname. Even if I add static record for that, the regexp entry overrides it.

Edit2: It's possible to have selected hostname with different address, if it's before the catch-all entry also as regexp, e.g.:
/ip dns static
add address=192.168.88.1 regexp="^hotspot\\.mydomain\\.tld\$" ttl=5s
add address=1.1.1.1 regexp=.* ttl=5s
 
delhite2
just joined
Posts: 13
Joined: Fri May 10, 2019 4:45 pm

Re: Offline Hotspot.

Wed Oct 14, 2020 9:26 am

viewtopic.php?p=822430#p822430
Works for offline hotspot!

Sent from my LYA-L29 using Tapatalk

Who is online

Users browsing this forum: divlamir, Maknz and 29 guests