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 Splynx self-registration add-on. Customers can pay for the internet by using one of payment systems. And then customers can login to Mikrotik Hotspot using Splynx portal. No admin intervention is required to register customers and to let them use internet (activate customers, etc.).

Splynx settings

This feature is built-in in Splynx starting from version 2.3 It can be configured under Config / Main / Portal: picture1.png

  • Enable hotspot - Enable or disable this feature.
  • Hotspot hostname - Should be the same as in Mikrotik settings. In Hotspot Server Profile (DNS Name): picture2
  • Login:
    • Automatic, after login to portal - customer will be logged in to Hotspot automatically just after entering to Splynx portal.
    • Click to login button - Hotspot login button will appear on the Splynx portal page. Customer will be logged in to Hotspot after he press this button. picture3
    • Disabled - Hotspot login button will appear on the Splynx portal page. Customer won't be logged in to Hotspot after he press this button.
  • Hotspot status page
    • Enabled - show Mikrotik Hotspot status after successful login: picture4
    • Disabled - show "Hotspot connected..." after successful login: picture5

Mikrotik settings

We use custom Hotspot HTML pages. You can download them here - splynx-hotspot.zip

  1. Extract the archive.
  2. Replace http://example.com to your own Splynx URL in all HTML files. In Linux you can do it using sed. In the folder with HTML files, where zip archive was extracted, run in the terminal:
    sed -i s%http://example.com%http://yoursplynxurl%g *

    * replace yoursplynxurl with the actual domain name or IP.

  3. Copy modified files into Mikrotik. To copy, you can use FTP, SSH, Drag and Drop, etc.
  4. In Hotspot Server Profile set HTML Directory override to the directory just copied: picture6
  5. In Hotspot Server Profile set Login By to HTTP CHAP: picture8
  6. If you want to use RADIUS authorization, enable Use RADIUS. And add RADIUS entry: picture9 picture10
  7. Add IP address of the Splynx server to the Walled Garden IP List to give access to the Splynx portal for unauthorized customers: picture7

Warning. Please note:

  • First Active internet service will be used for login via Mikrotik Hotspot.
  • The customer will be redirected to Splynx portal only if he is trying to connect to HTTP web-page (not to HTTPS).

Example #1. RADIUS authorization

In this scenario we use the simplest configuration, without using IP pools from Splynx. Router (NAS) will assign IP addresses for customers.

Suppose we have clean Splynx. Follow these steps:

  1. Create customer, make him active (status=active): picture11 picture12
  2. Create internet plan: picture13 picture14
  3. Create internet service for the customer: picture15 picture16
  4. Add your router (NAS) into Splynx routers. Authorization/Accounting - Hotspot (Radius) / Radius accounting: picture17
  5. After you add router in Splynx, RADIUS secret will be generated. Create RADIUS record in Mikrotik settings with this RADIUS secret: picture18 picture19
  6. Disable Use reject IP 0..4 under Config / Networking / Radius: picture46
  7. Create Mikrotik Hotspot server: picture20 picture21 picture22 picture23 picture24 picture25 picture26 picture27
  8. In Hotspot Server Profile set Login By to HTTP Chap and enable Use RADIUS: picture8 picture9
  9. Download this archive, extract it.
  10. Replace "example.com" to your Splynx URL (domain name or IP) in all HTML files: picture28
  11. Copy these files into Mikrotik and set in Hotspot Server Profile HTML Directory override to the directory "splynx-hotspot": picture29 picture6
  12. Add Splynx server IP into Walled Garden IP list: picture30
  13. Enable Hotspot login via Splynx Portal under Config / Main / Portal: picture31

Example #2. API authorization

In this scenario we use IP pool from Splynx.

Suppose we have clean Splynx. Follow these steps:

  1. Create customer, make him active (status=active): picture11 picture12
  2. Create internet plan: picture13 picture14
  3. Create IP pool for customers. Type of usage - Static: picture32
  4. Reserve first IP of the pool for the router: picture39 picture40 picture41
  5. Add this IP to the hotspot interface: picture42
  6. Create NAT rule for the Splynx pool: picture43 picture44
  7. Add your router (NAS) into Splynx routers. Authorization/Accounting - Hotspot (Users) / API accounting: picture33
  8. Enable API usage for this router in Splynx, enter API login and password: picture34
  9. Enable API for the router in Winbox, create API group and API user: picture45 picture37 picture38
  10. Create internet service for the customer. Select Router (required !) and permanent IP: picture15 picture35
  11. Create Mikrotik Hotspot server: picture20 picture21 picture22 picture23 picture24 picture25 picture26 picture27
  12. In Hotspot Server Profile set Login By to HTTP Chap and disable Use RADIUS: picture8 picture36
  13. Download this archive, extract it.
  14. Replace "example.com" to your Splynx URL (domain name or IP) in all HTML files: picture28
  15. Copy these files into Mikrotik and set in Hotspot Server Profile HTML Directory override to the directory "splynx-hotspot": picture29 picture6
  16. Add Splynx server IP into Walled Garden IP List: picture30
  17. Enable Hotspot login via Splynx Portal under Config / Main / Portal: picture31

How it works (scheme)

  • The customer is trying to access web page (HTTP site).
  • Router (NAS) redirects the customer to Mikrotik Hotspot IP (to router IP).
  • Mikrotik Hotspot redirects the customer to Splynx portal (to Splynx URL).
  • The customer authenticates on the portal and logs in into Mikrotik Hotspot on the Splynx portal.
  • Customer can browse internet.