How to Setup Mikrotik Hotspot Gateway
1. Preparing the router
Start your router and wait until it boots (you should hear a couple of beeps), then open Winbox. Your router should appear in the Neighbours list – if not, you can either click Refresh until it appears or just type the MAC address of your device into the Connect To field (You can find the MAC address on the bottom of the casing or on the box).
- If you see the following dialogue box, then click on the Remove configuration button:
- If you haven't seen it, go to System → Reset Configuration → Tick the No Default Configuration checkbox, leave the rest unticked and click on Reset Configuration.
Your router will reboot, so when it becomes available, please connect to it again.
2. Connecting the router to our service
- Log in to the Control Center on our website, and go to the Locations page (Manage/Locations). Click on the location name for the hotspot information page.
- Click on Modify Hotspot Data & Settings, then in the Splash Page Settings change the Internal Login/Logout URL Set to Mikrotik, then click Submit.
- Once you're back to the Location Detials page, scroll down to the ROUTER SETUP COMMAND FOR THIS LOCATION section, select Mikrotik, then verify the settings there if you want to setup a wireless hotspot (set wlan1 for the hotspot interface) or a hotspot gateway (set ether2 for the hotspot interface), then copy the setup commands (You can use the Highlight Text button and right-click on the script, then select copy).
- In Winbox, look for New Terminal in the left menu and click on it, then paste the commands into the new window appearing either by right-clicking into the terminal window and selecting paste or with the Shift + Insert key combination (please wait until the prompt is displayed).
- Once the script has finished (make sure you see an empty prompt, else just press Enter to execute the last command), you can close this window and set a router password under System → Password.
In rare occasions the hotspot isn't working after the script has finished. In this case just restart the router (either bySystem → Reboot or by unplugging it from the mains for a minute).
- Click on Modify Hotspot Data & Settings, then in the Splash Page Settings change the Internal Login/Logout URL Set to Mikrotik, then click Submit.
- Once you're back to the Location Detials page, scroll down to the ROUTER SETUP COMMAND FOR THIS LOCATION section, select Mikrotik, then verify the settings there if you want to setup a wireless hotspot (set wlan1 for the hotspot interface) or a hotspot gateway (set ether2 for the hotspot interface), then copy the setup commands (You can use the Highlight Text button and right-click on the script, then select copy).
- In Winbox, look for New Terminal in the left menu and click on it, then paste the commands into the new window appearing either by right-clicking into the terminal window and selecting paste or with the Shift + Insert key combination (please wait until the prompt is displayed).
- Once the script has finished (make sure you see an empty prompt, else just press Enter to execute the last command), you can close this window and set a router password under System → Password.
In rare occasions the hotspot isn't working after the script has finished. In this case just restart the router (either bySystem → Reboot or by unplugging it from the mains for a minute).
3. For White Label operators
If you are a White Label operator, you need to copy and edit two files from the hotspot folder on your device. Click on Files, and drag & drop login.html and alogin.html onto your desktop. Open them in a text editor and replace customer.hotspotsystem.com with your White Label hotspot FQDN. Save the files and drag them back making sure that they are in the hotspot folder.
Troubleshooting:
Sometimes some necessary files not generated properly and when you try to connect to the hotspot, you get a 404 error. In this case just go to System → Reset Configuration → Tick the No Default Configuration and the Do Not Backup checkboxes and reset the configuration, then when the router becomes visible again in Winbox, connect to it and re-run the setup script copied from the Control Center.
Sometimes some necessary files not generated properly and when you try to connect to the hotspot, you get a 404 error. In this case just go to System → Reset Configuration → Tick the No Default Configuration and the Do Not Backup checkboxes and reset the configuration, then when the router becomes visible again in Winbox, connect to it and re-run the setup script copied from the Control Center.
4.Configuring the hotspot DHCP settings
Set the DHCP lease time of the hotspot to 1 day under IP > DHCP server > open the DHCP server by a double-click> Lease time > set 1d 00:00:00 .
5. Configuring the hotspot interfaces
Let's set the LAN ports 3 & 4 to use with the hotspot as well. Go to Interfaces > ether3 > General tab > Master port > ether2. Do the same to ether4 as well.
6.Configuring the other interfaces
From here we are setting up the free internet connection on port #5.
Go to IP > Addresses. Click the + sign to add an IP address to ether5 port. Set a private IP range here, we use 192.168.20.1 in our case.
Address is 192.168.20.1/24, network is 192.168.20.0, interface is ether5, click Apply and OK.
7.Configuring the other DHCP settings
We set up a DHCP server on interface ether5. Go to IP > DHCP Server > DHCP Setup. Select ether5 for the interface, DHCP address space is 192.168.20.0/24, gateway for DHCP network is 192.168.20.1, DHCP relay should be left blank, IP addresses to give out would be 192.168.20.2-192.168.20.254, DNS servers are fine on 8.8.8.8 for Google's DNS, lease time can be 1d 00:00:00 for one day. If you have any specific plans you can use a different value here.