1 .\" # DS - begin display
13 .TH rlm_sql 5 "5 February 2004" "" "FreeRADIUS Module"
15 rlm_sql \- FreeRADIUS Module
17 The \fIrlm_sql\fP module provides an SQL interface to retrieve
18 authorization information and store accounting information. It can be
19 used in conjunction with, or in lieu of the files and detail modules.
20 The SQL module has drivers to support the following SQL databases:
40 Due to the size of the configuration variables, the sql module is
41 usually configured in a separate file, which is included in the main
42 radiusd.conf via an include directive.
44 The main configuration items to be aware of are:
46 This variable specifies the driver to be loaded.
50 These specify the servername, username, and password the module will
51 use to connect to the database.
53 The name of the database where the radius tables are stored.
56 These specify the tables names for accounting records. acct_table1
57 specifies the table where Start records are stored. acct_table2
58 specifies the table where Stop records are stored. In most cases,
59 this should be the same table.
61 The name of the table to store post-authentication data.
64 The tables where individual Check-Items and Reply-Items are stored.
67 The tables where group Check-Items and Reply-Items are stored.
69 The table where username to group relationships are stored.
70 .IP deletestatlesessions
71 This option is set to 'yes' or 'no'. If you are doing
72 Simultaneous-Use checking, and this is set to yes, stale sessions (
73 defined as sessions for which a Stop record was not received ) will be
76 This option is useful for debugging sql problems. If logfile is set
77 then all sql queries for the containing section are written to the
78 file specified. This is useful for debugging and bulk inserts.
80 The number of sql connections to make to the database.
81 .IP connect_failure_retry_delay
82 The number of seconds to wait before attempting to reconnect to a
83 failed database connection.
85 This is the definition of the SQL-User-Name attribute. This is set
86 once, so that you can use %{SQL-User-Name} in the SQL queries, rather
87 than the nested username substitution. This ensures that Username is
88 parsed consistently for all SQL queries executed.
89 .IP default_user_profile
90 This is the default profile name that will be applied to all users if
91 set. This is not set by default.
92 .IP query_on_not_found
93 This option is set to 'yes' or 'no'. If set to yes, then the default
94 user profile is returned if no specific match was found for the user.
95 .IP authorize_check_query
96 .IP authorize_reply_query
97 These queries are run during the authorization stage to extract the
98 user authorization information from the ${authcheck_table} and
100 .IP authorize_group_check_query
101 .IP authorize_group_reply_query
102 These queries are run during the authorization stage to extract the
103 group authorization information from the ${groupcheck_table} and
105 .IP accounting_onoff_query
106 The query to be run when receiving an Accounting On or Accounting Off
108 .IP accounting_update_query
109 .IP accounting_update_query_alt
110 The query to be run when receiving an Accounting Update packet. If the
111 primary query fails, the alt query is run.
112 .IP accounting_start_query
113 .IP accounting_start_query_alt
114 The query to be run when receiving an Accounting Start packet. If the
115 primary query fails, the alt query is run.
116 .IP accounting_stop_query
117 .IP accounting_stop_query_alt
118 The query to be run when receiving an Accounting Stop packet. If the
119 primary query fails, the alt query is run.
120 .IP simul_count_query
121 The query to be run to return the number simultaneous sessions for the
122 purposes of limiting Simultaneous Use.
123 .IP simul_verify_query
124 The query to return the detail information needed to confirm that all
125 suspected connected sessions are valid, and are not stale sessions.
126 .IP group_membership_query
127 The query to run to check user group membership.
129 The query to run during the post-authentication stage.
132 Due to the size of the configuration for this module, it is not
133 included in this manual page. Please review the supplied
134 configuration files for example queries and configuration details.
139 .BR post-authentication
142 .I /etc/raddb/radiusd.conf,
143 .I /etc/raddb/sql.conf,
144 .I /etc/raddb/sql/<DB>/dialup.conf,
145 .I /etc/raddb/sql/<DB>/schema.sql,
150 .BR radiusd.conf (5),
152 Chris Parker, cparker@segv.org