rlm_sql(5)

πŸ“¦
version 3.2.10 Β· 4 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, fedora 43, fedora 44, opensuse-leap 16.0

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:

  • db2
  • iodbc
  • mysql
  • oracle
  • postgresql
  • sybase
  • unixodbc

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_table1 is the table where Start records are stored. acct_table2 is 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. If logfile is 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 the SQL-User-Name attribute. 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 πŸ”₯

radiusd(8), radiusd.conf(5)

πŸ‘‘ 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