Connecting MikroTik to a RADIUS Server — A Complete Walkthrough

5 min read

If you run a network with subscribers, you probably started with MikroTik's built-in User Manager or a hand-maintained secrets list. Both work — right up until you have more than one router, or you need to know who consumed what, or you want to cut off a late-paying subscriber while you're nowhere near the device.

That's what RADIUS is for: one server holding authentication, authorization and accounting for your whole fleet.

This walks through the actual setup, then the failures that catch people out.

What RADIUS actually does

Three jobs. Worth separating them, because each is configured independently:

FunctionWhat it answersWhen it happens
AuthenticationWho is this? Is the password right?The moment a subscriber connects
AuthorizationWhat are they allowed? What speed? What quota?Alongside the auth reply
AccountingHow much did they use, and for how long?During the session and at close

The router still enforces everything. RADIUS only decides.

Before you start

  • A MikroTik running RouterOS 6.4x or 7.x
  • A reachable RADIUS server, and its address
  • A shared secret — a string configured identically on both sides
  • UDP 1812 (auth) and 1813 (accounting) open between router and server

⚠️ The shared secret is not a user password. It is the key the router and server sign their messages to each other with. Make it long and random, and avoid reusing one secret across every router if you can help it.

Step 1: Add the server to the router

From the terminal:

/radius add \
  service=ppp,hotspot \
  address=10.0.0.5 \
  secret=YOUR_SHARED_SECRET \
  timeout=3s \
  comment="Main RADIUS"

service= decides which router services consult this server. If your network is PPPoE only, ppp alone is enough.

Watch timeout. The default is 300ms, which is far too tight if the server is not on your local network. If the path crosses the internet, 3s is much more realistic. Too short a timeout produces "radius timeout" in the log and subscribers who cannot log in — while the server itself is perfectly healthy.

Step 2: Enable it for PPPoE

Adding the server does nothing on its own. The service has to be told to use it:

/ppp aaa set use-radius=yes accounting=yes interim-update=5m
  • use-radius=yes — authentication goes to RADIUS
  • accounting=yes — the router reports usage
  • interim-update=5m — send an update every 5 minutes during the session, not only at close

interim-update matters more than it looks. Without it, a subscriber six hours into a session has no visible usage at all until they disconnect — and any quota enforced server-side fires late.

Step 3: Enable it for the hotspot

The hotspot has its own separate switch, on the profile:

/ip hotspot profile set [find default=yes] use-radius=yes

If you have more than one profile, each needs it. This is a common cause of "it works on one network but not the other".

Step 4: Enable CoA — disconnect a subscriber instantly

This is the step most guides skip, and it is the one you feel daily.

Without it, cutting a subscriber off from your dashboard does nothing until their session happens to end — possibly hours. Change of Authorization (CoA) lets the server tell the router "drop this session now" or "change this speed".

/radius incoming set accept=yes port=3799

This opens the router to inbound requests, so the firewall must allow UDP 3799 from the server address only:

/ip firewall filter add \
  chain=input protocol=udp dst-port=3799 \
  src-address=10.0.0.5 action=accept \
  place-before=0 comment="RADIUS CoA"

Step 5: Confirm it works

/radius monitor 0

Live counters: requests sent, replies received, timeouts. Have a subscriber connect and watch them move.

If nothing moves:

/log print where topics~"radius"

Common failures and fixes

"radius timeout" in the log

In this order:

  1. Timeout too short — the default is 300ms. Try 3s.
  2. Port blocked — 1812/1813 UDP. Try /tool traceroute to the server.
  3. The server doesn't know this router. Most RADIUS servers silently drop packets from an address not registered as a NAS — with no reply at all. From the router's side that looks exactly like a network timeout.

Authentication fails but the secret is correct

Check for a trailing space. Copy-pasting from an editor adds them constantly, and MikroTik stores them faithfully.

Subscribers connect but with no speed limit

The router applies the Mikrotik-Rate-Limit attribute the server sends. If the server sends nothing, the subscriber connects completely unlimited. And note a second trap: on RouterOS the value 0 means unlimited, not "zero speed" — so a plan misconfigured to zero grants open speed rather than cutting anyone off.

Works on hotspot but not PPPoE (or the reverse)

Check service= in /radius print. And confirm you enabled use-radius on the service itself (steps 2 and 3), not only on the server entry.

The problem this guide can't solve: a router behind NAT

Everything above assumes the server can reach the router — which CoA requires.

But most small networks run on a connection with no static IP, behind the ISP's NAT. Which means:

  • Authentication and accounting will work (the router initiates those)
  • CoA will not (the server must initiate, and has no address to reach)

The usual workarounds all hurt: a static IP from your ISP (a recurring cost, and sometimes simply refused), a VPN you build and maintain yourself, or DDNS plus port forwarding that breaks the first time your ISP changes topology.

At Shark Rad we solve this with a secure tunnel the router opens outbound, so the server reaches it inside the tunnel with no static IP and no port forwarding — from a single script you paste into the terminal. If you're building your own, a VPN between you and the router is the closest equivalent.

The short version

/radius add service=ppp,hotspot address=... secret=... timeout=3s
/ppp aaa set use-radius=yes accounting=yes interim-update=5m
/ip hotspot profile set [find default=yes] use-radius=yes
/radius incoming set accept=yes port=3799
/radius monitor 0

Five commands. What actually catches people isn't in them — it's that the server must know the router as a NAS, and that the default timeout is too short.

Read next