rlm_sql

Synopsis

Configuration for the SQL module. The database schemas and queries are located in subdirectories:

sql/<DB>/main/schema.sql

Schema

sql/<DB>/main/queries.conf

Authorisation and Accounting queries

Where DB is mysql, mssql, oracle, or postgresql.

Processing Sections

Any.

Expansions

None.

Directives

acct_table1
Syntax

acct_table1 = string

Default

radacct

Description

Used in conjunction with acct_table2. If you want both stop and start records logged to the same SQL table, leave the settings identical (default settings). If you want them in different tables, put the start table in acct_table1 and the stop table in acct_table2.

acct_table2
Syntax

acct_table2 = string

Default

radacct

Description

Used in conjunction with acct_table1. If you want both stop and start records logged to the same SQL table, leave the settings identical (default settings). If you want them in different tables, put the start table in acct_table1 and the stop table in acct_table2.

authcheck_table
Syntax

authcheck_table = string

Default

radcheck

Description

In conjunction with groupcheck_table, tables containing check items.

authreply_table
Syntax

authreply_table = string

Default

radreply

Description

In conjunction with groupreply_table, tables containing reply items.

deletestalesessions
Syntax

deletestalesessions = boolean

Default

yes

Description

Removes stale session if checkrad does not see a double login.

dialect
Syntax

dialect = string

Default

mysql

Description

The dialect of SQL you want to use; this should usually match the driver you selected above. If you’re using rlm_sql_null, then it should be the type of database against which the logged queries will be executed.

driver
Syntax

driver = string

Default

rlm_sql_null

Description

The submodule to use to execute queries. This should match the database to which you are attempting to connect: rlm_sql_mysql, rlm_sql_mssql, rlm_sql_oracle, rlm_sql_postgresql, or rlm_sql_null (log queries to disk).

groupcheck_table
Syntax

groupcheck_table = string

Default

radgroupcheck

Description

In conjunction with authcheck_table, tables containing check items.

groupreply_table
Syntax

groupreply_table = string

Default

radgroupreply

Description

In conjunction with authreply_table, tables containing reply items.

login
Syntax

login = string

Default

radius

Description

Connection info.

nas_table
Syntax

nas_table = string

Default

nas

Description

Table in which to keep radius client info.

password
Syntax

password = string

Default

radpass

Description

Connection info.

port
Syntax

port = integer

Default

3306

Description

Connection info.

postauth_table
Syntax

postauth_table = string

Default

radpostauth

Description

Allows for storing data after authentication.

radius_db
Syntax

radius_db = string

Default

radius

Description

Database table configuration for everything except Oracle. If you are using Oracle then use the following default setting for radius_db: "(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=your_sid)))"

readclients
Syntax

readclients = boolean

Default

yes

Description

Set to yes to read radius clients from the database (nas table). Clients will ONLY be read on server startup. For performance and security reasons, finding clients via SQL queries CANNOT be done live while the server is running.

read_groups
Syntax

read_groups = boolean

Default

yes

Description

If set to yes (default) the group tables are read. If set to no, the user MUST have Fall-Through = Yes in the radreply table.

server
Syntax

server = hostname

Default

localhost

Description

Connection info.

sqltrace
Syntax

sqltrace = boolean

Default

no

Description

Prints all SQL statements when in debug mode (-x).

sqltracefile
Syntax

sqltracefile = string

Default

${logdir}/sqltrace.sql

Description

FIXME

usergroup_table
Syntax

usergroup_table = string

Default

radusergroup

Description

Table to keep group info.

pool
Syntax

pool { …​ }

Description

A sub-section which manages connections to the database. See the pool documentation for more information.