How to connect a MikroTik router to a RADIUS system for PPPoE and Hotspot

With RADIUS you stop keeping subscriber accounts on every router. The router asks one server at every login: is this subscriber allowed in, and at what speed? The server accepts or refuses, then receives the session and usage data from the router. These steps connect a MikroTik router to Red Radius for PPPoE and Hotspot.

Before you start

  • The IP address of the system’s server, reachable from the router.
  • A secret you choose, the same on the router and in the system.
  • The router address the requests will come from.

1. Add the router as a NAS

In Red Radius, open the NAS devices and add the router: a name, the IP address it sends from, and the secret. If you want the system to monitor the router and read from it, turn the API on and enter its username and password.

2. Point the router at the RADIUS server

/radius add service=ppp,hotspot address=10.0.0.10 secret=YourSecret src-address=10.0.0.1

Put the system’s server in address, the router address you entered in step 1 in src-address, and the same secret in secret.

3. Turn RADIUS on for PPPoE

/ppp aaa set use-radius=yes accounting=yes interim-update=5m

The router now asks the system at every PPPoE login, sends session data, and updates usage every five minutes.

4. Turn RADIUS on for Hotspot

/ip hotspot profile set [find] use-radius=yes radius-accounting=yes radius-interim-update=5m

This applies to every hotspot profile on the router. To change only one, put its name instead of [find].

5. Let the system drop sessions

/radius incoming set accept=yes port=3799

This lets the system drop a subscriber’s session from the admin or the staff app, for example when their subscription ends. The port must match the CoA port in the NAS settings inside the system.

6. Try a subscription

Create a test subscription with the PPPoE or Hotspot service type and log in with it. The session shows up among the live sessions with its IP address and usage. If the login is refused, the login-attempt log tells you why.

What the system does once the router is connected is on RADIUS for MikroTik.