Overview
FyberPay automates network provisioning so that subscriber activations, plan changes, suspensions, and cancellations are reflected on your network infrastructure in real-time. The system integrates with FreeRADIUS for authentication and MikroTik RouterOS for bandwidth enforcement and PPPoE service.Architecture
RADIUS Setup
FyberPay uses FreeRADIUS with a PostgreSQL backend. The RADIUS database is separate from the main FyberPay application database.RADIUS Database Tables
FyberPay manages these standard FreeRADIUS tables:| Table | Purpose |
|---|---|
radcheck | Subscriber authentication credentials (Cleartext-Password, NT-Password) |
radreply | Per-subscriber reply attributes (Framed-IP-Address for static IPs) |
radusergroup | Maps subscribers to plan groups |
radgroupreply | Plan-level attributes (Mikrotik-Rate-Limit for bandwidth) |
radacct | Accounting records (session start/stop, bytes transferred) |
How Provisioning Events Flow
FyberPay uses a transactional outbox pattern for all provisioning events. When a subscription state changes, the event is written to the outbox in the same database transaction. A background processor then dispatches the event to the RADIUS provisioning listener.- Activation
- Plan Change
- Suspension / Walled Garden
- Cancellation
- Expiry
When
subscription.activated fires:- radcheck: Upserts
Cleartext-PasswordandNT-Passwordfor the PPPoE username - radusergroup: Maps the username to the plan’s RADIUS group
- radreply: If access method is
static, setsFramed-IP-Address
PPPoE Profiles
Creating Plans with RADIUS Groups
When you create a plan in FyberPay at Billing > Plans, a RADIUS group is automatically generated. The group name follows the pattern:plan-home-basic. You can override this with a custom group name in the plan creation form.
Rate-Limit Attributes
FyberPay writes theMikrotik-Rate-Limit attribute to the radgroupreply table for each plan. The format follows MikroTik’s rate-limit syntax:
Burst Configuration
Plans can optionally include burst settings for MikroTik simple queues:| Setting | Description | Example |
|---|---|---|
| Burst Limit | Maximum speed during burst | 10240k/40960k |
| Burst Threshold | Speed at which burst deactivates | 4096k/16384k |
| Burst Time | Duration of burst window | 10/10 |
Burst settings are optional. If not configured, FyberPay writes a simple rate-limit string without burst parameters. MikroTik treats this as a hard bandwidth cap.
Bandwidth Shaping
MikroTik Simple Queues
FyberPay enforces bandwidth through MikroTik simple queues, driven by theMikrotik-Rate-Limit RADIUS attribute. When a subscriber authenticates via PPPoE, MikroTik automatically creates a dynamic simple queue based on the RADIUS reply.
You can view all active queues from Network > [Router] > Queues in the FyberPay dashboard. Each queue shows:
- Queue name (typically the PPPoE username)
- Target (subscriber’s assigned IP)
- Max limit (upload/download cap)
- Burst limit (if configured)
Manual Queue Adjustments
For temporary bandwidth adjustments (for example, a promotional speed boost), you can update a queue directly from the FyberPay dashboard:- Navigate to Network > [Router] > Queues
- Find the subscriber’s queue
- Click Edit and adjust the
maxLimitorburstLimit
IP Pool Management
Dynamic IP Assignment
By default, MikroTik assigns dynamic IPs from the PPPoE IP pool. Configure your IP pool on the MikroTik router under IP > Pool. FyberPay does not manage dynamic IP pools directly; this is handled by the router’s PPP profile.Static IP Assignment
For subscribers who need a fixed IP:- Set the subscriber’s access method to Static IP in FyberPay
- Enter the desired IP address
- FyberPay writes
Framed-IP-Addressto the RADIUSradreplytable - On the next PPPoE connection, MikroTik assigns this specific IP instead of one from the pool
VLAN Assignment
For ISPs using VLANs to segment subscriber traffic:- Create VLAN interfaces on your MikroTik router
- Configure separate PPPoE servers on each VLAN interface
- Assign subscribers to the appropriate PPPoE server based on their location or service tier
Router Management
Adding NAS Devices
Navigate to Settings > Network > Routers and click Add Router:Enter router details
- Name: A descriptive label (e.g., “Ruiru Tower MikroTik”)
- Tunnel IP: The router’s IP address accessible via your management tunnel (SSTP/L2TP)
- RouterOS Username: API username for the router
- RouterOS Password: API password (encrypted at rest)
- API Port: Default is 80 for HTTP, 443 for HTTPS
Fleet Monitoring
View all your routers at Network > Fleet Status. For each device, FyberPay shows:- Connection status (reachable/unreachable)
- RouterOS version
- CPU load and memory usage
- Uptime
- Active PPP sessions count
Fleet status polls routers in batches of 10 concurrent requests to avoid overwhelming your management tunnel. Devices without configured RouterOS credentials are shown as “unconfigured.”
Walled Garden
The walled garden is a restricted network state where subscribers can only access the FyberPay payment portal. It is used for:- Expired subscriptions
- Subscribers in the dunning pipeline
- Manually suspended subscribers
walled-garden. Configure the walled garden on your MikroTik router to allow traffic only to your FyberPay domain and M-Pesa payment endpoints.
MikroTik Walled Garden Configuration
On your MikroTik router, create firewall rules that allow walled-garden subscribers to reach:- Your FyberPay subdomain (e.g.,
yourorg.fyberpay.com) - Safaricom M-Pesa API endpoints (for STK Push payments)
- DNS servers (so domain resolution works)
Next Steps
Hotspot Setup
Configure captive portal hotspots with voucher-based access.
Subscriber Management
Add subscribers, manage plan changes, and track lifecycle states.