RADIUS operator guide

RADIUS CoA and Disconnect on MikroTik

Change a running subscriber's speed or end a session deliberately. Trace the request, check the reply, and verify the customer outcome before declaring success.

Updated

Start with the distinction: CoA-Request asks the network access server (NAS) to change authorization on a running session. Disconnect-Request asks it to end that session. They are different operations, with different replies. A login succeeding on UDP 1812 does not prove that either incoming operation works.

For product context, read the MikroTik integration scope or FreeRADIUS integration scope. The procedures below are operator examples, not a claim that an ISPAgents adapter performs them today.

CoA versus Disconnect: choose the customer outcome

Intended outcomeOperator actionEvidence to collect
Change speed on a running sessionSave the new login policy, then send a supported rate attribute in CoA.CoA-ACK, effective queue/rate, and a subscriber traffic check.
Reauthenticate with a new address or poolSave the next-login policy, then request a controlled Disconnect.Disconnect-ACK, old session absent, new accounting session and address.
Suspend serviceEstablish the deny/restricted next-login policy before Disconnect.Session termination plus a reconnect attempt obeying that policy.
Restrict traffic with an address listApply a separately reviewed firewall policy to the correct subscriber address.Rule counters and allowed/blocked traffic checks, including IPv6.

RouterOS lists Mikrotik-Rate-Limit among its changeable CoA attributes; it requires disconnection before changing an address, pool or routes. Validate the exact service and firmware in a lab. See MikroTik RADIUS: Change of Authorization.

Configure /radius incoming and agree on UDP 3799

The request direction is easy to reverse:

RADIUS sender 192.0.2.10
  -> NAS listener 198.51.100.20:3799/UDP
  <- authenticated ACK or NAK

These are documentation addresses, not reachable lab targets. Substitute your approved lab topology. Keep the current listener and firewall settings for rollback. Do not paste this into a production router.

RouterOS documents incoming requests as disabled by default, with listener port 1700. This example deliberately chooses 3799; set the sender's NAS destination to the same port. Authentication and accounting ports are separate. See MikroTik RADIUS: incoming messages.

/radius incoming print
/radius incoming set accept=yes port=3799

For a new, isolated PPP lab only, a peer entry might look like this:

/radius add service=ppp address=192.0.2.10 secret="REPLACE_WITH_LAB_SHARED_SECRET"

The secret is a placeholder. Supply a unique value securely on both peers; do not publish it in a ticket or packet capture. On an existing setup, review the matching peer instead of adding a duplicate. A local PPP account can take precedence over RADIUS, so confirm that the test session actually authenticated through RADIUS. See MikroTik PPP AAA.

Input-chain firewall and NAT pitfalls

Packets addressed to the router itself traverse input, while packets routed through it traverse forward. See MikroTik firewall filter chains.

Illustrative IPv4 permit rule on the NAS:

/ip firewall filter add chain=input action=accept protocol=udp src-address=192.0.2.10/32 dst-address=198.51.100.20 dst-port=3799 comment="LAB RADIUS dynamic authorization"

Place this narrowly scoped permit before the applicable input drop; appending it after a drop will not help. Keep other sources denied. Inspect raw rules, input counters, listener VRF and the return route. Do not open 3799 to the entire internet.

An upstream NAT device is a separate hop: any approved destination translation and forwarding rule there must deliver to the intended NAS. Outbound authentication does not create a permanent inbound CoA path. Prefer private routed management connectivity; verify its actual reachability rather than assuming a tunnel provides it.

Record three addresses separately: the packet's destination, the sender source observed at the NAS, and the NAS-IP-Address attribute identifying the NAS. NAT can make them differ. Changing the destination to a translated address does not automatically make that address the correct NAS identity. With multiple routers behind one public IP, use an explicit per-NAS path and port mapping; never broadcast a disconnect to find a subscriber.

Shared secret and Message-Authenticator

Use a sender that generates the RADIUS Request Authenticator and validates the response authenticator. A guessed packet or an unsigned reply is not proof of success. Source selection matters: the receiver must associate the sender with the intended peer and shared secret.

Message-Authenticator adds keyed message integrity; it is not encryption and is distinct from the packet authenticator. RFC 5176 permits it in CoA/Disconnect and requires an invalid one to be silently discarded. Confirm the requirements of both deployed versions, including replay protection, and let the sender calculate the value. Do not disable verification to make a timeout disappear. See RFC 5176, section 3.4.

Use protected management transport and sanitized diagnostics. Keep secrets out of shell history and process arguments when choosing a test client.

Plan change, suspend and address-list enforcement

For a speed change, first persist the desired next-login rate. Match one active session using current accounting evidence, then send only the supported change. The following is an illustrative attribute set, not an executable command or a complete signed packet:

