17
Mikrotik User Manager as Radius Server I continue to post about hotspot billing system. Actually I wanted to post about Daloradius. However, because still need more experiments, then I delay for a while. And now I'm posting about the "user manager" of the Mikrotik. What is a user manager? User Manager is a RADIUS server application. It is a separate package for RouterOS. Install User Manager. 1. Check the Mikrotik, whether user-manager existing package. Click the System – Packages.

Mikrotik User Manager as Radius Server

Embed Size (px)

DESCRIPTION

Mikrotik User Manager as Radius Server

Citation preview

Page 1: Mikrotik User Manager as Radius Server

Mikrotik User Manager as Radius Server

I continue to post about hotspot billing system. Actually I wanted to post about Daloradius. However, because still need more experiments, then I delay for a while. And now I'm posting about the "user manager" of the Mikrotik. What is a user manager? User Manager is a RADIUS server application. It is a separate package for RouterOS.

Install User Manager.1.      Check the Mikrotik, whether user-manager existing package. Click the System – Packages.

2.      Download package "user-manager" in www.mikrotik.com / download. Select the package,according to the Mikrotik version you are using. If you are using a Mikrotik with package the old version, you can download the old version of the package in http://files.shelbybb.com/mikrotik/ orhttp://204.62.56.64/mikrotik/

Page 2: Mikrotik User Manager as Radius Server

3.      Open Winbox, then click user-manager.npk package already downloaded, and drag it to the Winbox. File will automatically be uploaded, and can be seen in Winbox - Files list.

4.      Restart.5.      Check back in the Mikrotik, with the opening Winbox, System - Packages. File "user-manager" should be shown.

Mikrotik ConfigurationSee previous post about making mikrotik hotspot.http://myconfigure.blogspot.com/2013/05/configure-mikrotik-as-hotspot_9254.html.  If all is ok, proceed with the following steps. Open winbox, click Radius - then click the plus sign (+) to add. Open dialog box will appear. Enter the IP address of the Radius User Manager, secret, for example : testing123, port, and check the hotspot service. Then click OK. Remember : IP address of Radius Server must IP Wan of router Mikrotik or you can enter IP localhost  (127.0.0.1)

Page 3: Mikrotik User Manager as Radius Server

Back to Radius open dialog. Click Incoming. Check Accept, Port is 1700. Then OK.

Then in the hotspot dialog box, click server profiles tab. Click twice hsprof1. Then the new dialog box will appear. Click radius tab. Select use radius, and accounting. Then click OK.

Page 4: Mikrotik User Manager as Radius Server

Mikrotik User ManagerFinish to configure mikrotik, next open browser, and go to http://<ip-address-mikrotik>/userman. You will find login page user manager of mikrotik, enter default username : admin and blank password. Let’s begin to configure mikrotik user manager. Configure RoutersClick routers – add – New.  In the new dialog box about router details, enter name, IP address, secret, and coa port. Look at example picture.

Configure Customer

Page 5: Mikrotik User Manager as Radius Server

For security, change password admin for login mikrotik user manager. Click customer, admin. And in customer details  box, enter  password, and other information.

Create a user in the "user manager", and then from the client computer browser, login using a user that has been created. If successful redirect and connect to the internet, meaning that the Mikroti User Manager has been successfully configured as a Radius Server.Next, I will explain how to create voucher in User Manager.

How to Create Voucher in Mikrotik User Manager

This post continues the previous post. Make sure you've managed to create a Mikrotik User Manager as Radius Server. In this post, I will explain how make voucher easily. There are 2 types of vouchers are

Page 6: Mikrotik User Manager as Radius Server

often used, first, vouchers that use time limit, and second, vouchers that use quota limit. You will be able to develop, by combining the two types, so get a voucher that uses a time limit and quota limit.

Let's go to make it. This is the plan.

1. Time Voucher 2 hours, price 5,000, expired 10 days from the start of use.

2. Quota Voucher 1 GB, price 3,000, expired 30 days from the start of use.

Login

Open browser, and go to http://<ip-address-mikrotik>/userman. You will find login page Mikrotik User Manager, then enter username and password.

Create Limitation Profiles

Click Profiles – Limitation tab. Click add – New. In Limitation detail box, enter name "1 Giga Bytes", limit download. Other options, you can fill rate limit. Then click add.

Page 7: Mikrotik User Manager as Radius Server

