Mikrotik Hotspot Login from Splynx portal
This Splynx feature allows you to set up fully automatic customers registration and internet usage via Mikrotik Hotspot. Automatic registration can be done with the Splynx self-registration add-on. Customers can pay for internet by using one of the payment systems, and then customers will be able login to the Mikrotik Hotspot using the Splynx portal. No admin intervention is required to register customers and to allow the use of the internet services (activate customers, etc.).
This is a built-in feature in Splynx starting from version 2.3 and can be configured under
Config / Main / Portal_:
- Enable hotspot - Enable or disable this feature.
- Hotspot hostname - Should be the same as in your Mikrotik settings. In the Hotspot Server Profile (DNS Name):
- Automatic, after login to portal - customer will be logged into the Hotspot automatically right after entering the Splynx portal.
- Click to login button - a Hotspot login button will appear on the Splynx portal page. Customer's will be logged into the Hotspot after they press this button.
- Disabled - Hotspot login button will appear on the Splynx portal page. Customer won't be logged into Hotspot after he press this button.
- Hotspot status page
- Enabled - the status page will show the Mikrotik Hotspot status after successfully logging in , with details of the connection and a log off button:
- Disabled - the status page will simply show "Hotspot connected..." after successfully logging in:
We use custom Hotspot HTML pages. You can download them here - splynx-hotspot.zip
- Extract the archive.
- Replace http://example.com with your own Splynx URL in all the HTML files. In Linux you can do this by using
sed. In the folder with the HTML files, where the zip archive was extracted, run the following in the terminal:
sed -i s%http://example.com%http://yoursplynxurl%g *
* replace yoursplynxurl with the actual domain name or IP.
- Copy the modified files into your Mikrotik router. To perform the copy, you can use FTP, SSH or Drag and Drop, etc.
- In the Hotspot Server Profile set the HTML Directory override to the directory you've just copied:
- In the Hotspot Server Profile set the Login By method to HTTP CHAP:
- If you would like to use RADIUS authorization, be sure to enable Use RADIUS, and add the RADIUS entry:
- Add the IP address of the Splynx server to the Walled Garden IP List to allow access to the Splynx portal for unauthorized customers:
- The First Active internet service will be used to login via Mikrotik Hotspot.
- The customer will only be redirected to the Splynx portal if he is trying to connect to the HTTP web-page (not to HTTPS).
Example #1. RADIUS authorization
In this scenario we use the simplest configuration, without using IP pools from Splynx. The Router (NAS) will assign IP addresses to customers.
Assuming we have a clean instance of Splynx, the following steps can be taken:
- Create customer, then change the customer's status to active (status=active):
- Create an internet plan:
- Create the internet service for the customer:
- Add your router (NAS) into Splynx routers. Authorization/Accounting - Hotspot (Radius) / Radius accounting:
- After you add the router in Splynx, a RADIUS secret will be generated. Create the RADIUS record in your Mikrotik router settings with the same RADIUS secret:
- Disable Use reject IP 0..4 under Config / Networking / Radius:
- Create Mikrotik Hotspot server:
- In the Hotspot Server Profile set the Login By method to HTTP Chap and enable Use RADIUS:
- Download this archive, and extract it.
- Replace "example.com" to your Splynx URL (domain name or IP) in all the HTML files:
- Copy these files into your Mikrotik router and set the HTML Directory override in your Hotspot Server Profile to the "splynx-hotspot" directory:
- Add your Splynx server IP into the Walled Garden IP list:
- Enable Hotspot login via Splynx Portal under Config / Main / Portal:
Example #2. API authorization
In this scenario we will use the IP pool option in Splynx.
Assuming we have fresh Splynx instance, the following steps should be taken:
Create a customer, and change their status to active (status=active):
Create the internet plan:
Create the IP pool for customers. Selecting the Type of usage as Static:
Reserve the first IP of the pool for the router:
Add this IP to the hotspot interface:
Create a NAT rule for the Splynx pool:
Add your router (NAS) into Splynx routers. Authorization/Accounting - Hotspot (Users) / API accounting:
Enable API usage for this router in Splynx, and enter an API login and password:
Enable API for the router in Winbox, create the API group and API user:
Create the internet service for the customer. Select the Router (required !) and permanent IP:
Create the Mikrotik Hotspot server:
In the Hotspot Server Profile set the Login By method to HTTP Chap and disable Use RADIUS:
Download this archive, and extract it.
Replace "example.com" with your Splynx URL (domain name or IP) in all the HTML files:
Copy these files into your Mikrotik and set the HTML Directory override in your Hotspot Server Profile to the "splynx-hotspot" directory:
Add your Splynx server IP into the Walled Garden IP List:
Enable Hotspot login via Splynx Portal under Config / Main / Portal:
How it works (scheme)
- The customer will try to access the web page (HTTP site).
- The Router (NAS) redirects the customer to the Mikrotik Hotspot IP (to router IP).
- Mikrotik Hotspot redirects the customer to Splynx portal (to Splynx URL).
- The customer then authenticates on the portal and logs in into the Mikrotik Hotspot on the Splynx portal.
- Customer is authenticated and can then access the internet.