90 Appendix A: Configuration reference

After this chapter you can:

  • Look up the type, default, whether it is required and the meaning of every rradiusd setting key
  • Tell which keys take effect on reload and which need a restart
  • Know what the server does when you leave out a whole section
  • Recognize the keys and sections that the core does not support or that have no effect in the core

Prerequisites: you have read 04 Configuration file basics and know how to use the configuration file, include and check.

In this chapter:


How to read this reference

This appendix is built from rradiusd schema --lang zh-TW (JSON Schema) and the output of rradiusd config show, checked against rradius-core/src/config.rs and reload.rs to add the defaults and conditions that the schema does not state. After you update the program, trust these two commands on your version:

$ rradiusd schema --lang zh-TW > schema.json
$ rradiusd config show --config rradius.toml
# computed on this machine: radius.sockets = 1, cluster.read_connections = 28
…

config show prints the whole configuration with defaults filled in for the keys you did not write, and shows secrets as <hidden>. The comment on the first line lists the values computed for this machine.

How key names are written

The first column of each table is the full path of the key:

NotationMeaningExample
a.bKey b in the table [a]radius.auth_port
a[].bKey b in each item of the table array [[a]]radius.clients[].secret
a.<name>.bKey b in the sub-table [a.<name>] whose name you choosedatabases.<name>.host
auth.handlers[ldap].bKey b in the kind of [[auth.handlers]] that has type = "ldap"auth.handlers[ldap].urls

Columns

  • Type: string, integer, boolean, IP address, array, table. “Path” is a string; a relative path is always relative to the directory of this configuration file.
  • Default: the value when you leave the key out. “—” means there is no default: leaving the key out means “this setting does not exist”, and the effect is written in the description.
  • Required: “yes” means you must write it whenever this section is present; “conditional” means it is required only under the condition given in the description; blank means it can be left out.
  • reload: “yes” means it takes effect on a SIGHUP reload; “restart” means reload does not apply it, the log lists these keys in these need a restart to apply: …, and you must restart for it to take effect; “command” means only the management commands read it, each time you run the command, and reload has nothing to do with it.
  • Integer units follow the key name: _ms is milliseconds, _seconds is seconds, _bytes is bytes, _mb is MiB, _kib is KiB.

Under the heading of each section, the main chapter is named; detailed usage and examples are in that chapter.


Overview of top-level sections

SectionRequiredWhen left outreloadMain chapter
dictionaryyesCannot be left outrestart06
includeOnly this one file is readyes04
[lua]yescheck fails: the [lua] section is requiredyes (max_memory_mb needs a restart)10
[cluster]yescheck fails: the [cluster] section is requiredrestart16
[metrics]No HTTP port: no /metrics, /livez, /readyz, and the status command cannot read any datarestart17
[log]Level info, format text, auth records writtenrestart (log.trace yes)17
[runtime]No CPU pinningrestart19
[shutdown]A single node does not delay; drain waits at most 5000 msyes04
[accounts]The user command cannot be usedcommand07
[sessions]The session command cannot be usedcommand13
[auth]No auth chain; the script in [lua] decides every loginyes07
[databases.<name>]No external databasesrestart09
[queries.<name>]No named queriesrestart09
[radius]at least one of this and [tacacs]RADIUS is not servedadding or removing the whole section needs a restart05
[tacacs]at least one of this and [radius]TACACS+ is not servedadding or removing the whole section needs a restart12

If neither [radius] nor [tacacs] is present, check fails: at least one of [radius] or [tacacs] must be configured.

No table accepts unknown keys. If you mistype a key, check points to the line number and the keys you can use; see Common mistakes.

The smallest configuration

Write only the required keys, use defaults for everything else, and check passes:

# rradius.toml
dictionary = "share/dictionary"      # main dictionary file, relative to this file

[lua]
script = "auth.lua"                  # the file must exist and compile

[cluster]
data_dir = "data"
secret_raft_file = "raft.secret"     # openssl rand -hex 32 > raft.secret
secret_api_file = "api.secret"       # openssl rand -hex 32 > api.secret

[radius]

[[radius.clients]]
address = "127.0.0.1"
secret_file = "localhost.secret"     # openssl rand -hex 32 > localhost.secret

This configuration listens on ports 1812 and 1813 on all addresses, has no [metrics] (so no /metrics and no status), and has no [auth] (so auth.lua decides every login). rradiusd config init --lang zh-TW produces a starting file with full comments and random secrets, which is easier than starting from here.


Top-level keys: dictionary, include

Main chapters: dictionary is in 06, include is in 04.

KeyTypeDefaultRequiredreloadDescription
dictionarypath—yesrestartThe main file of the RADIUS dictionary, for example /usr/share/rradius/dictionary installed by the package. A relative path is relative to the directory of the configuration file.
includearray (string)—yesOther configuration files to read together with this one, for example ["conf.d/*.toml"]. Their content is treated as if it were appended to the main file.

