Mikrotik + external radius server problem

hi

I am using RouterOS 2.9.27 hotspot but recently i am added external radius server. my problem is mikrotik was not redirecting to external radius login page. i am testing on same OS using PPPOE with radius server its working fine only hotspot not working. I change the all version like 3.20 and 4.11 also but same problem. I think the problem is on Routeros radius setting.

This is my settings





hi


Problem is mikrotik not redirecting to external radius server login page. its getting mikrotik hotspot default login page. any changes required on hotspot login.html page.

I would not use V2.9.27. You should upgrade to a more current version.
If you are using V3.x or V4.x, this doc should help. Halfway down the page is the instructions on setting up a remote login page.
http://wiki.mikrotik.com/wiki/Manual:Customizing_Hotspot

hi


i am change the login.html script like this

... \ \ \ after this changes every request goes to radius client login page only. not was not working... throught this radius client logged in succesful but radius server not opening request in mikrotik server for that reasion i am not getting internet. what is the problem????

You are not sending any of the data required for the login. You should pass all the variables to the external login page. Then you will need to use those on the external page to pass to the hotspot login page. Here is the correct code from the manual.

<html>
<title>...</title>
<body>
<form name="redirect" action="https://auth.example.com/login.php" method="post">
<input type="hidden" name="mac" value="$(mac)">
<input type="hidden" name="ip" value="$(ip)">
<input type="hidden" name="username" value="$(username)">
<input type="hidden" name="link-login" value="$(link-login)">
<input type="hidden" name="link-orig" value="$(link-orig)">
<input type="hidden" name="error" value="$(error)">
</form>
<script language="JavaScript">
<!--
	document.redirect.submit();
//-->
</script>
</body>
</html>

I am change login.html

\

... \ \ after changing this redirecting to radius server login page and logins successful but internet not working . whatever site i will open all request going to radius server client login page only

l also looking for the same solution.
when it redirect to the external server and l try login in .
l get not found
the requested URL /hotspot/$(link-login-only)was not found on these server.

then the url will change to
https://dwu.newse.com/hotspot/$(link-login-only)
What am l doing worry.
Any help will be appreciated.
Rainmaker.

Login.html is

...

Can Any body share thier working files with me.
thanks

Are you getting the variables with the login.php code? You need to put all those variables on the login.php page, just like they are in the router. That is why they are sent to the new login.php page as a form request. It needs to look just like the page that used to be in the router, including the md5.js call to encrypt the password.

If you tell me why you are using an external login page, maybe I can be of more help.

@rainmaker: You are not replacing the variable names with the value on the external page. When your web browser submits that form to the external login.php, those variables will be replaced with the correct values. It will not say $(link-login), it will have the url of the router hotspot login routine there.

I think you should take a look at the source code for the original login.html code. Replace the original login.html code, and try to login. When you get the login page, view the page source. You will notice there are no more $(xxx). They are all replaced with the correct values on the page by the router before sending the page to your web browser.

And you can’t use login.html document on the external server. It must be a dynamic document type, like login.php.

Dear SurferTim
Please l will like to use external server in order to use the login page to provide profession information to visitor.
With mikrotik in built web server most of the web application will not run on.

l tried what you direct but is not working.
Here is what l did
l copied the hotspot folder to the Apache server WWW folder.
edit the login file with the codes u provide and direct it to the hotspot folder(server/hotspot/login.html) on Apache.

Please can you send me step that l should go through to get the working.
Thanks
Regards
Rainmaker

Change that to /server/hotspot/login.php. Insure you can access it from the router hotspot. You will need to bypass the hotspot for your server.
/ip hotspot walled-garden
add dst-host=www.yourserver.com

Insure you have the Apache php extensions installed on your server. I must leave for an hour or so. When I get back, and someone else has not helped you, I will see what I can do about a demo login.php doc. I’m not promising anything tho. I do have a business to run. :smiley:

You might want to look at the wiki (User Manual link at the top of this page), both by MikroTik and users. There may already be examples there for you. I haven’t looked lately.

l used dream weaver to change the login.html to login.php
l then put the login.php to my Apache server.
l get the redirection to the login page on the server but can’t login.
Will be looking forward to any help u can offer.
Thanks in Advance.
Rainmaker

Save this in your server as login.php. It is the start of what you will need. I will apologize in advance for any typos or errors.

<?php
	$mac=$_POST['mac'];
	$ip=$_POST['ip'];
	$username=$_POST['username'];
	$linklogin=$_POST['link-login'];
	$linkorig=$_POST['link-orig'];
	$error=$_POST['error'];
?>
<html>
<body>
<h2>Login.php Test</h2>
Mac: <?php echo $mac; ?><br>
IP: <?php echo $ip; ?><br>
Username: <?php echo $username; ?><br>
Link-login: <?php echo $linklogin; ?><br>
Link-orig: <?php echo $linkorig; ?><br>
Error: <?php echo $error; ?><br>
</body>
</html>

If you decide as fewi suggested in the other post (meta GET), change $_POST to $_GET in the php code above.

This only displays the variables you are sending from the original (edit: the self-submitting form) login.html on the router. You will need to construct your login.php page by replacing $(xxx) with <?php echo $xxx; ?>.

You may need to change the file permissions to ‘execute’ on login.php file on your server.

ADD: And don’t let this very short sample of a bunch of variables available on the router limit you. If you look at each end of the code, it should be easy to see what is happening. If you want more here, add them on the other end in the form as a hidden input, and pick them up here. :smiley:

hi


My problem is still not solved please tell me…

Where does it fail? Does the logintest.php work ok? Does it show something for mac and ip? This wiki is the default login.html page converted to login.php. Did you follow the instructions?
http://wiki.mikrotik.com/wiki/HotSpot_external_login_page

BTW, I have made some changes to that wiki today.

upgrade to a licensed version