Перейти к содержимому

RADIUS

RADIUS is how VPN concentrators, firewalls, switches and routers, Linux PAM and Windows NPS ask OkYouIn whether a user may sign in. OkYouIn runs its own FreeRADIUS server; every request is handed to OkYouIn, matched to an application, walked through the policy and the application’s rules, and answered with Access-Accept, Access-Reject or Access-Challenge.

For a step-by-step setup of a particular device, see the device guides. This page explains the settings those guides refer to.

OkYouIn listens on UDP 1812 (authentication) and 1813 (accounting), IPv4 and IPv6. The ports are set at installation and shown read-only in Access ▸ Settings ▸ RADIUS.

The same page holds the server-wide settings:

SettingDefaultMeaning
Max request time (seconds)60How long a request may take before FreeRADIUS stops answering it — also the longest an MFA push waits for the user. The user has this time minus 5 seconds to approve. Raise it together with the device’s RADIUS timeout.
Failed pushes before a pause5Denied or unanswered pushes from one client address to one application that start a pause.
Pause (seconds)30How long new pushes from that address to that application are refused (reason mfa_cooldown). An approval resets the count.
Challenges per window / Challenge window (seconds)30 / 600New MFA challenges one user may get; then sign-ins are refused with “Too many sign-in attempts, try again in N minutes”.
Wrong codes per window / Wrong-code window (seconds)10 / 900Wrong codes of one user across all applications; then further codes are refused. Wrong codes never lock the account.

The page also shows the state of the FreeRADIUS configuration: whether FreeRADIUS validated the configuration last applied (radiusd -XC), which applications are rendered or skipped and why, and a read-only Preview of the generated files with secrets masked.

Configuration changes — a new application, a changed secret, a new source — are applied without a restart: the listening ports never close, and a request waiting for a push at that moment is still answered. A configuration FreeRADIUS refuses is never loaded; the previous one keeps serving and the page says why.

MethodSupportedNotes
PAPYesThe password travels inside the RADIUS packet, protected by the shared secret. Works with every first-factor mode and every MFA method.
MS-CHAPv2YesFor devices that only speak MS-CHAPv2 (NPS, RD Gateway, MikroTik admin login). OkYouIn needs the user’s NT hash: local users once their password has been set in OkYouIn, Active Directory users with OkYouIn joined to the domain, FreeIPA users whose ipaNTHash is published. MS-CHAPv2 sign-ins always run as push only.
CHAP, MS-CHAPv1, EAPNoRefused with “Authentication type not supported”.

Joining the domain for MS-CHAPv2 is described under Directories. In a high-availability cluster, MS-CHAPv2 against Active Directory works on the node that joined the domain.

Each RADIUS application has a First factor setting:

OptionWhat OkYouIn doesUse it when
OkYouIn checks password (LDAP / local)Verifies the password against the local user or the user’s directory, then runs the second factor if required.The device passes the user’s password through and has no password check of its own. The usual choice for VPNs and device administration.
MFA only — device already checked passwordDoes not check a password; the user must still exist, be active and be allowed by the policy. Only the second factor is added.The device or another server already checked the password (or a certificate, or an SSH key) and asks OkYouIn for the second factor only — for example an ASA secondary server, OpenVPN with certificates, SSH keys plus a code.

Some templates lock the choice. A device that sends no password at all (RD Gateway) is locked to MFA only; a device that cannot check its own password and then ask for a code (Cisco IOS, FortiGate, MikroTik) is locked to OkYouIn checks password.

What the user can use depends on whether the device can show a prompt (an Access-Challenge):

User’s methodDevice shows promptsDevice cannot show prompts
Web PushNumber matching in the prompt, or the device’s offline code typed inApprove / Deny on the phone, no number
TelegramThe request waits for the approvalThe request waits for the approval
E-mail (Approve / Deny links)Code in the prompt, or the linkThe link only (needs the public base URL)
E-mail codeCode in the promptDoes not work
TOTPCode in the promptDoes not work — refused as incompatible_method (OpenVPN is the exception: the code travels with the password)

A template’s capabilities tell which column a device is in; the template drawer shows “Challenge prompts (RADIUS Access-Challenge): Supported / Not supported”.

For devices that can show prompts, MFA prompt mode decides what a push looks like:

  • Challenge — the device shows a prompt: the device shows OkYouIn’s prompt — the number to select on the phone, or a field to type a code instead. An empty answer (just Enter) waits for the phone. Once the push or the e-mail’s Approve link is approved, the approval decides, whatever was typed.
  • Push only — wait for approval: no prompt; the request waits while the user approves on the phone (no numbers, just Approve / Deny).

