Community discussions

MUM Europe 2020
 
ciphercore
Member Candidate
Member Candidate
Topic Author
Posts: 155
Joined: Fri Jan 29, 2010 5:48 pm

Hotspot splashpage / captive portal without auth

Wed May 12, 2010 5:39 pm

I am looking to setup a free access hotspot. I need to have a "landing" page, that every user that connects to the hotspot will be re-directed to when accessing http. It will show info on who is providing the free access and so on.

I have setup a few other hotspots with mikrotik using the userman.
 
fewi
Forum Guru
Forum Guru
Posts: 7734
Joined: Tue Aug 11, 2009 3:19 am

Re: Hotspot splashpage / captive portal without auth

Wed May 12, 2010 5:51 pm

That's much simpler than you think.
First, create a user profile and a local user that is linked to the profile. The below assumes a username of 'username' and a password of 'password'.

Then make the following login.html:
<html>
<head>
<meta http-equiv="refresh" content="0; url=login?username=username&password=password">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body>
</body>
</html>
That login.html is loaded for unauthorized users and usually has the login form, the above instead after 0 seconds causes an automatic redirect (HTTP code 302) to the login servlet of the Hotspot, passing on the correct user credentials and effectively logging the user in.

To cover all possible redirect conditions, create the following redirect.html and logout.html (they both get the same HTML) to in turn redirect to the above login.html:
<html>
<head>
<meta http-equiv="refresh" content="0; url=login.html">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body>
</body>
</html>
After a successful login, alogin.html is loaded for the user. The below assumes that the page you want to show after login resides on an external server. If you want to host it on the router itself, just replace it with the HTML for the final landing screen.
<html>
<head>
<meta http-equiv="refresh" content="0; url=http://my.external.server.com/landingpage.html">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body>
</body>
</html>
 
ciphercore
Member Candidate
Member Candidate
Topic Author
Posts: 155
Joined: Fri Jan 29, 2010 5:48 pm

Re: Hotspot splashpage / captive portal without auth

Wed May 12, 2010 6:15 pm

Awesome fewi. That should be pretty easy. I'm going to try it out right now.
 
someuser
Member Candidate
Member Candidate
Posts: 102
Joined: Tue Apr 13, 2010 7:05 am

Re: Hotspot splashpage / captive portal without auth

Wed May 12, 2010 6:18 pm

Very clearly written fewi, U da man.
I've got same planned scenario as this guy
After struggling through a little html and UserMan... and now... I get it.
Thanks :)
noob wanna be
 
ciphercore
Member Candidate
Member Candidate
Topic Author
Posts: 155
Joined: Fri Jan 29, 2010 5:48 pm

Re: Hotspot splashpage / captive portal without auth

Thu May 13, 2010 9:40 pm

fewi: This works great. Exactly what I was looking for.

I do have another quick question. I will be running a RB750G as the wifi access controller/captive portal. It comes with a L4 License.
Since I am not using userman/radius... this is not considered an "Active User Manager session" (20 in L4 ROS) ?, but falls under "Hotspot Active Users" (200 L4 ROS) ?
 
fewi
Forum Guru
Forum Guru
Posts: 7734
Joined: Tue Aug 11, 2009 3:19 am

Re: Hotspot splashpage / captive portal without auth

Thu May 13, 2010 9:51 pm

That is correct.

Edit: and while User Manager is essentially a RADIUS server, the license level for those sessions is specific to a local install of User Manager and not a general limitation on RADIUS authentication. Meaning that if you were to use a local User Manager you'd have a limit of 20 active sessions, but if you were to use an external RADIUS server (such as FreeRADIUS or even a second device with User Manager) you'd have a limit of 200 active sessions.
 
ciphercore
Member Candidate
Member Candidate
Topic Author
Posts: 155
Joined: Fri Jan 29, 2010 5:48 pm

Re: Hotspot splashpage / captive portal without auth

Thu May 13, 2010 10:04 pm

Hmmm... thanks for the extra info regarding external RADIUS. That may come in handy down the road for another project.
 
wispsupporttech
just joined
Posts: 2
Joined: Wed May 19, 2010 10:44 pm

Re: Hotspot splashpage / captive portal without auth

Wed May 19, 2010 10:53 pm

Thanks for this great information. I have been looking for a simple way to do this. I've implemented this as shown, but when I go to open up my browser (Chrome, Firefox, and IE), it brings up the following url:

http://192.168.4.1/login?username=user& ... d=password
(My user I created has the name user instead of username)

However, the page then starts refreshing over and over very quickly until I stop it. I'm guessing that it's not passing the information correctly to the servlet, but I don't know what I've done wrong. I copied and pasted the code directly and only changed the username variable. I'm just wondering if anyone else had this problem when implementing it.

Thanks.
 
