Mikrotik Integration

This guide will Assist you in preparing your Mikrotik  Devices for Social Guest Access capabilities.

Initial configuration requirements

The configuration can be applied on MikroTik RouterBOARD devices with default settings [as an out-of-the-box unit, or after factory reset has been performed]

If the MikroTik device has custom setup, the guide assumes that MikroTik device is already configured with:

  • DHCP client (or IP address, gateway and DNS IP addresses) on WAN interface
  • NAT (masquerade) on WAN interface
  • IP address and DHCP server on interface that will be used as the Hotspot
  • There is no Hotspot configuration on the device already
Retrieve the MAC address of your device

The MAC address of MikroTik device can be obtained in 2 ways:

  •  Read the first MAC address from the label on the box or on MikroTik device case:

OR

Access the MikroTik device using WinBox, and:

  • Open Interfaces menu
  • Go to Interface tab
  • Double click ether1 interface
  • Go to General tab
  •  Copy the MAC Address
MyWiFi Setup:

Login Into the MyWifi Control Panel with your credentials

Pre-Setup:

  • In the MyWiFi Control Panel, create/select an appropriate Social WiFi Campaign with the Social Media Logins and customized look of your choice.
  • Create/Use an Existing Location for your Installation & Assign your created Campaign as the Default Campaign for this Location.

Once you have completed those actions you can add the Mikrotik Device in the MyWiFi System.

  • Click on Devices >> Add New Device to bring up the Add New Device view

Add your new Device:

  • Enter Name of your choice for this Device
  • Select Mikrotik from the Select Router Type
  • Select the Location you have created for this installation
  • Enter the MAC address of your device that you collected above on Step 2
  • Click NEXT > once you have entered the appropriate information correctly

  • You are prompted to confirm the information & selections you entered
  • Save the custom NasID you are provided on Step 2 (you will require this later
  • Click Confirm Setup to finalize the Device setup

Edit the configuration file

Click Here to download the Mikrotik Configuration File Package 

Unzip the package.

In the unzipped folder “mikrotik-files”, open the config.txt file with a text editor, and edit it:

  • Replace YOUR_INTERFACE_NAME placeholder with the name of the interface that the Hotspot will be running on (in the default configuration of MikroTik devices, this interface is named bridge).
  • Replace YOUR_NAS_ID placeholder with the NasID of the MikroTik device you retrieved from the MyWiFi System on Step 3 above 
  • Save the file after completing the changes

Please Note

If you have a Custom Social Portal Enabled in the MyWiFi System. It is necessary to add your Social Portal Domain to the Allowed Hosts/Domains Whitelist.

To do so, you must add your Custom Social Portal Domain to your config.txt & login.html file

Edit the config.txt file and add your  Custom Social Portal Domain below the following 2 lines:

  • /ip hotspot walled-garden
  • add dst-host=*mywifi.io

You may add your domain as per the following format:

  • add dst-host=<WhiteLabelPortalDomain>

ex.  add dst-host=*.myspecialdomain.com

Edit the login.html file and change this line:
<form id="redirect_form" action="https://securewifilogin.com" method="POST">
from using the domain:
https://securewifilogin.com
to:
<WhiteLabelPortalDomain>
so it appears as such:
<form id="redirect_form" action="<WhiteLabelPortalDomain>" method="POST">

Upload the files to your MikroTik Device

Connect to the MikroTik device with WinBox

Drag-and-Drop the config.txt file to the middle of the WinBox window

If the operation was successful, WinBox will show the File List window with the config.txt file inside.

Open New Terminal window, type: import config.txt and press ENTER.

If the operation was successful, after around 5 seconds you should see “Script file loaded and executed successfully” information.

Go to File List window (if it’s not open, click Files on the left menu) and drag-and-drop the 3 html files from the configuration package (alogin.html, login.html, rlogin.html) to the “hotspot” directory in the File List.

If the operation was successful, you should see the 3 files in the File List window.

Congratulations! Your Mikrotik Device is now Enabled for Social Guest Access.


Notes:

Unable to Access Captive Portal: If you are not able to access the captive portal after connecting to the WiFi. Or if you are entered in a loop when you attempt to access any specific URL. Please make sure that your captive portal splash page domain, that you entered in the “Custom Splash URL” field, is included in the Allow Hosts/Domains Whitelist.


Did this answer your question?