Hotspot splashpage / captive portal without auth

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.

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>

Awesome fewi. That should be pretty easy. I’m going to try it out right now.

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 :slight_smile:
noob wanna be

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) ?

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.

Hmmm… thanks for the extra info regarding external RADIUS. That may come in handy down the road for another project.

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&password=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.

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.

Thanks a lot fewi!! Enabling PAP let me right on! :smiley:

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

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.

RB750s come with an L4 license, which means 20 users.

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)?

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?

up…

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>

It doesnt work!

I tried to use the button you provided but… maybe I set something wrong

Hii there,

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

anynone have exsample code?

Tnx for helping