fewi
Forum Guru
Forum Guru
Posts: 7734
Joined: Tue Aug 11, 2009 3:19 am

Re: Hotspot splashpage / captive portal without auth

Thu May 20, 2010 4:15 pm

Make sure you have HTTP PAP enabled on the Hotspot Server Profile (or ideally HTTPS), or change things to support CHAP. I don't use CHAP (I use HTTPS everywhere), so I have no experience with it.
 
wispsupporttech
just joined
Posts: 2
Joined: Wed May 19, 2010 10:44 pm

Re: Hotspot splashpage / captive portal without auth

Thu May 20, 2010 7:03 pm

Thanks a lot fewi!! Enabling PAP let me right on! :D
 
User avatar
Coins
just joined
Posts: 17
Joined: Wed Dec 30, 2009 2:54 pm

Re: Hotspot splashpage / captive portal without auth

Wed May 26, 2010 9:44 pm

Hello Guys;
I have the same problem too. I need to implement my mikrotik to work with my AP which is presently working on Mac Filtering to authenticate clients through Aradial Radius server. I need to get the details from the scratch. This is the idea for the intended setup; The AP is configured to work on Mac Filtering and the clients needs to be authenticated through a login page before being routed to internet. i need your guide to setup a login page i can then modify to contain my logo. After setting up the login html , i also need a guide on how to load the Html file and setup the mikrotik to work effectively with it. Thanks
 
acidu
newbie
Posts: 36
Joined: Wed Jun 02, 2010 6:42 am

Re: Hotspot splashpage / captive portal without auth

Wed Jun 02, 2010 6:47 am

That is correct.

Edit: and while User Manager is essentially a RADIUS server, the license level for those sessions is specific to a local install of User Manager and not a general limitation on RADIUS authentication. Meaning that if you were to use a local User Manager you'd have a limit of 20 active sessions, but if you were to use an external RADIUS server (such as FreeRADIUS or even a second device with User Manager) you'd have a limit of 200 active sessions.

hi, when refering to a secound device to use it as a radius server aka-user manager, that might be even another rb750 with L4 license, to get over that 20 active sesions?
thx

Adrian C.
 
fewi
Forum Guru
Forum Guru
Posts: 7734
Joined: Tue Aug 11, 2009 3:19 am

Re: Hotspot splashpage / captive portal without auth

Thu Jun 03, 2010 3:53 pm

RB750s come with an L4 license, which means 20 users.
 
franhirs
just joined
Posts: 1
Joined: Wed Sep 25, 2013 6:31 pm

Re: Hotspot splashpage / captive portal without auth

Wed Sep 25, 2013 6:35 pm

I have applied your method. It works on the first ime. Subsequent access does not go to the splash page and connects directly. Any clues ?
 
Feklar
Forum Guru
Forum Guru
Posts: 1726
Joined: Tue Dec 01, 2009 11:46 pm

Re: Hotspot splashpage / captive portal without auth

Wed Sep 25, 2013 11:35 pm

I have applied your method. It works on the first ime. Subsequent access does not go to the splash page and connects directly. Any clues ?
Have the guests signed out first (if not try setting the idle timeout), or have you enabled login by cookies (if so, try disabling them)?
 
User avatar
Maggiore81
Member Candidate
Member Candidate
Posts: 242
Joined: Sun Apr 15, 2012 12:10 pm
Location: Italy
Contact:

Re: Hotspot splashpage / captive portal without auth

Sat Feb 15, 2014 6:24 pm

Hello.
I have another idea:

instead than refreshing the page and auto-inserting the username/password combination, can we do a button that (as nodogsplash) clicking on it gives the MT the username/password combination?

So the user reads the page and clicks CONNECT (that login on the network).

Anyone has tested that?
Dott. Elia Spadoni
---
Network Administrator,
MTCNA, MTCRE, MTCTCE, MTCINE, MTCWE
Spadhausen Internet Provider
Ravenna, ITALY
http://www.spadhausen.com
 
User avatar
Maggiore81
Member Candidate
Member Candidate
Posts: 242
Joined: Sun Apr 15, 2012 12:10 pm
Location: Italy
Contact:

Re: Hotspot splashpage / captive portal without auth

Thu Dec 04, 2014 9:12 am

up...
Dott. Elia Spadoni
---
Network Administrator,
MTCNA, MTCRE, MTCTCE, MTCINE, MTCWE
Spadhausen Internet Provider
Ravenna, ITALY
http://www.spadhausen.com
 
Feklar
Forum Guru
Forum Guru
Posts: 1726
Joined: Tue Dec 01, 2009 11:46 pm

Re: Hotspot splashpage / captive portal without auth

Thu Dec 04, 2014 7:46 pm

Yes that works properly. We use that for many of the locations that we support with Hotspots since it removes the fat fingering of people connecting to the network.