Next, on Limitation tab, click add – New, In Limitation details box, enter another name "2 Hours" and in section Limits, uptime : 120m. then click add.

Create Profiles Voucher

Next, in tab Profiles, click sign plus ( + ), to create profile. Fill name "Time 2 Hours", then click create.

Page 8: Mikrotik User Manager as Radius Server

Continue to fill validity box, price and other option. Then click add new limitation. Look at picture.

Dialog box about Profile part, will be appear. In Limits section, check 2 hours, then click add. Back to tab Profiles, click Save profile

Page 9: Mikrotik User Manager as Radius Server

A profile voucher has been created. Next other profile vouchers, the same steps as before. Click sign plus ( + ), then in create profile, enter name : Quota 1 GB, then click create. Next, enter validity and price. Then click add new limitation.

Dialog box about Profile part, will be appear. In Limits section, check 1 Giga Bytes, then click add. Then save profile.

Page 10: Mikrotik User Manager as Radius Server

Create Users

Click Users – Add – Batch. In user details box, fill numbers of users, username length, etc. Then in assign profile, select Assign profile : Time 2 Hours, which has been made. Then click add. Continue to make another users with the same steps, for Quota 1 GB.

So, you will get many username that already used.

Page 11: Mikrotik User Manager as Radius Server

If you don't see the password, you must configure menu setting. In section of setting, you will find table column, about some menu. Click users, then click password in the hidden column, move to visible column, with click left sign.And for the other menu, you can explore by yourself. Then click save.

Setting Template Voucher

Click Settings – Templates. Select name : Vouchers.

Page 12: Mikrotik User Manager as Radius Server

