Configuring Mikrotik gateway

Purpose of this document

  • This document should be used in conjunction with Mikrotik user guide for configuring your Mikrotik gateways in WiFiLAN. Please refer to WiFiLAN administrator guide and Mikrotik user guide for detail information.
  • It assumes that the user has basic knowledge of networking including configuring subnet mask, RADIUS setting, default gateway and DNS configuration.
  • In order to configure Mikrotik you will need a static IP address, Subnet mask, default gateway and DNS information given to you by your Internet Service Provider. Please keep this information handy while setting up your gateway.
  • Configuring WiFiLan you will need the WAN public IP address, AP MAC address, RADIUS secret, serial number and public IP address of your Mikrotik gateway.
  • You need an active WiFiLan account. Please contact Wifi-soft sales to create your WiFiLan account.

 

WiFiLan Setup

Add Hotspot:

  1. Open a web browser and type http://w1.wifi-soft.net/wifilan/ and press Enter. Welcome screen of WiFiLan appears.
  2. Click the Hotspot link under Authentication section.
  3. Click the Add New Hotspot tab. The New Hotspot page appears.

Fields and Buttons

Description

Hotspot Plan

Select the plan for the hotspot based on number of concurrent users.

Hotspot Name

Enter the name of the hotspot in the Hotspot Name field.

Address

Enter the address of the location in the Address field.

City

Enter the name of the city of the location in the City field.

State

Select the name of the state from the State drop down list.

Zip Code

Enter the zip code of the location in the Zip Code field.

Latitude

Enter the Latitude of the location in the Latitude field.

Longitude

Enter the Longitude of the location in the Longitude field.

Type

Select the type of location from the Type drop down menu.

Is Paid

Click Is Paid check box if the location is charged.

Auto MAC Register

Select Auto MAC Register check box to enable the auto login feature in WiFiLan.

Submit

Click Submit button to save the changes.


Then, enter the details of the gateway

Fields & Buttons

Description

Device Type

Select Mikrotik from the Device Type drop down menu.

Public IP Address

Enter Public IP Address of the gateway in the IP Address field. If your broadband connection is having a dynamic IP, please enter the current IP address. WiFiLAN will work even when the IP address changes. In this case, WiFiLAN uses the MAC address or NAS ID of the router to validate the packet.

If you don't know the public IP, connect to your modem and type http://www.whatismyip.org. It will display your current public IP address.

Secret

Enter the RADIUS secret configured in the gateway in the Secret field.

NAS ID

Enter an Unique NAS Identifier for the device in the NAS ID field.

MAC Address

Enter the MAC address of the WAN port in the MAC Address field.

Description

Enter a short description for the device

Once the hotspot is added, WiFiLAN will be ready to start accepting AAA requests from the gateway/controller. When the hotspot is added, WiFiLAN will automatically add a user group for that hotspot. The space in the hotspot name is replaced with underscore for the user group name.

Now you will need to design a captive portal for your hotspot and generate a URL that can be configured in the gateway/controller's settings.

Please refer to the captive portal design guide for steps to design your custom captive portal.

 

Mikrotik Setup

It is assumed that you have properly connected your Mikrotik gateway with broadband connection that has a static public IP address. Your Mikrotik gateway admin interface is accessible either via LAN interface or via public WAN interface.

You need WinBox executable to access the complete Mikrotik configuration.

  1. Download Winbox from Mikrotik website, or use the link provided on the web login page of your Mikrotik gateway.

  2. Enter corresponding IP Address in the Connect to field.

  3. Enter the Login name in Login field.

  4. Enter Password in the Password field.

  5. Select all the check boxes.

  6. Click Connect button.

Mikrotik Winbox welcome appears.

Configure Hotspot

Click Hotspot option under IP link (in the left pane).

Hotspot popup window will appear. Click Hotspot Setup button.

Hotspot Setup pop up appears.

  1. Select hotspot interface to run hotspot from Hotspot Interface drop down menu (Ethernet or Bridge port). All your WiFi network should be connected to this port Click Next.
  2. Enter hotspot address for the interface in Local Address of Network Click Next.
  3. Enter the pool address for hotspot in Address Pool of Network Click Next.
  4. Select hotspot SSL certificate from Select Certificate drop down menu. Click Next.
  5. Enter SMTP server IP address in IP Address of SMTP Server Click Next.
  6. Enter DNS configuration in DNS Servers Click Next.
  7. Enter DNS name of local hotspot server in DNS Name field. Click Next. You will receive a message Setup has completed successfully.

Radius Server configuration

  1. Click the Radius link (in the left pane). New Radius Server pop up window appears.

  2. In General tab, select the hotspot check box.

  3. Enter the RADIUS server IP address in the Address field. Default : 166.78.136.12. Please note that if you have separate instance, the IP will be different.

  4. Enter secret in the Secret field. The secret should match the secret in WiFiLan.

  5. Enter Authentication port number as 1812 in Authentication Port field.

  6. Enter Accounting port number as 1813 in Accounting Port field.

  7. Enter timeout as 10000 in the Timeout field.

  8. Click Apply button.

Server Profiles

  1. Click Server Profiles under Hotspot. Click + in the left corner. New Hotspot Server Profile pop up appears.

  2. Enter DNS name for hotspot in General tab.

  3. Enter the IP address of your Mikrotik gateway in the Hotspot Address field.

  4. Click OK button.

Click Login tab

  1. Select the HTTP PAAP check box.
  2. Select Cookie check box.
  3. Click OK.

Click RADIUS tab

  1. Click Use RADIUS check box.
  2. Select the MAC Format from the MAC Format drop down menu which will be separated by -.
  3. Click OK button.

 

Wall Garden links for your hotspot

To add Wall Garden links

  1. Click the Wall Garden tab.

  2. Click the + button in the top left corner.

  3. Enter the Wall Garden URL in the Host field. You can enter as many Wall Garden links to your hotspot.Add the following URLs to the wall garden links under Dst Host field -

w1.wifi-soft.com

wp1.wifi-soft.com

www.wifi-soft.com

 

4. Click Apply button, and click OK.

 

Changing NAS ID

Next you need to change the NAS ID for the Mikrotik to match the NAS ID for the hotspot. To change the NAS ID for Mikrotik -

1. Go to System -> Identity section in Mikrotik.

2. Copy the WiFiLAN Hotspot NAS ID and paste it in the text field.

nasid.png 

Editing login.html

Next you need to edit the login.html file and put the code for redirection to an external captive portal (login page). 

To edit login.html,

1. Go to Files section in the left menu. You will see the list of files in the right window.

files.png

2. Select the file login.html and drag the file on your windows desktop or folder.

3. login.html will be saved on your local computer.

4. Edit the file and replace all the content of the file with the html source below.

<html>
<head>
<title>Please wait...</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="-1">
</head>
<body>
<form name="redirect"
action="http://captive-portal-url"
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-only)">
<input type="hidden" name="link-orig" value="http://welcome-page-url">
<input type="hidden" name="error" value="$(error)">
</form>
<script language="JavaScript">
<!--
document.redirect.submit();
//-->
</script>
</body>
</html>

Note: Please replace the highlighted text with the captive portal URL and  welcome URL specific to your hotspot.

5. Save the changes and drag the edited file back into the files section. Please upload it on the same file.

6. To make sure that the file is correctly uploaded, check the size of the file. It should change.

7. If you connect to hotspot, you should get the captive-portal-url you have specified in the code above. 

Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.