Here is some of the HTML to get you started.
<input type="hidden" name="username" value="<NAME>" />
<input type="hidden" name="password" id="password" value="<Password>" />
<button type="submit" class="btn">Connect Now</button>
 
User avatar
Maggiore81
Member Candidate
Member Candidate
Posts: 242
Joined: Sun Apr 15, 2012 12:10 pm
Location: Italy
Contact:

Re: Hotspot splashpage / captive portal without auth

Fri Jan 30, 2015 7:26 pm

It doesnt work!

I tried to use the button you provided but... maybe I set something wrong
Dott. Elia Spadoni
---
Network Administrator,
MTCNA, MTCRE, MTCTCE, MTCINE, MTCWE
Spadhausen Internet Provider
Ravenna, ITALY
http://www.spadhausen.com
 
Lordi
just joined
Posts: 12
Joined: Sat Aug 08, 2015 11:43 am

Re: Hotspot splashpage / captive portal without auth

Sun Sep 20, 2015 6:23 pm

Hii there,

old thread but the button solutions is what i need now.

anynone have exsample code?

Tnx for helping
 
ALX1S
newbie
Posts: 40
Joined: Mon Apr 27, 2015 5:28 pm
Location: Buenos Aires, Argentina

Re: Hotspot splashpage / captive portal without auth

Tue Dec 29, 2015 4:40 pm

Hi, I made exactly what you told, but when I try to go to some page, start loading over and over again the page " head.log.net/login?username=username&password=password ".

Im running a rb433 with 6.32.2 and wondering to use with capsman (capsman is running with 3 ssid without any issue)

One of this SSID will be the hotspot (for guests)

Could you give me some advice, please.

Thanks.
That's much simpler than you think.
First, create a user profile and a local user that is linked to the profile. The below assumes a username of 'username' and a password of 'password'.

Then make the following login.html:
<html>
<head>
<meta http-equiv="refresh" content="0; url=login?username=username&password=password">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body>
</body>
</html>
That login.html is loaded for unauthorized users and usually has the login form, the above instead after 0 seconds causes an automatic redirect (HTTP code 302) to the login servlet of the Hotspot, passing on the correct user credentials and effectively logging the user in.

To cover all possible redirect conditions, create the following redirect.html and logout.html (they both get the same HTML) to in turn redirect to the above login.html:
<html>
<head>
<meta http-equiv="refresh" content="0; url=login.html">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body>
</body>
</html>
After a successful login, alogin.html is loaded for the user. The below assumes that the page you want to show after login resides on an external server. If you want to host it on the router itself, just replace it with the HTML for the final landing screen.
<html>
<head>
<meta http-equiv="refresh" content="0; url=http://my.external.server.com/landingpage.html">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body>
</body>
</html>
 
Feklar
Forum Guru
Forum Guru
Posts: 1726
Joined: Tue Dec 01, 2009 11:46 pm

Re: Hotspot splashpage / captive portal without auth

Wed Dec 30, 2015 10:12 pm

Do you have the external URL added to the walled garden of the hotspot?
 
ClaudioJunior10
just joined
Posts: 15
Joined: Mon Jan 23, 2017 2:38 pm

Re: Hotspot splashpage / captive portal without auth

Wed Jan 25, 2017 7:30 pm

Good afternoon Mikrotik
I made the hotspot confirmations in mikrotik and when I test in my notebook or computer the redirect works perfectly. The page that I set opens, but when I log in and connect through the mobile menu the page I defined as redirect does not open.
How can I solve this problem? I've read the documentation and did tests, but it still does not work.
I need this to work urgently.
Thank you
 
User avatar
ErfanDL
Member Candidate
Member Candidate
Posts: 298
Joined: Thu Sep 29, 2016 9:13 am
Location: IRAN
Contact:

Re: RE: Re: Hotspot splashpage / captive portal without auth

Wed Jan 25, 2017 7:47 pm

Good afternoon Mikrotik
I made the hotspot confirmations in mikrotik and when I test in my notebook or computer the redirect works perfectly. The page that I set opens, but when I log in and connect through the mobile menu the page I defined as redirect does not open.
How can I solve this problem? I've read the documentation and did tests, but it still does not work.
I need this to work urgently.
Thank you
Hi
test it in android or ios?
 
ClaudioJunior10
just joined
Posts: 15
Joined: Mon Jan 23, 2017 2:38 pm

Re: RE: Re: Hotspot splashpage / captive portal without auth

Thu Jan 26, 2017 4:45 am

Good afternoon Mikrotik
I made the hotspot confirmations in mikrotik and when I test in my notebook or computer the redirect works perfectly. The page that I set opens, but when I log in and connect through the mobile menu the page I defined as redirect does not open.
How can I solve this problem? I've read the documentation and did tests, but it still does not work.
I need this to work urgently.
Thank you
Hi
test it in android or ios?
android my friend.
KNOW HOW TO HELP ME?
 