Copy code below and paste in Header box,

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Vouchers</title> <style> @media print { .noprint { display: none; } .pagebreak { page-break-after: always; } } body { font-family: 'Lucida Grande', 'Helvetica Neue', Helvetica, Arial, sans-serif; padding: 100px; font-size: 13px; } div.box { background: rgb(230,240,163); /* Old browsers */ background: -moz-linear-gradient(-45deg, rgba(230,240,163,1) 0%, rgba(210,230,56,1) 50%, rgba(195,216,37,1) 51%, rgba(219,240,67,1) 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, right bottom, color-stop(0%,rgba(230,240,163,1)), color-stop(50%,rgba(210,230,56,1)), color-stop(51%,rgba(195,216,37,1)), color-stop(100%,rgba(219,240,67,1))); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(-45deg, rgba(230,240,163,1) 0%,rgba(210,230,56,1) 50%,rgba(195,216,37,1) 51%,rgba(219,240,67,1) 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(-45deg, rgba(230,240,163,1) 0%,rgba(210,230,56,1) 50%,rgba(195,216,37,1) 51%,rgba(219,240,67,1) 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(-45deg, rgba(230,240,163,1) 0%,rgba(210,230,56,1) 50%,rgba(195,216,37,1) 51%,rgba(219,240,67,1) 100%); /* IE10+ */ background: linear-gradient(135deg, rgba(230,240,163,1) 0%,rgba(210,230,56,1) 50%,rgba(195,216,37,1) 51%,rgba(219,240,67,1) 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e6f0a3', endColorstr='#dbf043',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */ width: 3.6in; height: 2.1in; padding: 0 17px 18px 12px; margin: 10px 0; border: solid 1px #D9D9D9; border-radius: 10px; -webkit-border-radius: 2px; -moz-border-radius: 2px; } div.box h2 { background: rgb(30,87,153); /* Old browsers */ background: -moz-linear-gradient(top, rgba(30,87,153,1) 0%, rgba(41,137,216,1) 50%, rgba(32,124,202,1) 51%, rgba(125,185,232,1) 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(30,87,153,1)), color-stop(50%,rgba(41,137,216,1)), color-stop(51%,rgba(32,124,202,1)), color-stop(100%,rgba(125,185,232,1))); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, rgba(30,87,153,1) 0%,rgba(41,137,216,1) 50%,rgba(32,124,202,1) 51%,rgba(125,185,232,1) 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, rgba(30,87,153,1) 0%,rgba(41,137,216,1) 50%,rgba(32,124,202,1)

Page 13: Mikrotik User Manager as Radius Server

51%,rgba(125,185,232,1) 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(top, rgba(30,87,153,1) 0%,rgba(41,137,216,1) 50%,rgba(32,124,202,1) 51%,rgba(125,185,232,1) 100%); /* IE10+ */ background: linear-gradient(to bottom, rgba(30,87,153,1) 0%,rgba(41,137,216,1) 50%,rgba(32,124,202,1) 51%,rgba(125,185,232,1) 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#1e5799', endColorstr='#7db9e8',GradientType=0 ); /* IE6-9 */ margin: 0 -17px 1px -12px; padding: 15px 0px 0 10px; height: 20px; border-top-left-radius: 10px; border-top-right-radius: 10px; -webkit-border-radius: 2px; -moz-border-radius: 2px; font: bold 18px/0.2 Arial; color: #fff; text-shadow: red 0.1em 0.1em 0.6em} div.box h3 { background-color: #FFF8DC; border-color: #000; border-style:solid; border-width:1px; margin: -35px 0 0 70px; padding: 12px 50px 3px 10px; height: 8px; width: 30px; font: bold 12px/0 Arial; color: #000; } div.box h4 { background: rgb(174,188,191); /* Old browsers */ background: -moz-linear-gradient(top, rgba(174,188,191,1) 0%, rgba(110,119,116,1) 50%, rgba(10,14,10,1) 51%, rgba(10,8,9,1) 100%); /* FF3.6+ */ background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(174,188,191,1)), color-stop(50%,rgba(110,119,116,1)), color-stop(51%,rgba(10,14,10,1)), color-stop(100%,rgba(10,8,9,1))); /* Chrome,Safari4+ */ background: -webkit-linear-gradient(top, rgba(174,188,191,1) 0%,rgba(110,119,116,1) 50%,rgba(10,14,10,1) 51%,rgba(10,8,9,1) 100%); /* Chrome10+,Safari5.1+ */ background: -o-linear-gradient(top, rgba(174,188,191,1) 0%,rgba(110,119,116,1) 50%,rgba(10,14,10,1) 51%,rgba(10,8,9,1) 100%); /* Opera 11.10+ */ background: -ms-linear-gradient(top, rgba(174,188,191,1) 0%,rgba(110,119,116,1) 50%,rgba(10,14,10,1) 51%,rgba(10,8,9,1) 100%); /* IE10+ */ background: linear-gradient(to bottom, rgba(174,188,191,1) 0%,rgba(110,119,116,1) 50%,rgba(10,14,10,1) 51%,rgba(10,8,9,1) 100%); /* W3C */ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#aebcbf', endColorstr='#0a0809',GradientType=0 ); /* IE6-9 */ margin: 0px -17px 0px -12px; padding: 10px 10px 5px 10px; height: 10px; font: bold 14px/0.2 Arial; color: #fff; text-shadow: white 0.1em 0.1em 0.6em } .txtbox { background-color: transparent; width: 330px; } </style> </head> <body>

And code below, copy and paste in Row box.

<div class="box"> <h2>Hotspot - Internet Card Rs %u_moneyPaid%</h2> <div class="txtbox">Connect to Wireless Network and open you webbrowser. Put the <b>UserName</b> and <b>Password</b> in required field, then <b>click login button.</b></div> <br> <p align="left">UserName:</p> <h3>%u_username%</h3> <p align="left">Password:</p> <h3>%u_password%</h3> <h5 style="margin-top: -70px; margin-left: 230px; font: bold 30px Arial; color: #fff; text-shadow: black 0.1em 0.1em 0.6em;">%u_timeLeft%</h5> <p style="margin-top: -40px; margin-left: 250px;">Price: %u_moneyPaid%</p> <br> <h4>Contact for more info. myconfigure.blogspot.com</h4> </div>

Generate Vouchers

Next, from users list, we generate voucher, that will be printed. Click Users. Check all users, then click Generate - Vouchers.

Page 14: Mikrotik User Manager as Radius Server

The new dialog box will appear, then click generate.

Pop-up browser will be shown. This is the end result of a voucher that will be printed. You can change the code of the template voucher, so you can get a more attractive.

Page 15: Mikrotik User Manager as Radius Server

Try Login From Client Computer

We have finished to create and print voucher. Now from client computer, in login page browser, enter username and password of voucher. It should be correct, and you will be connected to internet.

Look at Hotspot dialog box, click Active tab. Current users will be seen, and there is a sign R, on the left side, meaning the user from radius server.

Page 16: Mikrotik User Manager as Radius Server

And at last, make sure, if time or quota of vouchers has been exceeded, the client computer will automatically disconnect from the internet, and will return to the login page.

Good luck..!!!