This section describes the Radiator configuration file and the
statements that control the behaviour of the Radiator server,
radiusd
.
When radiusd
starts, it reads the configuration
file. The default file name and path for the configuration file depends on
the operating system and how Radiator is installed.
- Unix and macOS:
/etc/radiator/radius.cfg
or
radiator.conf
- Windows:
C:\Program Files\Radiator\radius.cfg
or radiator.conf
Radiator deb, RPM and Windows MSI packages use startup configuration
that uses radiator.conf
to be consistent with log
directory, package name and other names.
You can specify an alternate configuration file with radiusd's
-config_file
command line parameter. There is a test
configuration file (radius.cfg
) in the Radiator
distribution that shows most of parameters and clauses that you can use in
a configuration file, and examples of how to use them. There is also a
very simple example (simple.cfg
) in the
goodies/
directory in the Radiator distribution. It
is a good starting point for your own configuration file.
In general terms, the configuration file allows you control the
following things:
- Behaviour of the server in general, including logging
- Which RADIUS clients the server responds to
- Which RADIUS realms the server works with
- Handlers for specifying special ways to handle requests
- For each realm, what methods are used for authenticating users and
storing accounting information
- For each authentication method for each realm, the configuration of
the authentication module
- Custom Perl hooks that are run during the processing of each
request. For more information, see Section 14. Execution sequence and hook processing
The configuration file is an ASCII text file, it can be edited by any
text editor. Leading white space in each line is ignored, so you can use
indentation to make your configuration file easier to read. Case is
important in all parameter names and clauses.
Tip
An alternative to editing the configuration file directly
is to use the ServerHTTP clause (for more information, see
Section 3.121. <ServerHTTP> and
Section 10. Configuring Radiator with GUI) which allows you to
connect to Radiator with standard web browser and examine, change and test
the configuration with an easy to use point and click web
interface.
The configuration file consist of the following things:
- Comment line
The comment line starts with a # as the first
character. Anything including and after the # is ignored. Blank lines
are also ignored. Here is an example:
# This is a comment
CAUTION
Comments that do not start at the beginning of the line
are likely to be taken as part of a parameter value:
SomeParameter xxxxxx # INCORRECT:this is not a comment
- Parameter setting
The first word is the name of the parameter to
set, all the following words and digits are the value to be used for the
parameter. All the parameters you can set in the configuration file are
described in this document. Here is an example:
Trace 4
- Parameter setting from file
Parameter values can be retrieved from
an external file. The line consist of the parameter name and filename,
here is the format:
parameter file:"filename"
This
is a useful feature for putting long parameters, such as a hook, in an
external file. Here is an example that loads the code for
PreAuthHook
from the external file
hook.pl
:
PreAuthHook file:"hook.pl"
- Parameter setting from SQL database query.
Parameter values can be
retrieved from an SQL database. The line consist of the parameter name,
SQL identifier, and SQL query, here is the format:
ParameterName sql:identifier:query
It
looks for a previously defined <AuthBy SQL>
clause with an Identifier and runs the given SQL query. The first row in
the result is used to set the parameter. The SQL database lookup is only
done once at startup time. Here is an example of using the SQL
query:
<AuthBy SQL>
Identifier myidentifier
DBSource dbi:mysql:radius
DBUsername mikem
DBAuth fred
</AuthBy>
Trace sql:myidentifier:select value from configuration where\
name = 'Trace'
- Start or end of clause
A clause is a collection of parameter
settings related to a single feature in the server. The first line in a
clause is surrounded by angle brackets, for example <Client
fred>
, which marks the beginning of the configuration for
client with the DNS name "fred". Subsequent lines are interpreted as
parameter settings for the feature, until the end of the clause is seen.
The end of the clause is surrounded by angle brackets with a slash. Here
is a usage example:
<Client DEFAULT>
# Configuration parameters for the Client go here
.....
</Client>