User avatar
ErfanDL
Member Candidate
Member Candidate
Posts: 298
Joined: Thu Sep 29, 2016 9:13 am
Location: IRAN
Contact:

Re: RE: Re: RE: Re: Hotspot splashpage / captive portal without auth

Thu Jan 26, 2017 12:26 pm

Good afternoon Mikrotik
I made the hotspot confirmations in mikrotik and when I test in my notebook or computer the redirect works perfectly. The page that I set opens, but when I log in and connect through the mobile menu the page I defined as redirect does not open.
How can I solve this problem? I've read the documentation and did tests, but it still does not work.
I need this to work urgently.
Thank you
Hi
test it in android or ios?
android my friend.
KNOW HOW TO HELP ME?
Rename the hotspot dns name to hotspot.pt
 
ClaudioJunior10
just joined
Posts: 15
Joined: Mon Jan 23, 2017 2:38 pm

Re: RE: Re: RE: Re: Hotspot splashpage / captive portal without auth

Thu Jan 26, 2017 1:13 pm

Good afternoon Mikrotik
I made the hotspot confirmations in mikrotik and when I test in my notebook or computer the redirect works perfectly. The page that I set opens, but when I log in and connect through the mobile menu the page I defined as redirect does not open.
How can I solve this problem? I've read the documentation and did tests, but it still does not work.
I need this to work urgently.
Thank you
Hi
test it in android or ios?
android my friend.
KNOW HOW TO HELP ME?
Rename the hotspot dns name to hotspot.pt
I'll do it, my friend. thanks for listening
 
User avatar
ErfanDL
Member Candidate
Member Candidate
Posts: 298
Joined: Thu Sep 29, 2016 9:13 am
Location: IRAN
Contact:

Re: RE: Re: RE: Re: RE: Re: Hotspot splashpage / captive portal without auth

Thu Jan 26, 2017 1:15 pm

Good afternoon Mikrotik
I made the hotspot confirmations in mikrotik and when I test in my notebook or computer the redirect works perfectly. The page that I set opens, but when I log in and connect through the mobile menu the page I defined as redirect does not open.
How can I solve this problem? I've read the documentation and did tests, but it still does not work.
I need this to work urgently.
Thank you
Hi
test it in android or ios?
android my friend.
KNOW HOW TO HELP ME?
Rename the hotspot dns name to hotspot.pt
I'll do it, my friend. thanks for listening
Your welcome. Is your problem solved?
 
ClaudioJunior10
just joined
Posts: 15
Joined: Mon Jan 23, 2017 2:38 pm

Re: RE: Re: RE: Re: RE: Re: Hotspot splashpage / captive portal without auth

Fri Jan 27, 2017 2:22 pm

Hi
test it in android or ios?
android my friend.
KNOW HOW TO HELP ME?
Rename the hotspot dns name to hotspot.pt
I'll do it, my friend. thanks for listening
Your welcome. Is your problem solved?
Hello, unfortunately not
I configured my mikrotik as follows: I connected a LAN, a wired interface and a wireless one. Then I enabled a bridge by putting the wired and wireless interface. I have enabled DHCP Client and DHCP Server and NAT.
After that I enabled the hotspot by placing the bridge inside it, a default setting.
I edited login.html and alogin.html to redirect to a site initially as a test, but in the final project I want to redirect to a page I am developing on my local machine, in localhost.
The redirect of the hotspot on my computer works perfectly for both the web page and the page I am developing, but on my phone it opens the hotspot login, redirects, "loads and displays 2 seconds and returns to the wifi settings of the cell phone , Confirming that the network has been connected.
Any doubts I am available.
 
ClaudioJunior10
just joined
Posts: 15
Joined: Mon Jan 23, 2017 2:38 pm

Re: Hotspot splashpage / captive portal without auth

Sun Jan 29, 2017 2:16 am

I configured my mikrotik as follows: I connected a LAN, a wired interface and a wireless one. Then I enabled a bridge by putting the wired and wireless interface. I have enabled DHCP Client and DHCP Server and NAT.
After that I enabled the hotspot by placing the bridge inside it, a default setting.
I edited login.html and alogin.html to redirect to a site initially as a test, but in the final project I want to redirect to a page I am developing on my local machine, in localhost.
The redirect of the hotspot on my computer works perfectly for both the web page and the page I am developing, but on my phone it opens the hotspot login, redirects, "loads and displays 2 seconds and returns to the wifi settings of the cell phone , Confirming that the network has been connected.
Any doubts I am available.

Who is online

Users browsing this forum: No registered users and 55 guests