Rules for include (config.rs):

  • The wildcards * and ? can appear only in the last file name segment, for example conf.d/*.toml; directory names cannot contain wildcards.
  • One name expands in path order; a wildcard does not match file names that start with .; the same file is read only once; the main file itself is skipped.
  • At most 1000 files can be included, each at most 1048576 bytes (1 MiB).
  • An included file must start with a table ([section]) and cannot contain include itself.
  • If the main file already declares a table, an included file cannot declare it again, or you get duplicate key.

lua

Main chapter: 10 Writing policies in Lua.

[lua]

The top-level script that runs for every request, and the resource limits for scripts. These limits also apply to the lua handler in an auth chain.

KeyTypeDefaultRequiredreloadDescription
lua.scriptpath—yesyesThe top-level script that runs for every request. check compiles it.
lua.query_timeout_msinteger5000yesTotal time a script can wait for the database in one request, in milliseconds; must be greater than 0.
lua.max_execution_msinteger1000yesHow long a script can run in one request, in milliseconds; must be greater than 0.
lua.max_memory_mbinteger256restartMemory limit for each Lua VM, in MiB; must be greater than 0.

[lua.http]

Only with this table can scripts call http_request to reach HTTP APIs on the allow list. Without this table the function does not exist.

KeyTypeDefaultRequiredreloadDescription
lua.http.allowed_hostsarray (string)—yesyesHosts that scripts can call, at least one: host, host:port, or http://host to use plain HTTP for that host; all the others use HTTPS.
lua.http.timeout_msinteger2000yesTime limit for one call from connecting to reading the whole response, in milliseconds; must be greater than 0.
lua.http.max_response_bytesinteger1048576yesUpper limit for the response body accepted, in bytes; must be greater than 0.
lua.http.max_concurrentinteger64yesNumber of calls in progress at the same time for each host; must be greater than 0.
lua.http.ca_filepath—yesCA certificates (PEM) to trust in addition to the system root certificates.

cluster

Main chapter: 16 Clusters and high availability. Any change to [cluster] needs a restart.

[cluster]

Node settings for the embedded database (hiqlite, Raft replication). A single server needs this section too: a single server is a cluster with one node.

KeyTypeDefaultRequiredreloadDescription
cluster.data_dirpath—yesrestartData directory for the database and the Raft log.
cluster.node_idinteger1restartThe id of this node, at least 1; it must appear in nodes.
cluster.secret_raftstring—conditionalrestartShared secret of the Raft port, at least 16 characters. Set exactly one of this and secret_raft_file.
cluster.secret_raft_filepath—conditionalrestartFile that holds the Raft secret. Set exactly one of this and secret_raft.
cluster.secret_apistring—conditionalrestartShared secret of the API port, at least 16 characters. Set exactly one of this and secret_api_file.
cluster.secret_api_filepath—conditionalrestartFile that holds the API secret. Set exactly one of this and secret_api.
cluster.listenIP address127.0.0.1 without nodes, 0.0.0.0 with nodesrestartAddress on which the two cluster ports listen. If you have nodes and do not set it, you get a warning; see Common mistakes.
cluster.nodestable array—restartEvery node of the cluster, including this one. The fields are in the next table.
cluster.migrations_dirpath—restartDirectory of SQL files (migrations) applied in order at startup.
cluster.migrations_wait_msinteger60000restartTime limit at startup for waiting for the cluster to be ready, applying migrations and catching up; the three steps are timed separately, in milliseconds; must be greater than 0.
cluster.snapshot_everyinteger100000restartNumber of Raft log entries between two snapshots; must be greater than 0.
cluster.read_connectionsintegertwice the number of worker threads, at most 32 (depends on the machine)restartNumber of connections that read the local database, 1 to 128. The number of worker threads equals the number of CPUs.
cluster.stop_without_leader_msinteger— (always answers)restartAfter this long without a leader, stop answering logins, in milliseconds; must be greater than 0.

[[cluster.nodes]]

KeyTypeDefaultRequiredreloadDescription
cluster.nodes[].idinteger—yesrestartNode id, at least 1.
cluster.nodes[].raftstring—yesrestarthost:port of the Raft port of this node.
cluster.nodes[].apistring—yesrestarthost:port of the API port of this node.

raft and api are ports used between nodes, not management interfaces.


metrics

Main chapter: 17 Monitoring, status and logs.

[metrics]

The HTTP port that serves /metrics, /livez and /readyz opens only if you write this table (even if it is empty); the status command also reads this port.

KeyTypeDefaultRequiredreloadDescription
metrics.bindIP address127.0.0.1restartAddress on which the HTTP port listens.
metrics.portinteger9812restartHTTP port.

log

Main chapter: 17 Monitoring, status and logs.

[log]

KeyTypeDefaultRequiredreloadDescription
log.levelstringinforestartLowest level that is written: error, warn, info or debug.
log.formatstringtextrestartLog format: text or json.
log.authbooleantruerestartWrite one auth record for every authentication.

[log.trace]

For a limited time, write the full requests of some users or clients to the log. It is temporary: you must write minutes, and it stops by itself when the time is up. It takes effect on reload, so you can start or end tracing without a restart.

KeyTypeDefaultRequiredreloadDescription
log.trace.usersarray (string)[]conditionalyesUser-Name values to trace; only exact matches count. users and clients cannot both be empty.
log.trace.clientsarray (string)[]conditionalyesNames of RADIUS clients to trace; each must be a name in [[radius.clients]].
log.trace.minutesinteger—yesyesHow long tracing lasts, 1 to 1440 minutes.

runtime

Main chapter: 19 Performance tuning and load testing.

[runtime]

KeyTypeDefaultRequiredreloadDescription
runtime.pin_threadsbooleanfalserestartPin each worker thread to its own CPU; works only on Linux.

shutdown

Main chapter: 04 Configuration file basics.

[shutdown]

How the server stops after it receives SIGTERM or SIGINT. The configuration in effect at the moment stopping starts is the one that counts, so reload applies it.

KeyTypeDefaultRequiredreloadDescription
shutdown.ready_delay_msinteger0 for a single node, 5000 when cluster.nodes has more than oneyesAfter the stop signal, the time during which /readyz reports that the server is stopping while it still answers requests as usual, in milliseconds, at most 60000. It gives the load balancer time to move traffic away.
shutdown.drain_msinteger5000yesAfter the server stops accepting new requests, how long it waits at most for requests in progress, in milliseconds, at most 60000.

accounts

Main chapter: 07 User accounts and auth chains.

[accounts]

The SQL that the rradiusd user … command runs. ?1 is the account name and ?2 is the password value to store. If you leave out a statement, the matching sub-command cannot be used.

KeyTypeDefaultRequiredreloadDescription
accounts.schemestringbcryptcommandHow user add and user passwd store the password: bcrypt, sha512-crypt, nthash or clear. MS-CHAP and PEAP need nthash; CHAP needs clear.
accounts.addstring—commandSQL that user add runs; ?1 account name, ?2 password value.
accounts.passwdstring—commandSQL that user passwd runs; ?1 account name, ?2 password value.
accounts.enablestring—commandSQL that user enable runs; ?1 account name.
accounts.disablestring—commandSQL that user disable runs; ?1 account name. It has an effect only together with a user_query that skips disabled accounts.
accounts.deletestring—commandSQL that user delete runs; ?1 account name.
accounts.showstring—commandSQL that user show runs and prints as it is; ?1 account name. Do not select the password column.

sessions

Main chapter: 13 Accounting and sessions.

[sessions]

SQL that the rradiusd session … command runs and prints as it is. Both statements can only read: they must start with SELECT or WITH.

KeyTypeDefaultRequiredreloadDescription
sessions.liststring—commandSQL for session list: the sessions that are online now. No parameters.
sessions.showstring—commandSQL for session show: the sessions of one user; ?1 is the user name.

auth

Main chapter: 07 User accounts and auth chains; the ldap and netlogon handlers are in 08 LDAP and Active Directory. All of [auth] can be reloaded.

When [auth] is present, logins go to the auth chain: [[auth.handlers]] is the default chain and [auth.chains.<name>] is a named chain, which a client selects with auth. [auth] must have at least one handler or one named chain, or check fails.

[auth]

KeyTypeDefaultRequiredreloadDescription
auth.policystringfirst_matchyesHow the default chain combines the results of its handlers: first_match uses the first handler that has an answer; all_accept runs every handler, rejects if any one rejects, and needs at least one accept.
auth.handlerstable array—conditionalyesHandlers of the default chain, tried in order. Required when there are no named chains. The fields depend on type; see the tables for each handler below.
auth.allow_mschapv1booleanfalseyesWhether the auth chain handles MS-CHAPv1 logins. When not written or false, MS-CHAPv1 is rejected before any handler runs and does not count toward auth.lockout; PAP, CHAP, MS-CHAPv2 and EAP are not affected.

auth.policy and [auth.username] apply only to the default chain. If you write them without [[auth.handlers]], check fails, for example auth.username is set but the default chain has no [[auth.handlers]] entries; a named chain writes its own policy and username.

[auth.username]

Normalization of the account name before the default chain gives it to the handlers. Without this table, the name is used as it was received.

KeyTypeDefaultRequiredreloadDescription
auth.username.strip_realmstringnoneyesWhich realm to remove: none, suffix (the part from the last @), prefix (the part up to the last backslash, for example REALM\) or both (prefix first, then suffix).
auth.username.lowercasebooleanfalseyesConvert the account name to lower case.
auth.username.allowedstring—yesA regular expression that the whole normalized name must match; a name that does not match is rejected.

[auth.lockout]

Limits login failures. If the same key (account plus source device) fails max_failures times within window_seconds, requests are rejected directly for lock_seconds without checking the password. Without this table, failures are not counted.

KeyTypeDefaultRequiredreloadDescription
auth.lockout.max_failuresinteger10yesHow many failures within the window lock this key; must be greater than 0.
auth.lockout.window_secondsinteger300yesHow long counting lasts from the first failure, in seconds; must be greater than 0.
auth.lockout.lock_secondsinteger300yesHow long the lock lasts, in seconds; must be greater than 0.
auth.lockout.max_entriesinteger100000yesMost keys each node remembers; must be greater than 0. When full, expired ones are dropped first, then the oldest unlocked ones; locked ones are not dropped.
auth.lockout.account_max_failuresinteger— (no total limit per account)yesTotal failures of one account from all sources; when reached, the account is locked for all sources. Must be greater than max_failures.
auth.lockout.max_in_flightinteger5 times max_failuresyesMost logins of the same key that can wait for a decision at the same time; more are rejected directly. Must be greater than 0. The total limit per account scales in proportion to account_max_failures.

Warning: If you set account_max_failures, someone guessing passwords can lock other people’s accounts for all sources just by getting the password wrong on purpose.

[auth.password_limits]

The most computation cost a stored password hash may demand in one comparison. A hash over the limit is not computed and is treated as a wrong password. Every key has a default, so the limits apply even if you do not write this table. Every value must be greater than 0.

KeyTypeDefaultRequiredreloadDescription
auth.password_limits.pbkdf2_iterationsinteger5000000yesUpper limit on iterations for PBKDF2 and X-PBKDF2 hashes.
auth.password_limits.crypt_roundsinteger1000000yesUpper limit on rounds for $5$, $6$, $sha1$ and extended DES (starting with _) crypt hashes.
auth.password_limits.bcrypt_costinteger15yesUpper limit on cost for bcrypt hashes; each +1 doubles the work.
auth.password_limits.argon2_memory_kibinteger262144 (256 MiB)yesUpper limit on memory for argon2 hashes, in KiB. The number of comparisons in progress equals the number of CPUs, so the worst case is about this value times the number of CPUs.
auth.password_limits.argon2_iterationsinteger10yesUpper limit on iterations for argon2 hashes.
auth.password_limits.argon2_lanesinteger16yesUpper limit on parallelism for argon2 hashes.

[[auth.handlers]]: sql handler

type = "sql": looks up the account and password in the cluster database or in one of the [databases.<name>].

KeyTypeDefaultRequiredreloadDescription
auth.handlers[sql].typestring—yesyesAlways sql.
auth.handlers[sql].user_querystring—yesyesSQL that looks up the user, with exactly one ? (the account name); the first column is the stored password.
auth.handlers[sql].reply_querystring—yesSQL that gets the reply attributes, with exactly one ?, returning two columns (attribute, value).
auth.handlers[sql].certificate_querystring—yesQuery used instead after an EAP-TLS certificate passes; if it finds a row, the login is accepted. When not set, user_query is used.
auth.handlers[sql].default_userstring—yesWhen the user is not found, check the password against this account instead; anyone who knows this password passes.
auth.handlers[sql].databasestring— (the cluster database)yesIn which [databases.<name>] to run the queries; the placeholder is still ?.
auth.handlers[sql].timeout_msinteger5000yesTime limit for one query, in milliseconds; must be greater than 0.

[[auth.handlers]]: lua handler

type = "lua": another Lua script decides.

KeyTypeDefaultRequiredreloadDescription
auth.handlers[lua].typestring—yesyesAlways lua.
auth.handlers[lua].scriptpath—yesyesThe script file for this handler.
auth.handlers[lua].verifies_passwordbooleanfalseyesThe script checks the password itself. When true, the chain can have only this handler, and its accept also counts as proof of the password inside EAP.

[[auth.handlers]]: ldap handler

type = "ldap": finds the user in an LDAP directory and checks the password.

KeyTypeDefaultRequiredreloadDescription
auth.handlers[ldap].typestring—yesyesAlways ldap.
auth.handlers[ldap].urlsarray (string)—yesyesServer addresses (ldap:// or ldaps://), at least one, tried in order.
auth.handlers[ldap].bind_dnstring—yesyesThe DN to bind as when searching for users.
auth.handlers[ldap].bind_passwordstring—conditionalyesPassword of bind_dn. Set exactly one of this and bind_password_file.
auth.handlers[ldap].bind_password_filepath—conditionalyesFile that holds the password of bind_dn. Set exactly one of this and bind_password.
auth.handlers[ldap].base_dnstring—yesyesWhere the user search starts.
auth.handlers[ldap].filterstring—yesyesSearch filter that finds the user; {user} is replaced with the escaped account name.
auth.handlers[ldap].certificate_filterstring—yesSearch filter used instead after an EAP-TLS certificate passes; if it finds an entry, the login is accepted.
auth.handlers[ldap].password_checkstringbindyesbind checks the password by binding as the user; attribute compares against the value of password_attribute.
auth.handlers[ldap].password_attributestring—conditionalyesThe attribute that holds the password when password_check = "attribute".
auth.handlers[ldap].reply_attributestable (string to string)—yesKey is the reply attribute name; value is the LDAP attribute of the user that provides the attribute value. Added in the order written.
auth.handlers[ldap].ca_filepath—yesCA certificates trusted for ldaps:// and StartTLS.
auth.handlers[ldap].allow_plaintextbooleanfalseyesAllow ldap:// without StartTLS. The password is sent in clear text.
auth.handlers[ldap].pool_sizeinteger4yesNumber of server connections kept open; must be greater than 0.
auth.handlers[ldap].timeout_msinteger5000yesTime limit for one LDAP query, in milliseconds; must be greater than 0.
auth.handlers[ldap].required_groupsarray (string)— (no group required)yesThe user must belong to one of these groups to be accepted. If written, it needs at least one.
auth.handlers[ldap].group_attributestring—yesThe user attribute that lists the groups the user belongs to, for example memberOf.
auth.handlers[ldap].group_base_dnstring—yesWhere the group search starts when you use group_filter.
auth.handlers[ldap].group_filterstring—yesSearch filter that finds the groups the user belongs to; {dn} is the DN of the user.
auth.handlers[ldap].group_replytable array—yesReply attributes to add when the user belongs to a group. The fields are in the next two rows.
auth.handlers[ldap].group_reply[].groupstring—yesyesThe group that gets these attributes added.
auth.handlers[ldap].group_reply[].attributestable (string to string)—yesThe reply attributes to add, with the attribute name as key. At least one.

[[auth.handlers]]: netlogon handler

type = "netlogon": checks the login through the Netlogon service of an Active Directory domain controller. See 08 for which login methods are supported.

KeyTypeDefaultRequiredreloadDescription
auth.handlers[netlogon].typestring—yesyesAlways netlogon.
auth.handlers[netlogon].domainstring—yesyesNetBIOS name of the domain.
auth.handlers[netlogon].serversarray (string)—yesyesDNS or NetBIOS names of the domain controllers, at least one, tried in order. IP addresses cannot be used: the logon request must carry the name of the DC.
auth.handlers[netlogon].portinteger— (ask the endpoint mapper on port 135 first)yesFixed Netlogon port of the domain controller; must be greater than 0.
auth.handlers[netlogon].computer_namestring—yesyesThe computer account of this node in the domain, without the trailing $, at most 15 characters. Each node uses its own account: nodes that share an account break each other’s secure channel.
auth.handlers[netlogon].machine_password_filepath—yesyesFile that holds the password of the computer account; a trailing newline is removed.
auth.handlers[netlogon].connectionsinteger4yesMost connections kept open to each domain controller; must be greater than 0.
auth.handlers[netlogon].timeout_msinteger2000yesTime limit for one domain controller call, in milliseconds; must be greater than 0.
auth.handlers[netlogon].required_groupsarray (string)— (no group required)yesThe user must belong to one of these groups to be accepted; groups are given as SIDs (S-1-5-21-…). If written, it needs at least one.
auth.handlers[netlogon].group_replytable array—yesReply attributes to add when the user belongs to a group.
auth.handlers[netlogon].group_reply[].groupstring—yesyesThe SID of the group.
auth.handlers[netlogon].group_reply[].attributestable (string to string)—yesThe reply attributes to add, with the attribute name as key. At least one.

[auth.chains.<name>]

A named auth chain. You choose <name>, and a client selects it with auth = "<name>". The fields are the same as the keys of the same name in [auth]; every chain needs at least one handler.

KeyTypeDefaultRequiredreloadDescription
auth.chains.<name>.policystringfirst_matchyesSame as auth.policy.
auth.chains.<name>.handlerstable array—yesyesHandlers of this chain. The four kinds of handler and every key of theirs (including defaults) are exactly the same as auth.handlers[sql], auth.handlers[lua], auth.handlers[ldap] and auth.handlers[netlogon].
auth.chains.<name>.usernametable—yesName normalization of this chain itself; the keys are in the next three rows. Without it, names are not normalized, and [auth.username] is not inherited.
auth.chains.<name>.username.strip_realmstringnoneyesSame as auth.username.strip_realm.
auth.chains.<name>.username.lowercasebooleanfalseyesSame as auth.username.lowercase.
auth.chains.<name>.username.allowedstring—yesSame as auth.username.allowed.

databases

Main chapter: 09 External databases and named queries. Any change to [databases] (including adding one) needs a restart.

[databases.<name>]

An external MySQL or PostgreSQL. You choose <name>; the database key of an sql handler and Lua scripts use the database by this name.

KeyTypeDefaultRequiredreloadDescription
databases.<name>.kindstring—yesrestartmysql or postgresql.
databases.<name>.hoststring—yesrestartHost name or address of the database server; with tls = "verify", the certificate must carry this name.
databases.<name>.portinteger3306 for mysql, 5432 for postgresqlrestartPort of the database server.
databases.<name>.databasestring—yesrestartName of the database to use.
databases.<name>.userstring—yesrestartAccount used to log in to the database.
databases.<name>.passwordstring—restartPassword of user; set at most one of this and password_file. For MySQL with tls = "off", the account must use mysql_native_password.
databases.<name>.password_filepath—restartFile that holds the password; set at most one of this and password.
databases.<name>.tlsstringverifyrestartverify: encrypt and check the certificate chain and the host name; off: no encryption, and a warning is logged when host is not a loopback address.
databases.<name>.ca_filepath— (system root certificates)restartCA certificates (PEM) trusted when tls = "verify".
databases.<name>.pool_sizeinteger8restartMost connections kept to this database, at least 1.
databases.<name>.connect_timeout_msinteger5000restartTime limit for opening one connection, in milliseconds; must be greater than 0.
databases.<name>.required_for_readybooleanfalserestartWhether /readyz returns 503 when this database cannot be reached. Every 5 seconds it runs SELECT 1 on a dedicated connection; two failures in a row count as unreachable, and one success recovers it.

queries

Main chapter: 09 External databases and named queries. Any change to [queries] needs a restart.

[queries.<name>]

Read-only SQL that every node runs periodically in the background; the result becomes samples of the metric rradius_query_<name> (gauge). rradiusd query <name> also runs it.

KeyTypeDefaultRequiredreloadDescription
queries.<name>.sqlstring—yesrestartThe SQL to run. Read-only (starts with SELECT or WITH), with no parameters.
queries.<name>.valuestringvaluerestartThe column that holds the sample value, integer or real; rows where this column is NULL are skipped.
queries.<name>.labelsarray (string)[]restartColumns whose values become sample labels; the label name is the column name. They cannot be numeric columns and cannot repeat.
queries.<name>.helpstringempty string (the output uses a text that contains the query name instead)restartThe HELP text of the metric.
queries.<name>.interval_msinteger30000restartInterval from the start of one run to the start of the next, in milliseconds, at least 5000.
queries.<name>.timeout_msinteger5000restartLongest time for one run, in milliseconds, 1 to interval_ms.
queries.<name>.max_rowsinteger200restartMost rows of one run that become samples, 1 to 10000; extra rows are dropped and counted.

radius

Main chapter: 05 RADIUS service and NAS clients. Tuning of sockets, recv_buffer_bytes and max_*_inflight is in 19; the accounting spool and the accounting log are in 13; [radius.eap] is in 11.

[radius]

KeyTypeDefaultRequiredreloadDescription
radius.bindIP address, or array of IP addresses0.0.0.0restartAddress on which the RADIUS ports listen, one or a list; as an array it needs at least one. Every address opens both the authentication and the accounting port.
radius.auth_portinteger1812restartAuthentication port.
radius.acct_portinteger1813restartAccounting port.
radius.socketsintegerequal to the number of worker threads on Linux, 1 on other platforms (depends on the machine)restartNumber of receiving sockets for each address and port; must be greater than 0. Only Linux can spread packets over several sockets; on other platforms it can only be 1.
radius.recv_buffer_bytesinteger— (system default)restartSO_RCVBUF of each RADIUS socket, in bytes, 4096 to 1073741824.
radius.max_auth_inflightinteger4096restartNumber of authentication requests handled at the same time; extra requests are dropped.
radius.max_acct_inflightinteger4096restartNumber of accounting requests handled at the same time; extra requests are dropped.
radius.status_serverbooleantruerestartAnswer Status-Server requests (RFC 5997).
radius.require_message_authenticatorstringyesyesWhether an Access-Request must have a Message-Authenticator: yes, no, or auto (decided by the first Access-Request from this client after startup). A client can override it.
radius.limit_proxy_statestringyesyesDrop an Access-Request that has Proxy-State but no Message-Authenticator: yes, no or auto. A client can override it.
radius.clientstable array—yesRADIUS clients (NAS) that are allowed to send requests. The fields are in the next section.
radius.coa_timeout_msinteger1000yesNo effect in the core; see Settings the core does not support or that have no effect.
radius.coa_attemptsinteger3yesNo effect in the core; same as above.

[[radius.clients]]

NAS that are allowed to send requests. One item can be one address or one network range. A change to clients (including the shared secret) takes effect on reload.

KeyTypeDefaultRequiredreloadDescription
radius.clients[].addressstring—yesyesIP address or CIDR range of the client, for example 10.0.0.0/24.
radius.clients[].namestringthe value of addressyesName used in logs and metrics; log.trace.clients uses it too.
radius.clients[].secretstring—conditionalyesShared secret. Set exactly one of this and secret_file.
radius.clients[].secret_filepath—conditionalyesFile that holds the shared secret. Set exactly one of this and secret.
radius.clients[].authstring— (the default chain)yesWhich [auth.chains.<name>] this client’s logins use instead.
radius.clients[].require_message_authenticatorstringthe value of radius.require_message_authenticatoryesOverrides the [radius] setting: yes, no or auto.
radius.clients[].limit_proxy_statestringthe value of radius.limit_proxy_stateyesOverrides the [radius] setting: yes, no or auto.
radius.clients[].eap_methodsarray (string)radius.eap.methodsconditionalyesEAP methods offered to this client, in order: tls, peap, ttls. Needs [radius.eap]. When radius.eap.methods has two or more methods, every client must write it; a client that does not use EAP writes [].
radius.clients[].authorize_groupstring—yesFor TACACS+ only; check fails when it is written on a RADIUS client.
radius.clients[].tls_namestring—yesNo effect in the core.
radius.clients[].coa_portinteger3799yesNo effect in the core.
radius.clients[].coa_senderbooleanfalse—Not supported by the core; check fails if you write it.
radius.clients[].max_radsec_connectionsinteger——Not supported by the core; check fails if you write it.
radius.clients[].mfastring——Not supported by the core; check fails if you write it.

For the actual behavior and the error messages of the last five keys, see Settings the core does not support or that have no effect.

[radius.accounting_spool]

When the database cannot be written, accounting requests are first written to the accounting spool on disk (a temporary store that waits for replay) and replayed in order later. Without this table, when the cluster database is briefly unavailable you can only rely on the NAS to retransmit. A change to the whole table needs a restart.

KeyTypeDefaultRequiredreloadDescription
radius.accounting_spool.dirpath—yesrestartDirectory of the temporary store.
radius.accounting_spool.max_bytesinteger1073741824 (1 GiB)restartUpper limit on the size of the store, in bytes; must be greater than 0.
radius.accounting_spool.replay_interval_msinteger5000restartAfter a replay fails, the wait before the next replay, in milliseconds; must be greater than 0.
radius.accounting_spool.replay_windowinteger1restartNumber of entries replayed at the same time, 1 to 1024. The default is 1, strictly in order, because a script may expect the records of one session to arrive in order.

[radius.accounting_log]

For every accounting request answered, append one line of JSON to a local file.

KeyTypeDefaultRequiredreloadDescription
radius.accounting_log.filepath—yesyesFile to append to; its directory must already exist, and if the file exists it must be appendable. The file is reopened on SIGHUP, so it works with log rotation, and you can also reload to switch to another file name.
radius.accounting_log.queueinteger65536restartUpper limit on entries waiting to be written, 1 to 16777216; extra entries are dropped and counted.

Adding or removing the whole [radius.accounting_log] needs a restart.

[radius.eap]

EAP for 802.1X: the server certificate, the methods offered and the limit on unfinished conversations. The whole table takes effect on reload.

KeyTypeDefaultRequiredreloadDescription
radius.eap.methodsarray (string)["tls"]yesEAP methods offered; the first is the method proposed at the start: tls, peap, ttls, at least one. With peap or ttls you need [auth].
radius.eap.cert_filepath—yesyesServer certificate chain (PEM).
radius.eap.key_filepath—yesyesPrivate key of the server certificate (PEM).
radius.eap.client_ca_filepath—conditionalyesThe CA that issues client certificates. Required when methods has tls.
radius.eap.crl_filepath—yesCRL (revocation list) for client certificates; used only for tls.
radius.eap.match_identitybooleantrueyesEAP-TLS: the certificate must correspond to the user in the EAP identity.
radius.eap.fragment_sizeinteger1000yesUpper limit of an EAP fragment, 256 to 1400 bytes.
radius.eap.session_timeout_msinteger30000yesHow long an unfinished EAP conversation is kept, in milliseconds; must be greater than 0.
radius.eap.max_sessionsinteger4096yesNumber of unfinished EAP conversations kept in total.
radius.eap.max_sessions_per_clientinteger1024yesNumber of unfinished EAP conversations kept for each client.
radius.eap.max_sessions_per_deviceinteger4yesNumber of unfinished EAP conversations kept for each device (Calling-Station-Id).
radius.eap.resumption_msinteger——Not supported by the core; check fails if you write it.
radius.eap.shared_ticketsboolean——Not supported by the core; check fails if you write it.
radius.eap.ticket_seal_filepath——Not supported by the core; check fails if you write it.
radius.eap.previous_ticket_seal_filepath——Not supported by the core; check fails if you write it.

tacacs

Main chapter: 12 TACACS+ device administration.

[tacacs]

KeyTypeDefaultRequiredreloadDescription
tacacs.bindIP address0.0.0.0restartAddress on which the TACACS+ port listens.
tacacs.portinteger49restartTACACS+ port (TCP).
tacacs.max_connectionsinteger1024restartNumber of connections open at the same time; extra connections are closed immediately.
tacacs.max_connections_per_sourceinteger64restartNumber of connections open at the same time from one source address; extra connections are closed immediately.
tacacs.max_body_leninteger65536restartUpper limit on the packet body, in bytes; a larger one closes the connection. Must be greater than 0.
tacacs.idle_timeout_msinteger300000restartIf no complete packet arrives within this time, the connection is closed, in milliseconds.
tacacs.enablestringdenyyesHow enable is checked: deny always rejects and does not ask for a password; login treats it as a login, decided by the auth chain or the script.
tacacs.authorize_groupstable{}yesAuthorize groups: a name maps to a list of permit/deny rules, used to authorize commands and services. See the next section.
tacacs.clientstable array—yesTACACS+ clients (devices) that are allowed to connect. The fields are below.

[tacacs.authorize_groups]

Each key is the name of an authorize group, and the value is an array of rule strings, for example:

# conf.d/tacacs.toml
[tacacs.authorize_groups]
ops = ["permit service=shell"]

[[tacacs.clients]]
address = "10.0.0.0/24"
secret_file = "tacacs.secret"   # openssl rand -hex 32 > tacacs.secret
authorize_group = "ops"

A TACACS+ client selects a group with authorize_group = "ops". If [tacacs] is present there must be at least one [[tacacs.clients]], or check fails: [tacacs] is enabled but has no [[tacacs.clients]] entries. If you write a group name that does not exist, check fails. The syntax of the rules is in 12.

[[tacacs.clients]]

The fields of a TACACS+ client share one definition with [[radius.clients]], so the schema lists the same 14 keys; but on a TACACS+ client only the first six are useful, and writing any of the others makes check fail.

KeyTypeDefaultRequiredreloadDescription
tacacs.clients[].addressstring—yesyesIP address or CIDR range of the device.
tacacs.clients[].namestringthe value of addressyesName used in logs and metrics.
tacacs.clients[].secretstring—conditionalyesShared secret. Set exactly one of this and secret_file.
tacacs.clients[].secret_filepath—conditionalyesFile that holds the shared secret. Set exactly one of this and secret.
tacacs.clients[].authstring— (the default chain)yesWhich [auth.chains.<name>] this device’s logins use instead.
tacacs.clients[].authorize_groupstring—yesWhich group in tacacs.authorize_groups supplies the rules that authorize this device.
tacacs.clients[].require_message_authenticatorstring——RADIUS only: check fails.
tacacs.clients[].limit_proxy_statestring——RADIUS only: check fails.
tacacs.clients[].eap_methodsarray (string)——RADIUS only: check fails.
tacacs.clients[].coa_portinteger——RADIUS only: check fails.
tacacs.clients[].coa_senderboolean——RADIUS only: check fails.
tacacs.clients[].max_radsec_connectionsinteger——RADIUS only: check fails.
tacacs.clients[].tls_namestring——Not supported by the core: check fails.
tacacs.clients[].mfastring——Not supported by the core: check fails.

Settings the core does not support or that have no effect

rradiusd and the enterprise edition share the same configuration reader, so some keys appear in the schema of the core but are either rejected or have no effect in the core. The results below were measured one by one with rradiusd check.

Keys that are rejected when written

check exits with code 2 and the messages are as follows (<file> is the path of the configuration file and <name> is the client name):

KeyMessage of check
radius.clients[].coa_sender<file>: radius client '<name>': coa_sender needs RadSec, which needs rradius-enterprise
radius.clients[].max_radsec_connections<file>: radius client '<name>': max_radsec_connections applies only to RadSec, which needs rradius-enterprise
radius.clients[].mfa<file>: radius client '<name>': mfa needs rradius-enterprise
radius.clients[].authorize_group<file>: radius client '<name>': authorize_group applies only to TACACS+ clients
radius.eap.resumption_ms<file>: radius.eap.resumption_ms: not supported by this program (session resumption needs rradius-enterprise)
radius.eap.shared_tickets<file>: radius.eap.shared_tickets: not supported by this program (session resumption needs rradius-enterprise)
radius.eap.ticket_seal_file<file>: radius.eap.ticket_seal_file: not supported by this program (session resumption needs rradius-enterprise)
radius.eap.previous_ticket_seal_file<file>: radius.eap.previous_ticket_seal_file: not supported by this program (session resumption needs rradius-enterprise)
tacacs.clients[].tls_name<file>: tacacs client '<name>': tls_name needs [tacacs.tls] (and [tacacs.tls] is also rejected in the core, see below)
tacacs.clients[].mfa<file>: tacacs client '<name>': mfa needs rradius-enterprise
tacacs.clients[].require_message_authenticator, limit_proxy_state, eap_methods, coa_port, coa_sender, max_radsec_connections<file>: tacacs client '<name>': <key> applies only to RADIUS clients

EAP methods are the same. When radius.eap.methods contains aka-prime, the message is radius.eap.methods: aka-prime is not supported by this program (EAP-AKA' needs rradius-enterprise); when a client’s eap_methods contains aka-prime, it is radius client '<name>': eap_methods: aka-prime is not supported by this program (EAP-AKA' needs rradius-enterprise). When you write sim, both places give 'sim' is not a method this server offers; it has tls, peap and ttls (the client one has radius client '<name>': eap_methods: in front in the same way).

Keys that are accepted but have no effect

check accepts these keys and gives no warning, but the core program never uses them. The core manual does not use them.

KeyDescription
radius.clients[].tls_nameThe name that the enterprise RadSec matches against the client certificate. The core has no RadSec. Written together with address it is accepted but not used; written alone without address, check fails: radius client '<name>' has no address, so it can only use RadSec, which needs rradius-enterprise.
radius.clients[].coa_portThe port the enterprise edition uses when it sends CoA and Disconnect to this client (default 3799). The core does not send CoA.
radius.coa_timeout_msHow long the enterprise edition waits for a reply to each CoA or Disconnect (default 1000 ms).
radius.coa_attemptsHow many times the enterprise edition tries a CoA or Disconnect, including the first (default 3).

Sections rejected by the core (not in the core schema)

These sections and keys are not in the output of rradiusd schema; they belong to the enterprise edition. When the core reads them, check exits with code 2, and the message has the form <section>: not supported by this program (<feature> needs rradius-enterprise):

Section or keyDescription in parentheses
[proxy]proxying needs rradius-enterprise
[mfa]two-factor login needs rradius-enterprise
[diameter]Diameter needs rradius-enterprise
[accounting_export]accounting export needs rradius-enterprise
[cluster.backup]backups need rradius-enterprise
[radius.tls]RadSec needs rradius-enterprise
[radius.coa]CoA needs rradius-enterprise
[radius.dynamic_clients]dynamic clients need rradius-enterprise
[radius.dpsk]DPSK needs rradius-enterprise
[radius.eap.aka]EAP-AKA' needs rradius-enterprise
[accounts.aka]EAP-AKA' needs rradius-enterprise
[accounts.dpsk]DPSK needs rradius-enterprise
[accounts.clients]dynamic clients need rradius-enterprise
[tacacs.tls]TACACS+ over TLS needs rradius-enterprise
radius.eap.ocsp, radius.eap.ocsp_urlOCSP needs rradius-enterprise (methods must have tls; without tls you get radius.eap.ocsp only applies to tls, which methods does not have first)

An actual line looks like this:

$ rradiusd check --config rradius.toml
rradius.toml: proxy: not supported by this program (proxying needs rradius-enterprise)
$ echo $?
2

Common mistakes

A mistyped key name.

  • Symptom: check exits with code 2, for example (in [metrics], port mistyped as prot):

    $ rradiusd check --config rradius.toml
    rradius.toml: line 15: `prot`: unknown field `prot`, expected `bind` or `port`
    
  • Cause: every table rejects unknown keys.

  • Fix: correct it using the line number and the key names in the message, and compare with the tables in this appendix.

A value that is not an allowed option.

  • Symptom: for example auth.policy = "any":

    $ rradiusd check --config rradius.toml
    rradius.toml: line 31: `policy`: unknown variant, expected `first_match` or `all_accept`
    
  • Fix: change it to one of the values the message lists.

An included file declares a table that the main file already has.

  • Symptom: rradius.toml: line 413: duplicate key.
  • Cause: the file in include is treated as appended to the main file, and the same table cannot be declared twice.
  • Fix: move the settings into the table already in the main file, or delete that table from the main file and keep it only in the included file.

A required section or secret is missing.

  • the [lua] section is required, the [cluster] section is required: add that section; see lua and cluster.
  • at least one of [radius] or [tacacs] must be configured: you need at least one of them.
  • exactly one of cluster.secret_api or cluster.secret_api_file must be set: write exactly one of the two keys.
  • radius client '127.0.0.1': exactly one of secret or secret_file must be set: write exactly one of secret and secret_file on the client.
  • radius client '': address is required, or tls_name for a client without a fixed address: add address.

An EAP condition is not met.

  • radius.eap.cert_file is required: [radius.eap] must have cert_file and key_file.
  • radius.eap.client_ca_file is required: when methods has tls, you need client_ca_file.
  • radius.eap.methods has a method whose password only a chain can check, and there is no [auth] section: with peap or ttls you need [auth].
  • radius client 'example': eap_methods is required when radius.eap.methods has more than one method; [] for a client without EAP: write eap_methods on every client.
  • radius client 'example': eap_methods needs [radius.eap]: set up [radius.eap] first.

A warning that the cluster ports listen on all interfaces.

  • Symptom: check and serve print WARN rradius_core::config: cluster.listen is not set, so the cluster's Raft and API ports are on all interfaces, with nothing but their shared secrets to protect them; ….
  • Cause: when you have [[cluster.nodes]] and do not write cluster.listen, it listens on 0.0.0.0 by default.
  • Fix: set cluster.listen to a private address of this node; if you do want all interfaces, write "0.0.0.0" and the warning goes away. See 16 and 20.

You changed the configuration and it did not take effect after reload.

  • Symptom: the log has a message such as configuration reloaded from …; these need a restart to apply: [cluster], radius.auth_port.
  • Cause: the listed keys have “restart” in the reload column of this appendix.
  • Fix: schedule a restart. Until then these keys keep the values they had at startup, and every later reload lists them again.

Enterprise settings put into the core.


Built with Hugo
Theme Stack designed by Jimmy