rlm_expr(5)
rlm_expr(5) β FreeRADIUS Module π β¨
πΈ NAME πΈ
okay so rlm_expr(5) is the manual page for rlm_expr, the FreeRADIUS module that lets the server do limited mathematical calculations. We're folding the manual name in right here like a little name tag: rlm_expr(5) β FreeRADIUS Module. π
β¨ DESCRIPTION β¨
The rlm_expr module lets the server perform limited mathematical calculations. Important vibe check: this module is not called directly in any section β it is invoked through the dynamic expansion of strings. That's the whole entrance, no red carpet.
For example, some NAS boxes send a NAS-Port attribute which is a 32-bit number composed of port, card, and interface, all in different bytes. To see these attributes split into pieces, you can have an entry in the users file like:
DEFAULT
Vendor-Interface = `%{expr: %{NAS-Port} / (256 * 256)}`,
Vendor-Card = `%{expr: (%{NAS-Port} / 256) %% 256}`,
Vendor-Port = `%{expr: %{NAS-Port} %% 256}`
where the attributes Vendor-Interface, Vendor-Card, and Vendor-Port are attributes created by either you or a vendor-supplied dictionary. slay.
The mathematical operators supported by the expression module are:
+β addition-β subtraction/β division%%β modulo remainder*β multiplication&β boolean AND|β boolean OR()β grouping of sub-expressions
NOTE: The modulo remainder operator is%%, and not%. This is due to the%character being used as a special character for dynamic translation. bestie, do not try to swap it, it's giving special-character energy.
NOTE: These operators do NOT have precedence. The parsing of the input string, and the calculation of the answer, is done strictly left to right. If you wish to order the expressions, you MUST group them into sub-expression, as shown in the previous example. literally mandatory grouping behavior.
All of the calculations are performed as unsigned 32-bit integers. no cap.
π CONFIGURATION π
Here's the configuration setup, exactly as it appears:
modules {
...
expr {
}
...
}
...
instantiate {
...
expr
...
}
π¦ SECTIONS π¦
instantiateβ that's the section listed here. iconic. π«Ά
π FILES π
/etc/raddb/radiusd.confβ the file path, exactly like that.
π SEE ALSO π
π AUTHOR π
Chris Parker, cparker@segv.org
π source/version: FreeRADIUS Module β date: 5 February 2004 β manual page: rlm_expr(5) π
π¦ where this page comes from
- alpine 3.22: freeradius-doc 3.0.27-r1 Β· GPL-2.0-or-later
- alpine 3.23: freeradius-doc 3.0.27-r2 Β· GPL-2.0-or-later
- alpine 3.24: freeradius-doc 3.0.27-r3 Β· GPL-2.0-or-later
- arch rolling: freeradius 3.2.10-4 Β· GPL-2.0-or-later
- centos-stream 10: freeradius 3.2.8-2.el10 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- centos-stream 9: freeradius 3.0.27-4.el9 Β· GPLv2+ and LGPLv2+
- fedora 43: freeradius 3.2.7-6.fc43 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- fedora 43: freeradius 3.2.7-6.fc43 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- fedora 43: freeradius 3.2.8-2.fc43 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- fedora 43: freeradius 3.2.8-2.fc43 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- fedora 44: freeradius 3.2.8-3.fc44 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- fedora 44: freeradius 3.2.8-3.fc44 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- opensuse-leap 16.0: freeradius-server 3.2.5-160000.2.2 Β· GPL-2.0-only AND LGPL-2.1-only
- opensuse-leap 16.0: freeradius-server 3.2.5-160000.2.2 Β· GPL-2.0-only AND LGPL-2.1-only
- opensuse-leap 16.0: freeradius-server 3.2.5-160000.2.2 Β· GPL-2.0-only AND LGPL-2.1-only
- opensuse-leap 16.0: freeradius-server 3.2.5-160000.2.2 Β· GPL-2.0-only AND LGPL-2.1-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms