Community discussions

MikroTik App
 
User avatar
hecklertm
Member Candidate
Member Candidate
Topic Author
Posts: 165
Joined: Fri Jun 24, 2005 5:12 am
Location: US

Uplink down won't allow redirection to hotspot login.html

Thu Jun 01, 2006 7:43 am

I have run into an perplexing problem, and I am interested to know if anyone can think of a way around it.

I have a script which makes the router use a different hotspot "html-directory" to serve the login.html page if it has detected that the uplink to the Internet is down. The purpose for this is so that the login.html page that appears for users trying to login, while the uplink is down, will see on a page saying that the router knows that the Internet is currently unavailable and tells them that once it is back up, they will be able to get online. Once the uplink comes back up, the script then sets the "html-directory" back to the normal location which will provide them the login.html which can let them in.

Okay. The problem is that since the DNS servers are out on the Internet, if the uplink is down, the wireless client therefore cannot resolve DNS and their web browser times out trying to reach their original homepage ($link-orig) destination before the router will attempt to redirect them to the hotspot login page as it does normally for a user who is not logged in. I know this becuase if I try to go to a webpage by IP address instead, the web browser immediately redirects to the login.html as it is supposed to. I suppose DNS queries are allowed for users who are not authenticated for walled-garden purposes and for this sequence of login events. If it did not allow the DNS queries, users would never get redirected to the login page ever.

What I am wondering, is if anyone can think of a way to get the router to redirect the user to the login.html BEFORE it tries to query DNS to deliver them to the $(link-orig) as it always does before shipping them to the login.html page since they are not logged in yet?

I am stumped. Obviously, it is not the first time :P
 
User avatar
hecklertm
Member Candidate
Member Candidate
Topic Author
Posts: 165
Joined: Fri Jun 24, 2005 5:12 am
Location: US

Mon Jun 12, 2006 7:49 pm

Can the MT guys respond to whether there is a way around this? I have heard no response for 2 weeks.. Please advise. Thanks
 
jarosoup
Long time Member
Long time Member
Posts: 596
Joined: Sun Aug 22, 2004 9:02 am

Mon Jun 12, 2006 8:55 pm

I too have always wanted a fix for this...somthing along the lines of a page that loads when the main connection is down that says "Internet down, don't panic!". I have not figured out any graceful way of handling this yet...but perhaps we can figure something out. Like you've found, the trick is faking out the dns and the redirect.
 
cmit
Forum Guru
Forum Guru
Posts: 1547
Joined: Fri May 28, 2004 12:49 pm
Location: Germany

Tue Jun 13, 2006 10:03 am

I once was tempted to try the following (but never actually did):

You COULD run a local DNS server that answers EVERY request with a dedicated ip address, may be the one of your hotspot. I'm quite sure it shouldn't be to hard to get this part running.

Then the script detecting your uplink is down and swapping out the html pages only would have to change the used dns server(s), too.

Anybody wanting to give it a try?

Best regards,
Christian Meis
 
User avatar
hecklertm
Member Candidate
Member Candidate
Topic Author
Posts: 165
Joined: Fri Jun 24, 2005 5:12 am
Location: US

Tue Jun 13, 2006 10:36 am

That would most likely work. The only problem is that I have many hotspots, and it would require deploying seperate equipment at each hotspot to run DNS, unless you know of a way for me to set a static DNS entry in the router which can act as a wildcard DNS record....
 
cmit
Forum Guru
Forum Guru
Posts: 1547
Joined: Fri May 28, 2004 12:49 pm
Location: Germany

Tue Jun 13, 2006 10:49 am

Unfortunately I don't think you can get RouterOS to do this.
Having to place a separate box at each location would be the cost of it, but clearly the only way, as it has to be available when you're offline.

On the other hand something like a RB230/RB500/LinkSys WRT54G whatever would probably suffice for that for even larger installs...

Best regards,
Christian Meis
 
User avatar
hecklertm
Member Candidate
Member Candidate
Topic Author
Posts: 165
Joined: Fri Jun 24, 2005 5:12 am
Location: US

Tue Jun 13, 2006 7:08 pm

Thanks for the idea, but I thought of putting a local DNS server before I posted.

Maybe the MT guys can respond whether they are wililng to look for a way to change the way the router handles redirects when no DNS is available.

Who is online

Users browsing this forum: Ahrefs [Bot], Bing [Bot], mkx, rizkirinaldisyamsuri and 26 guests