Cisco IOS / IOS-XE
This page covers administrative login (SSH and, optionally, the console) on Cisco IOS and IOS-XE with the built-in Cisco IOS / IOS-XE (device administration) template. For how OkYouIn handles RADIUS in general — first-factor modes, prompt modes, identification, BlastRADIUS — see RADIUS.
Verified on
Section titled “Verified on”| Platform | Software | Modes | What was verified |
|---|---|---|---|
| Cisco IOS XE (IOL, virtual) | 17.12.1 | password, password + MFA | TOTP in the SSH keyboard-interactive prompt; exec accounting Start / Stop; Class echoed in accounting; shell:priv-lvl, shell:autocmd, Session-Timeout and Idle-Timeout applied |
Not verified: Interim-Update driven by OkYouIn’s Interim interval, and Accounting-On / Off.
What works
Section titled “What works”| First factor | OkYouIn checks the password only. MFA only is not available (see below). |
| Second factor | TOTP, e-mail code, push (Web Push, Telegram) — the code prompt appears in the same SSH session. |
| Prompts | Yes: IOS shows OkYouIn’s Access-Challenge text as it is, with input hidden. |
| Accounting | Exec Start / Stop with session time and disconnect cause; no byte counters. |
| Client IP | Calling-Station-Id is the SSH client’s address — needs the attribute 31 line below. |
Why there is no MFA-only mode. IOS cannot check its local password and then ask RADIUS for the code
only. A method list such as local group OKYOUIN-GRP never chains: a right local password ends the login
without OkYouIn, a wrong one ends it too (IOS tries the next method only when the user is unknown locally).
Before you start
Section titled “Before you start”-
In OkYouIn, open Access ▸ Applications ▸ Add application and pick Cisco IOS / IOS-XE (device administration). The application gets a generated NAS-Identifier and shared secret; the Connect tab shows the configuration below with those values already filled in.
-
Under Sources, add a network object for the router’s own address. IOS sends no Message-Authenticator in the first Access-Request, so this router must be identified by its source address: it cannot share an address with another application that is told apart by NAS-Identifier only.
-
Keep a console session or out-of-band access available, and keep your current SSH session open until a new login has been tested.
Configure the device
Section titled “Configure the device”The example uses 192.0.2.10 for OkYouIn and vpn-hq stands in for the application’s NAS-Identifier — copy
the real values from the Connect tab. IOS needs an IP address, not a host name. Replace <INTERFACE> with the
interface the router reaches OkYouIn from.
radius server OKYOUIN address ipv4 192.0.2.10 auth-port 1812 acct-port 1813 key <SHARED-SECRET> timeout 60 retransmit 0!aaa group server radius OKYOUIN-GRP server name OKYOUIN ip radius source-interface <INTERFACE>!aaa authentication login OKYOUIN group OKYOUIN-GRP localaaa authorization exec OKYOUIN group OKYOUIN-GRP localaaa accounting exec OKYOUIN start-stop group OKYOUIN-GRPradius-server attribute 32 include-in-access-req format vpn-hqradius-server attribute 32 include-in-accounting-req format vpn-hqradius-server attribute 31 send nas-port-detail!line vty 0 4 login authentication OKYOUIN authorization exec OKYOUIN accounting exec OKYOUIN transport input sshKeep the console on a local method list — it is your recovery path:
aaa authentication login CONSOLE localline con 0 login authentication CONSOLEWhat the less obvious lines do:
timeout 60— a push waits for the user to approve; a shorter timeout fails the login first.attribute 32 … include-in-access-req/include-in-accounting-req— IOS sends no NAS-Identifier by default. Both lines are needed: without the accounting one, IOS sends no NAS-Identifier in Accounting-Request, OkYouIn records those packets as unidentified and no sessions appear.format %hwould send the host name instead — then set the application’s NAS-Identifier to the host name. If the application has no NAS-Identifier (identified by source only), leave both lines out. These lines are global: they apply to every RADIUS server group on the device.attribute 31 send nas-port-detail— without it IOS sends no Calling-Station-Id on SSH logins, and network conditions in your policy cannot match.
The same configuration serves password and password + MFA: MFA is switched on or off in OkYouIn only (Require MFA in the application’s Settings, or per rule).
SSH clients
Section titled “SSH clients”Users must use keyboard-interactive authentication (OpenSSH and PuTTY do by default). With MFA on, IOS answers the plain password method with a code prompt that strict clients reject. An empty answer at the code prompt is sent too and counts as a wrong code. A reject’s message, such as “Too many wrong codes — sign in again”, reaches the SSH client as keyboard-interactive text.
Reply attributes
Section titled “Reply attributes”Set these in the application’s Rules tab. They take effect only with the aaa authorization exec line.
| Attribute | Effect |
|---|---|
Cisco-AVPair = shell:priv-lvl=N | Exec privilege level 0–15 (default in the template: shell:priv-lvl=15). Without it the session starts at level 1. Service-Type Administrative-User alone also gives level 15. |
Cisco-AVPair = shell:autocmd=<command> | A second Cisco-AVPair: runs the command at login, then ends the session. |
Session-Timeout | Ends the SSH session after N seconds even while in use (e.g. 28800). |
Idle-Timeout | Ends the session after N idle seconds (e.g. 1800). |
Class | Echoed in accounting. A Class from a rule replaces OkYouIn’s own Class token; sessions are then linked to the sign-in by user and client address. |
Accounting
Section titled “Accounting”aaa accounting exec OKYOUIN start-stop together with accounting exec OKYOUIN on the vty lines sends
Accounting Start at login and Stop at logout: user, Acct-Session-Id, client address, tty line, session time and
disconnect cause (User-Request, Idle-Timeout, Session-Timeout). There are no byte counters, and failed logins
send no accounting. OkYouIn’s Class token is echoed in every packet and links each session to its sign-in on
the application’s Sessions tab.
Interim-Update is sent only with the global aaa accounting update periodic <MINUTES>, which also adds update
records to every other accounting list on the device (TACACS+ included). Whether IOS honours OkYouIn’s
Interim interval (seconds) has not been verified, so the template leaves it empty.
BlastRADIUS
Section titled “BlastRADIUS”Keep Protection mode (CVE-2024-3596) at Standard, the default. Strict breaks this device: IOS-XE 17.12.1 sends no Message-Authenticator in the first Access-Request, so every login would be dropped.
Verify
Section titled “Verify”-
Open a new SSH session as an OkYouIn user. After the password, enter the code (or approve the push).
-
In OkYouIn, open Logging ▸ RADIUS log: the request shows Accept with the application, source and reason (for example MFA verified).
-
After logging out, the session appears on the application’s Sessions tab (and Logging ▸ RADIUS sessions) with start, end and disconnect cause.
-
Only then save the configuration with
write memory.
Troubleshooting
Section titled “Troubleshooting”| Symptom | Likely cause |
|---|---|
| Login hangs for a minute, then falls back to local | OkYouIn did not answer. Check Logging ▸ RADIUS log ▸ Dropped packets: a wrong shared secret, an unknown client (source address not among the application’s Sources), or a dropped packet without Message-Authenticator (Strict mode). |
Reject with reason nas_identifier_mismatch | The router sends a different NAS-Identifier than the application expects — compare the attribute 32 lines with the Settings tab. |
| No sessions on the Sessions tab | The include-in-accounting-req line is missing, or the accounting lines are not on the vty lines. |
| Session starts at level 1 | No Cisco-AVPair shell:priv-lvl=… in the matching rule, or the aaa authorization exec line is missing. |
| Network conditions never match | The attribute 31 line is missing. |