CoA-Request -> 198.51.100.20:3799
User-Name = "lab-subscriber"
Acct-Session-Id = "REPLACE_WITH_CURRENT_SESSION_ID"
NAS-IP-Address = 198.51.100.20
Mikrotik-Rate-Limit = "5M/20M"

For this attribute, RouterOS reads receive/transmit from the router's perspective: 5M/20M means subscriber upload/download. Verify the effective queue and traffic after the ACK, and again after reconnecting. See MikroTik RADIUS attributes.

For suspension, prepare the denied or restricted authentication policy, verify its scope, then use a Disconnect-Request identifying the current session. Do not include the speed attribute in that request. A client that reconnects successfully under its old policy has not been suspended. For restoration, remove the restriction and verify a fresh login and usable service; an offline subscriber has no live session for CoA to update.

An address-list entry alone does not block packets. It needs a matching, reviewed firewall rule. Decide what remains reachable, handle changing subscriber addresses and IPv6, and test both new and established flows. FastTrack can bypass firewall processing; review its interaction with the restriction before using address lists as a billing control. This is a separate enforcement design, not a synonym for Disconnect or a promise that CoA can change every list. See MikroTik connection tracking and FastTrack.

Troubleshooting: symptom โ†’ check โ†’ fix

SymptomCheckFix and verify
No ACK or NAK; timeoutDid the packet reach the intended NAS and UDP port? Was a reply lost? Check input/raw counters, listener, routing, NAT and sender logs.Align 1700/3799 explicitly; repair the scoped route/permit and return path. Check session state before retrying: a timeout is an unknown outcome.
Packet arrives but is silently droppedSender source, matching peer secret, packet authenticator, Message-Authenticator and replay policy.Correct the peer identity or sender signing configuration; keep verification enabled.
NAK with Error-Cause 401 or 402Unsupported or missing attribute; packet type and service compatibility.Remove unsupported changes or supply the required identifier. Read the exact Error-Cause instead of retrying unchanged.
Session not found (503)Current Acct-Session-Id, username and owning NAS; stale accounting or a recent reconnect.Refresh session evidence, select the new session deliberately, then retry only if still needed.
Wrong NAS IP / NAS Identification Mismatch (403)Packet destination versus NAS-IP-Address/NAS-Identifier, especially across NAT.Route to the owning NAS and use its reported identity. Do not substitute the RADIUS server's IP.
ACK but observed outcome is wrongEffective rate, next-login policy, reconnect timing and subscriber traffic.Reconcile control reply with session/queue evidence; correct policy ownership before another action.
Disconnect works, customer comes straight backReauthentication policy, local account precedence and duplicate sessions.Apply and verify the intended restriction, then repeat the controlled single-session check.

The numeric error meanings and session-selection rules come from RFC 5176, sections 3 and 3.5. A NAK gives a different diagnostic path from silence; log both without exposing credentials.

A small operator acceptance checklist

  1. Record RouterOS version, access method, NAS identity, approved sender, port and rollback owner.
  2. Capture one test subscriber's current session and next-login policy. Avoid username-only selection when it could match multiple sessions.
  3. Prove one supported speed change, then restore the old rate and verify it.
  4. Prove suspension survives a reconnect; prove restoration yields usable service.
  5. Exercise a stale session ID and a rejected request in the lab; retain sanitized ACK/NAK/timeout evidence.
  6. Stop if identity, signing or outcome is ambiguous. Restore the recorded policy and lab firewall/listener settings under operator control.

These are proposed acceptance steps. This article does not establish live router validation or production readiness.

Where ISPAgents fits: guided pilot boundaries

Guided pilot: ISPAgents service-policy foundations include preview, approvals, result recording and a mock-safe adapter worker; live router/RADIUS mutation remains gated by adapter, credential-resolution, rollback and monitoring proof.

Guided pilot: ISPAgents existing-FreeRADIUS integration includes a signed Status-Server probe and opt-in SQL accounting import. CoA/Disconnect drivers have fake-transport test coverage; real NAS mutation and end-to-end policy enforcement remain unqualified. SQL/API synchronization and policy write-back are not a complete integration.

Guided pilot: ISPAgents Managed RADIUS requires tenant-specific onboarding, live smoke and launch signoff. Broad public availability, hard SLAs and regional pools are not established by this scope.

Read the FreeRADIUS versus managed RADIUS guided pilot guide or discuss guided pilot scope. Use the checklist above to define what must be proven for your network before promising a live plan-change or suspension workflow.

Frequently asked questions

Why does RADIUS login work but Disconnect time out?

Login is initiated by the NAS; Disconnect is initiated toward it. Check the incoming listener, destination port, input firewall, sender address, authenticators and return path separately.

Does a Disconnect suspend a subscriber permanently?

No. It ends the matching session. Change and verify the next-login policy first; otherwise the subscriber may reconnect immediately.

Can a plan change require a reconnect?

Yes. Validate supported live attributes for the service and RouterOS version. An address, pool or route change requires a fresh session rather than a speed-only CoA.