rlm_sql(5)
Okay bestie, welcome to the rlm_sql(5) page β it's the FreeRADIUS Module that gives you SQL energy, and we're gonna vibe through it together π
β¨ NAME β¨
rlm_sql β FreeRADIUS Module π«Ά
π DESCRIPTION π
The rlm_sql module is literally your SQL interface to grab authorization info and stash accounting info. It can be used with the files and detail modules, or in place of them β it's giving flexible, no cap. The SQL module has drivers to support these SQL databases:
db2iodbcmysqloraclepostgresqlsybaseunixodbc
Because the config variables are kinda huge, the sql module is usually set up in its own separate file, which gets included in the main radiusd.conf via an include directive. It's giving main character config file energy β¨
The main config items you need to be aware of are:
driverβ This variable specifies the driver to be loaded. Like, which database flavor you're connecting to πserver,login,passwordβ These specify the servername, username, and password the module will use to connect to the database. Your whole "who am I and where am I going" moment πradius_dbβ The name of the database where the radius tables are stored ποΈacct_table1,acct_table2β These specify the table names for accounting records.acct_table1is the table where Start records are stored.acct_table2is the table where Stop records are stored. In most cases, this should be the same table β like, don't overcomplicate it bestie πpostauth_tableβ The name of the table to store post-authentication data πauthcheck_table,authreply_tableβ The tables where individual Check-Items and Reply-Items are stored πgroupcheck_table,groupreply_tableβ The tables where group Check-Items and Reply-Items are stored πusergroup_tableβ The table where username to group relationships are stored. It's giving social network but for RADIUS πdeletestalesessionsβ This option is set to'yes'or'no'. If you are doing Simultaneous-Use checking, and this is set to yes, stale sessions (defined as sessions for which a Stop record was not received) will be cleared. > Heads up bestie: only flip this on if you're actually doing Simultaneous-Use checking, okay? π«Άlogfileβ This option is useful for debugging sql problems. Iflogfileis set then all sql queries for the containing section are written to the file specified. This is useful for debugging and bulk inserts. It's like a diary for your SQL queries πβ¨num_sql_socksβ The number of sql connections to make to the database. How many besties your module gets to bring to the party π’connect_failure_retry_delayβ The number of seconds to wait before attempting to reconnect to a failed database connection. Like a lil timeout before you try again πsql_user_nameβ This is the definition of theSQL-User-Nameattribute. This is set once, so that you can use%{SQL-User-Name}in the SQL queries, rather than the nested username substitution. This ensures that Username is parsed consistently for all SQL queries executed. Consistency is key, periodt πdefault_user_profileβ This is the default profile name that will be applied to all users if set. This is not set by default, so don't assume it's there πquery_on_not_foundβ This option is set to'yes'or'no'. If set to yes, then the default user profile is returned if no specific match was found for the user. Like a fallback bestie when your main match is missing πauthorize_check_query,authorize_reply_queryβ These queries are run during the authorization stage to extract the user authorization information from the${authcheck_table}and${authreply_table}. Authorization era β¨authorize_group_check_query,authorize_group_reply_queryβ These queries are run during the authorization stage to extract the group authorization information from the${groupcheck_table}and${groupreply_table}. Group chat but make it SQL πaccounting_onoff_queryβ The query to be run when receiving an Accounting On or Accounting Off packet. On or off, no in-between π‘accounting_update_query,accounting_update_query_altβ The query to be run when receiving an Accounting Update packet. If the primary query fails, the alt query is run. Backup plan, slay πaccounting_start_query,accounting_start_query_altβ The query to be run when receiving an Accounting Start packet. If the primary query fails, the alt query is run. Start strong, bestie π₯accounting_stop_query,accounting_stop_query_altβ The query to be run when receiving an Accounting Stop packet. If the primary query fails, the alt query is run. Stop responsibly πsimul_count_queryβ The query to be run to return the number simultaneous sessions for the purposes of limiting Simultaneous Use. Counting besties π―ββοΈsimul_verify_queryβ The query to return the detail information needed to confirm that all suspected connected sessions are valid, and are not stale sessions. Vibe check on your sessions πgroup_membership_queryβ The query to run to check user group membership. Are you in the group chat or not? π¬postauth_queryβ The query to run during the post-authentication stage. After-party query π
πΈ CONFIGURATION πΈ
Due to the size of the configuration for this module, it is not included in this manual page. Please review the supplied configuration files for example queries and configuration details. No cap, the config is too iconic to fit here π
π¦ SECTIONS π¦
authorization, accounting, checksimul, post-authentication β these are the sections bestie, know them, love them.
π FILES π
/etc/raddb/radiusd.conf/etc/raddb/sql.conf/etc/raddb/sql/<DB>/dialup.conf/etc/raddb/sql/<DB>/schema.sql
π₯ SEE ALSO π₯
π AUTHORS π
Chris Parker, cparker@segv.org
That's the whole vibe, bestie! This page is from 5 February 2004 β rlm_sql(5) FreeRADIUS Module, signing off. Go slay those SQL queries πβ¨
π¦ 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