Templates whose client cannot show prompts are locked to Push only, and so is every MS-CHAPv2 request.

The OpenVPN RADIUS plugin cannot answer a challenge, so its template has a Client prompt setting instead: Code window (a second field next to the password — the static challenge — where TOTP or the Web Push offline code is typed; for a push the user types any character) or Push only (username and password only; a correct password sends the push). See the OpenVPN guide.

MFA cache (minutes) — after a successful MFA, repeat requests from the same user to the same application (and from the same client IP when the device reports one) are accepted without a new challenge for this many minutes. Useful for OpenVPN renegotiation or devices that authenticate twice per login. Keep it short; 0 = off (the default). It is not available with MFA only.

Identification: sources and NAS-Identifier

Section titled “Identification: sources and NAS-Identifier”

Every RADIUS request must be matched to one application, and FreeRADIUS must know which shared secret to verify it with before it can trust anything in the packet. An application is identified by:

  • Sources — network objects (addresses or subnets) the device sends requests from;
  • NAS-Identifier — the value of RADIUS attribute 32 the device sends. OkYouIn generates one for a new application (you can change it); the device must send exactly this value.
  • Any source — no sources: requests are accepted from any address and the NAS-Identifier plus the shared secret identify the application. The NAS-Identifier is then required.

Each application has its own shared secret. The most specific match wins: NAS-Identifier and source, then NAS-Identifier alone, then source alone; within each, the most specific source.

This lets several applications share one address — for example two OpenVPN servers behind one NAT, or one FortiGate serving a VPN application and an admin-login application — each with its own secret, told apart by NAS-Identifier.

Several templates know their device does not send a NAS-Identifier in every packet (often not in accounting) and start without one — the device is then identified by its source. If you set one anyway, requests without it are rejected or recorded as unidentified.

A NAS-Identifier containing $ or \ cannot be matched by FreeRADIUS; change it. A shared secret containing $ is skipped for the same reason — rotate it. Both cases are listed on Access ▸ Settings ▸ RADIUS with the reason.

An Access-Accept can carry reply attributes set by the application’s rules (Rules tab): a privilege level for a switch, a group name for a firewall, a tunnel address for a VPN. The template’s catalog lists the attributes that device understands, with a description, validation and an optional default; Add from the template picks one, Custom attribute takes any name from the RADIUS dictionary. The same attribute may repeat; attributes are sent in the order listed. A rule without attributes sends a plain Access-Accept.

Values may use the template’s placeholders. Typical examples:

DeviceAttributeExample value
Cisco IOS / IOS-XECisco-AVPairshell:priv-lvl=15
Arista EOSArista-AVPairshell:priv-lvl=15
FortiGateFortinet-Group-Namefgt-admins
MikroTikMikrotik-Groupread
VPNsFramed-IP-Address, Session-Timeout10.8.0.50, 28800

OkYouIn ships the FreeRADIUS dictionary set — 233 files, standard and vendor attributes. Under Access ▸ Settings ▸ RADIUS, Built-in dictionaries lists them; each can be turned off only for the rule attribute picker. FreeRADIUS still loads every file, and existing rules keep working. The core RFC files are locked, and a file whose attributes a rule or template uses cannot be turned off.

For a vendor the built-in set lacks, add your own FreeRADIUS dictionary under Custom dictionaries ▸ Add (paste it or Load file, at most 256 KB):

VENDOR Example 99999
BEGIN-VENDOR Example
ATTRIBUTE Example-Role 1 string
ATTRIBUTE Example-Level 2 integer
VALUE Example-Level Operator 1
VALUE Example-Level Admin 15
END-VENDOR Example

Allowed: VENDOR, BEGIN-VENDOR / END-VENDOR, ATTRIBUTE inside a vendor block, and VALUE. Not allowed: $INCLUDE, flags (encrypted or secret attributes), or a vendor id or attribute name that already exists in another dictionary. Every problem is reported with its line.

A saved dictionary is checked on its own by FreeRADIUS before anything serves it:

StatusMeaning
PendingWaiting for its own radiusd -XC check; not used yet.
AppliedPassed; the RADIUS configuration includes it.
FailedFreeRADIUS refused it (the line is shown); it is left out until fixed or deleted. Other changes apply as usual.

When an edit is pending or failed, the previous version keeps serving. A rule attribute defined only by a dictionary that is not applied yet is refused when you save the rule. An attribute a rule uses cannot be removed from its dictionary.

