Complete guide to connect your MikroTik routers and manage your hotspot/ISP PPPoE services
BongoNet uses a REST API-based approach to connect with MikroTik routers. The routers communicate with the BongoNet cloud server via HTTP/HTTPS requests to validate vouchers, check sessions, fetch portal configurations, and send heartbeat signals.
┌─────────────────┐ HTTP/HTTPS ┌──────────────────┐
│ MikroTik Router│ ◄────────────────────────► │ BongoNet Cloud │
│ (RouterOS) │ API Calls + Token Auth │ Server (Node.js)│
└─────────────────┘ └──────────────────┘
│ │
│ Router Scripts │ Database
│ (RouterOS Scripts) │ (SQLite)
Complete hotspot configuration with captive portal
ISP-grade PPPoE customer management
Mobile money payment processing
Monitor router performance and devices
Visit https://bongonet.co/signup and create your account
After logging in, go to Dashboard → Routers → Add Router
193.181.214.135 or bongonet.co.
After adding the router, you'll receive a unique API token
bongo_)Example Token: bongo_abc123xyz789def456ghi012jkl345mno678pqr901stu234vwx567
In the router details page, click "Download RouterOS Script"
For faster integration, use the ready-made commands from your BongoNet dashboard. No need to manually add tokens - everything is pre-configured!
# Just paste the script from dashboard - it executes immediately!
.rsc file will be downloaded to your computerOption A - Via Winbox:
.rsc fileAfter uploading, run this command in RouterOS terminal:
/import file-name=bongo-router-[YOUR_ROUTER_ID]-config.rsc
Note: Replace [YOUR_ROUTER_ID] with the actual filename from the downloaded file.
/system script print where name~"bongo"
You should see the bongo-heartbeat script listed.
/ping bongonet.co count=3
Expected: 3 successful pings. If this fails, check router's internet connection.
/log print where message~"bongo"
This shows all log entries related to BongoNet integration.
/system scheduler print)bongonet.co or 193.181.214.135Login to your MikroTik router using Winbox or WebFig
Navigate to System → Scripts
bongo-integration
The RouterOS script automatically performs the following:
# Auto-detect WAN interface
:local wanInterface
:foreach i in=[/interface find type=ether] do={
:if ([/ip address find interface=$i] = "") do={
:set wanInterface $i
}
}
# Auto-detect WiFi interface
:local wifiInterface
:foreach i in=[/interface find type=wlan] do={
:set wifiInterface $i
}
# Configure hotspot
/ip hotspot profile set [find name=default] html-directory=flash/hotspot
/ip hotspot set [find] interface=$wifiInterface disabled=no
/ip hotspot user profile set [find name=default] rate-limit="10M/5M"
# Set portal URL to BongoNet server
/ip hotspot profile set [find name=default] \
hotspot-address=192.168.1.1 \
http-cookie-lifetime=1d \
html-directory=flash/hotspot
The script includes a scheduler that sends heartbeat signals to BongoNet every 5-10 minutes:
# Heartbeat script
:local apiToken "bongo_abc123xyz789..."
:local serverUrl "https://bongonet.co"
:local routerId "123"
/tool fetch url="$serverUrl/api/routers/$routerId/heartbeat" \
http-method=post \
http-header-field="X-Router-Token: $apiToken" \
http-data="status=online&uptime=86400"
For devices connecting to hotspot, the router checks if they have an active session:
# Check device session
:local macAddress [/ip hotspot active get [find user=$user] mac-address]
:local apiToken "bongo_abc123xyz789..."
:local serverUrl "https://bongonet.co"
:local result [/tool fetch url="$serverUrl/api/vouchers/check-session" \
http-method=post \
http-data=("{\"token\":\"" . $apiToken . "\",\"mac_address\":\"" . $macAddress . "\"}") \
as-value output=user]
:local hasAccess ($result->"data"->"has_access")
:if ($hasAccess = true) do={
/ip hotspot user set [find name=$user] disabled=no
:log info "Device $macAddress granted access"
} else={
/ip hotspot user set [find name=$user] disabled=yes
:log info "Device $macAddress denied - no session"
}
All API calls require authentication using the X-Router-Token header.
| Endpoint | Method | Purpose | Auth |
|---|---|---|---|
/api/routers/:id/heartbeat |
POST | Router status check | Token |
/api/vouchers/validate |
POST | Validate voucher code | Token |
/api/vouchers/check-session |
POST | Check device session | Token |
/api/portals/fetch |
GET | Get portal HTML | Token |
/api/routers/:id/devices |
GET | List connected devices | Token |
All requests must include the router's API token in the header:
X-Router-Token: bongo_abc123xyz789def456ghi012jkl345mno678pqr901stu234vwx567
POST /api/routers/123/heartbeat
Headers:
X-Router-Token: bongo_abc123xyz789...
Content-Type: application/x-www-form-urlencoded
Body:
status=online&uptime=86400
POST /api/vouchers/check-session
Headers:
X-Router-Token: bongo_abc123xyz789...
Content-Type: application/json
Body:
{
"token": "bongo_abc123xyz789...",
"mac_address": "AA:BB:CC:DD:EE:FF"
}
1. User connects to WiFi
└─> Router shows captive portal
2. User selects bundle & mobile payment
└─> Portal redirects to payment
3. User completes payment
└─> Payment callback received
4. System creates session (status: 'pending')
└─> Session stored in database
5. Router checks session (every 30 seconds)
└─> POST /api/vouchers/check-session
6. System finds session
└─> Returns {has_access: true}
7. Router grants internet access
└─> Device can browse internet
8. Payment completes
└─> Session upgraded to 'active'
Customize your captive portal in the BongoNet dashboard:
Create internet bundles for your customers:
BongoNet supports fixed internet (PPPoE) customer management:
In RouterOS, configure PPPoE server:
/interface pppoe-server server add interface=ether1 service-name=bongo disabled=no
In BongoNet dashboard:
Customers can pay via mobile money:
Test if router can reach BongoNet server:
/ping 193.181.214.135
/ping bongonet.co
If ping fails, check router's internet connection and DNS settings.
Ensure the API token in RouterOS script matches the token in BongoNet dashboard:
Test if router can communicate with server:
/tool fetch url="https://bongonet.co/api/routers/123/heartbeat" \
http-method=post \
http-header-field="X-Router-Token: your-token-here" \
http-data="status=test"
Check the result - should return success message.
View router logs for session check attempts:
/log print where message~"session"
/log print where message~"bongo"
Ensure MAC address in session matches device MAC:
/log print/system resource printbongonet.co or use IP 193.181.214.135193.181.214.135bongonet.co443 (HTTPS) or 23000 (HTTP)If you're still experiencing issues after following this guide: