OpenVPN
This page covers the built-in OpenVPN template: an OpenVPN server that asks OkYouIn through the RADIUS plugin
(radiusplugin). For RADIUS concepts see RADIUS.
Verified on
Section titled “Verified on”| Server | Client | Modes | What was verified |
|---|---|---|---|
| OpenVPN 2.7.0 + radiusplugin 2.1 on Ubuntu 26.04 | OpenVPN Connect 3.8.2; OpenVPN 2.6 CLI | password, MFA only, password + MFA | TOTP through the static challenge; Web Push approval (any character as the response); Push only client prompt (Web Push approve / deny, e-mail links, TOTP user refused, wrong password sends no push); accounting Start / Interim / Stop; Framed-IP-Address and Framed-Route |
Not verified: Telegram with OpenVPN Connect. Byte counters stay 0 with OpenVPN 2.6 or newer (see Accounting).
What works
Section titled “What works”| First factor | OkYouIn checks the password, or MFA only — the client certificate is the first factor and the password field is ignored. |
| Second factor | TOTP and the Web Push offline code typed in the code window; push (Web Push, Telegram) and e-mail with Approve / Deny links. E-mail codes never work with OpenVPN. |
| Prompts | The RADIUS plugin cannot answer an Access-Challenge (it treats it as a reject). A code can only travel in the static challenge, typed together with the password. |
| Accounting | Start / Interim / Stop with session time; see the byte-counter note below. |
| Client IP | Calling-Station-Id is the client’s address. |
Choose the client prompt
Section titled “Choose the client prompt”The application’s Settings tab has a Client prompt field. It decides what the client profile asks for, and the Connect tab shows the matching client lines.
| Client prompt | What users see | Methods |
|---|---|---|
| Code window (default) | Password, then a second field. TOTP: the code. Web Push: the device’s offline code, or any character for the push. Telegram or e-mail links: any character. | Every method except e-mail codes. A profile without the static-challenge line cannot log in with TOTP. |
| Push only | Username and password only. A correct password sends the push; the connection waits for the approval. A wrong password is refused at once and sends no push. | Web Push, Telegram, e-mail with Approve / Deny links. Users whose only method is TOTP are refused (incompatible_method). |
OpenVPN Connect 3.x refuses an empty response in the code window; OkYouIn ignores whatever is typed when the user approves a push.
Configure the server
Section titled “Configure the server”-
In OkYouIn, open Access ▸ Applications ▸ Add application and pick OpenVPN. Add the VPN server’s address under Sources. The Connect tab shows the files below with real values.
-
Install the RADIUS plugin (Debian / Ubuntu: package
openvpn-auth-radius). -
Find the server config your OpenVPN service runs:
systemctl list-units 'openvpn-server@*'showsopenvpn-server@<name>; on Debian / Ubuntu its config is/etc/openvpn/server/<name>.conf. Use that name everywhere below. -
Create
/etc/openvpn/radiusplugin.cnf(example: OkYouIn at192.0.2.10, NAS-Identifiervpn-hq) and make it root-only, since it holds the shared secret:sudo chown root:root /etc/openvpn/radiusplugin.cnf && sudo chmod 600 /etc/openvpn/radiusplugin.cnf.NAS-Identifier=vpn-hqService-Type=5Framed-Protocol=1NAS-Port-Type=5OpenVPNConfig=/etc/openvpn/server/<name>.confoverwriteccfiles=falsenonfatalaccounting=trueuseauthcontrolfile=trueserver{name=192.0.2.10authport=1812acctport=1813sharedsecret=<SHARED-SECRET>retry=1wait=60} -
Add these lines to your existing
/etc/openvpn/server/<name>.conf— do not create a new file, OpenVPN reads only the config its service runs:plugin /usr/lib/openvpn/radiusplugin.so /etc/openvpn/radiusplugin.cnfusername-as-common-name# Push needs time: keep the TLS handshake window above the RADIUS wait.hand-window 90# Renegotiations and reconnects use the session token, not RADIUS.reneg-sec 3600auth-gen-token 0# radiusplugin reads byte counters from this status file (version 1)status /run/openvpn-server/status-<name>.log 10status-version 1 -
Restart and check:
sudo systemctl restart openvpn-server@<name>, thenjournalctl -u openvpn-server@<name>must showradiusplugin.soloading (aPLUGIN_INITline). Without it OpenVPN never asks OkYouIn. -
Add the client lines to every client profile:
auth-user-passstatic-challenge "Code (for a push, type any character)" 1auth-nocache# Wait for the push longer than OkYouIn does (client default: 60 s).hand-window 90auth-user-passauth-nocache# Wait for the push longer than OkYouIn does (client default: 60 s).hand-window 90
Why these settings:
useauthcontrolfile=truedefers the RADIUS request, so the server keeps serving other clients while one user approves a push.- Do not add
requirema=yes. OkYouIn’s Accounting-Response carries no Message-Authenticator, so the plugin would drop it and the client would getAUTH_FAILEDalthough the login was accepted. The default works — every Access-Accept and Access-Reject carries Message-Authenticator. username-as-common-namemakes the typed, MFA-checked username the client’s common name in logs, status and client-config-dir. It does not check that the certificate belongs to that user.reneg-sec 3600withauth-gen-token 0: after the first login the server pushes a session token, and renegotiations and reconnects use it instead of RADIUS — no second code prompt.
Push timing
Section titled “Push timing”The user has Max request time (seconds) (Access ▸ Settings ▸ RADIUS) minus 5 seconds to approve — 55 s at
the default 60. Keep Max request time at or below wait=60 in radiusplugin.cnf, and hand-window 90 above both
in the server config and the client profile. With the client’s default of 60 s the client gives up first and
reconnects, which sends a second push. Raise all three together if users need longer.
MFA only
Section titled “MFA only”With First factor set to MFA only, the client certificate is the first factor and the password field is ignored (any value works). Keep MFA cache (minutes) at 0: a cached MFA would also let another certificate holder behind the same IP log in as that user. When users have a directory or local password, password + MFA is the natural mode, since every OpenVPN client asks for a password anyway.
Returning a tunnel address or a route
Section titled “Returning a tunnel address or a route”| Attribute | Effect |
|---|---|
Framed-IP-Address | Fixed tunnel address for the user (the plugin writes ifconfig-push into the user’s CCD file). |
Framed-Route | A network behind the client (the client is a router), e.g. 192.168.50.0/24 10.8.0.50/32 1: the plugin writes iroute and adds the kernel route itself. It is not a route pushed to the user. |
Both need, in radiusplugin.cnf, overwriteccfiles=true and subnet=<netmask of your server line> (e.g.
subnet=255.255.255.0), and fixed addresses outside the dynamic pool: server <network> <netmask> nopool plus
ifconfig-pool <first> <last> <netmask>. The plugin then overwrites the client-config-dir file of every user it
authenticates — your own CCD content for those users is lost.
Accounting
Section titled “Accounting”radiusplugin sends Accounting Start and Stop to the accounting port; with nonfatalaccounting=true a lost
Accounting-Response does not refuse the login. OkYouIn asks for an Interim-Update every Interim interval
(seconds) (300 by default for this template; empty sends none). Sessions with their timeline are on the
application’s Sessions tab.
Keep the status and status-version 1 lines: radiusplugin reads byte counters from that file and understands
only version 1. With OpenVPN 2.6 or newer, radiusplugin 2.1 still reports 0 bytes (it cannot match the
address format these versions write). Sessions, duration, Interim-Updates and the timeline work; traffic stays 0.
BlastRADIUS
Section titled “BlastRADIUS”radiusplugin 2.1 sends Message-Authenticator in every Access-Request, so Strict is safe and recommended for this application. New applications start at Standard.
Verify
Section titled “Verify”-
Connect with a client profile and complete the code or push.
-
Check Logging ▸ RADIUS log for the Accept and the application’s Sessions tab for the session.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Likely cause |
|---|---|
| OkYouIn never sees a request | The plugin is not loaded (no PLUGIN_INIT in the journal), or the lines went into a config file the service does not run. |
AUTH_FAILED although the log shows Accept | requirema=yes in radiusplugin.cnf. |
| Two pushes for one connection | The client’s hand-window is below the push wait; set hand-window 90 in the profile. |
TOTP user refused (incompatible_method) | Client prompt is Push only; switch to Code window or give the user a push method. |
| Wrong codes and challenges add up | TOTP codes are single-use; each attempt counts toward the per-user limits in Access ▸ Settings ▸ RADIUS. |