Applications whose template supports accounting accept Accounting-Request on port 1813 and track sessions: who is connected, from where, for how long, and how much traffic.

  • Interim interval (seconds) (Settings ▸ Accounting) — sent to the device as Acct-Interim-Interval in every Access-Accept. Empty = no Interim-Update. Many devices ignore it and use their own setting; each device guide says which.
  • OkYouIn adds a Class token to the Access-Accept of accounting-capable applications. The device echoes it in its accounting packets, which links each session to the sign-in that started it. If an application rule sends its own Class, that one is used and sessions are linked by user and client address instead.

Sessions appear on the application’s Sessions tab and on Logging ▸ RADIUS sessions (Active / Ended / All), with the user, NAS, client IP, tunnel IP, duration and traffic. A session’s detail shows a timeline (start, authentication, Interim-Updates, stop) and the raw packets, kept for 30 days.

Session statusMeaning
ActiveOpen: Start (or an Interim-Update) received, no Stop yet.
StoppedEnded by an Accounting-Stop, a device restart (Accounting-On / Off closes all of its open sessions), or replaced by a new session with the same ID.
StaleNo update arrived within the expected interval; a later packet reopens it.

Accounting packets that match no application are recorded as Unidentified — usually a device that sends no NAS-Identifier in accounting while its application has one.

Logging ▸ RADIUS log has two tabs.

Requests — every authentication request FreeRADIUS answered: user, application, source, calling station, outcome (Accept, Reject, Challenge), reason, MFA method and duration. The reasons are specific — bad_password, incompatible_method, nas_identifier_mismatch, mfa_timeout, domain_locked… — while the device only gets a generic message such as “Invalid username or password” or “Access denied”: OkYouIn does not tell the caller which account check failed.

Dropped packets — packets FreeRADIUS dropped before authentication, so the device got no answer at all and simply timed out. One row per reason, source and NAS-Identifier, with a hint on what to fix:

ReasonUsual cause
Wrong shared secretThe device and the application have different secrets — or another application whose sources also cover this address took the packet.
Unknown clientNo application has this address among its sources.
Unknown NAS-IdentifierThe device sends a NAS-Identifier no application has.
No Message-AuthenticatorThe application is in Strict mode, or is selected by NAS-Identifier, and the device sent none.
Proxy-State without Message-AuthenticatorRefused in Standard mode (see below).
Status-Server without Message-AuthenticatorA health-check probe that does not sign its packets.
Packet type not accepted on this portAccounting sent to 1812, or authentication to 1813.

Counts are logged drops: FreeRADIUS logs at most one such line a second, so the real number can be higher. An application’s own page also shows the packets dropped for it in the last 24 hours, with a link to this tab.

BlastRADIUS (CVE-2024-3596) lets an attacker in the network path forge an Access-Accept for a request that carries no Message-Authenticator. OkYouIn signs every Access-Accept and Access-Reject it sends; the remaining question is which requests it accepts. That is set per application, under Settings ▸ BlastRADIUS protection ▸ Protection mode (CVE-2024-3596):

ModeBehaviour
OffNo protection: every request is accepted.
Standard (default)A request carrying Proxy-State without a Message-Authenticator is dropped. A device that talks to OkYouIn directly never sends Proxy-State, so nothing it sends is refused.
StrictEvery Access-Request without a Message-Authenticator is dropped. A device that does not send one — often MAB or PAP on older firmware — stops getting in.

The mode applies to every device of the application. Dropped requests are listed on the Dropped packets tab.

Choosing Strict safely: each device guide says whether the device sends Message-Authenticator (Arista EOS, FortiOS, Linux pam_radius, OpenVPN radiusplugin and NPS do; Cisco IOS-XE 17.12 and RouterOS 7.5 do not). For a device not covered, switch to Strict, sign in once, and look at Dropped packets: an entry “No Message-Authenticator” means the device does not send it — switch back to Standard.

SymptomLook at
Device times out, nothing in the RADIUS logDropped packets tab: secret, source, NAS-Identifier, Message-Authenticator. Firewalls between the device and UDP 1812.
”Access denied” right awayRADIUS log reason: nas_identifier_mismatch, deny (no policy rule allows it), no_mfa_method.
Login fails only with MFADevice timeout below 60 s; TOTP on a device without prompts (incompatible_method); mfa_timeout.
Several pushes for one loginThe device retransmits — set its retransmits to 0 — or the client gives up before the push wait ends (OpenVPN hand-window).
Sessions tab stays emptyThe device sends no accounting, sends it to another port, or sends no NAS-Identifier in accounting while the application has one (Unidentified packets).