How to automate PPPoE billing on MikroTik with M-Pesa
Run a PPPoE server on your MikroTik with one profile per speed plan and one secret per customer. Then let a billing system manage the secrets. It disconnects each customer when their month ends and reconnects them the moment they pay by M-Pesa, with the payment matched to their account number. Nobody has to chase payments or type commands on the router.
How does automated PPPoE billing work?
The router enforces access and the billing system decides who gets it. Each customer has a PPPoE secret on the MikroTik with a profile that sets their speed. When the customer's paid period ends, the billing system removes their active session and blocks the secret. When they pay, it unblocks the secret and the customer's router reconnects on its own.
Done by hand, this means checking dates every morning and logging into the router for each customer. Done by billing, it happens to the minute, even at 2 am.
Setting up the PPPoE server on the router
If your MikroTik already runs PPPoE, skip to the next section. Otherwise, create an address pool, a server and a profile. Replace bridge-customers with the bridge or VLAN that faces your customers:
/ip pool add name=pppoe-pool ranges=10.20.0.2-10.20.3.254
/ppp profile add name=10M local-address=10.20.0.1 remote-address=pppoe-pool rate-limit=10M/10M
/interface pppoe-server server add service-name=internet interface=bridge-customers default-profile=10M disabled=no
You do not need to add every profile and secret by hand. Once the router is connected to WIFI247, the plans you create are pushed to the router as PPP profiles.
Connecting the router to the billing system
In WIFI247, open Routers › Add and paste the one-line command into the router's terminal. The router connects over a WireGuard VPN, so it does not need a public IP. This is common for Kenyan ISPs whose upstream link sits behind CGNAT. See MikroTik billing without a public IP.
Creating plans and moving customers in
Create one plan per package you sell, for example 10 Mbps, Ksh 1,500 a month, with its upload and download speed. Then either:
- Import the PPPoE secrets already on the router. Customers keep their usernames and passwords, so nobody needs a visit.
- Add new customers with a username, password, phone number and plan.
Taking payments and reconnecting automatically
Each customer pays with their account number as the reference, either from an STK prompt or by paying your paybill directly. When the payment is confirmed, WIFI247:
- matches it to the customer,
- extends their plan by the period paid for,
- unblocks the secret on the router so the customer reconnects,
- and puts any extra money on the customer's balance for next month.
Customers can also change plans. If their balance covers the new plan, it is activated straight away.
Mistakes that cost PPPoE operators money
Expired customers who stay online
Disabling a secret does not end a session that is already running. The billing system must also remove the active connection, or the customer keeps browsing until their router restarts. WIFI247 does both.
Payments with the wrong account number
Customers mistype account numbers. Unmatched payments must be easy to find and assign, or the customer pays and stays offline. WIFI247 lists them on their own tab, and you can allocate one in a click.
Per-user pricing as you grow
Billing systems that charge Ksh 20–30 per PPPoE user per month cost Ksh 2,000–3,000 at 100 customers and Ksh 10,000–15,000 at 500. Compare the options in ISP billing systems in Kenya compared.
Questions
How does a PPPoE customer pay with M-Pesa?
Either through an STK prompt sent to their phone, or by paying your paybill with their account number. The billing system matches the payment to the customer, extends their plan and reconnects them.
What happens when a PPPoE customer's month ends?
The billing system disconnects the active session and blocks the account until they pay. Reminders can go out by SMS before and after expiry.
What if a customer pays with the wrong account number?
The payment shows as unmatched. In WIFI247 you can assign it to the right customer, renew their plan or credit their balance in one click.
Can I move my existing PPPoE customers into a billing system?
Yes. WIFI247 imports the PPPoE secrets already on your MikroTik, with their profiles, so you do not have to type customers in again.
Does WIFI247 charge per PPPoE user?
No. WIFI247 charges one flat monthly fee by router count, whether you have 10 PPPoE customers or 1,000.