Moved conditional syntax to %{%{foo}:-%{bar}}, which is more
[freeradius.git] / man / man5 / radrelay.conf.5
1 .TH radrelay.conf 5 "27 May 2005" "" "FreeRADIUS configuration file"
2 .SH NAME
3 radrelay.conf \- configuration file for the FreeRADIUS server "radrelay" personality
4 .SH DESCRIPTION
5 The \fBradrelay.conf\fP file resides in the radius database directory,
6 by default \fB/etc/raddb\fP.  It defines the global configuration for
7 the FreeRADIUS server, when the server is operating as "radrelay".
8 .SH "FILE FORMAT"
9 For a detailed description of the file format, see "man radiusd.conf".
10 The configuration entries are much the same for radrelay.conf, with a
11 few differences as noted here.
12 .SH "REPLICATION FOR BACKUPS"
13 Many sites run multiple radius servers; at least one primary and one
14 backup server. When the primary goes down, most NASes detect that and
15 switch to the backup server.
16
17 That will cause your accounting packets to go the the backup server -
18 and some NASes don't even switch back to the primary server when it
19 comes back up.
20
21 The result is that accounting records are missed, and/or the
22 administrator must jump through hoops in order to combine the
23 different detail files from multiple servers. It also means that the
24 session database ("radutmp", used for radwho and simultaneous use
25 detection) gets out of sync.
26
27 radrelay solves this issue by "relaying" packets from one server to
28 another, so they both have the same set of accounting data.
29 .SH "BUFFERING FOR HIGH-LOAD SERVERS"
30 If the RADIUS server suddenly receives a many accounting packets,
31 there may be insufficient CPU power to process them all in a timely
32 manner.  This problem is especially noticable when the accounting
33 packets are going to a back-end database.
34
35 Similarly, you may have one database that tracks "live" sessions, and
36 another that tracks historical accounting data.  In that case,
37 accessing the first database is fast, as it is small.  Accessing the
38 second database many be slower, as it may contain multiple gigabytes
39 of data.  In addition, writing to the first database in a timely
40 manner is important, while data may be written to the second database
41 with a few minutes delay, without any harm being done.
42 .SH "RELAYING OF ACCOUNTING PACKETS"
43 The \fBradrelay.conf\fP file controls the "radrelay" personality of
44 the server, which can perform both of the functions above at the same
45 time.
46 .SH USAGE
47 First, you should configure the main radius server to log to an extra,
48 single detail file.  This may be done by adding an extra instance of
49 the detail module to \fBradiusd.conf\fP:
50
51 For example:
52
53 .DS
54         detail radrelay-detail {
55 .br
56                 detailfile = ${radacctdir}/radrelay/detail
57 .br
58                 detailperm = 0600
59 .br
60                 dirperm = 0755
61 .br
62                 locking = yes
63 .br
64         }
65 .br
66         ...
67 .br
68         accounting {
69 .br
70                 ...
71 .br
72                 radrelay-detail
73 .br
74                 ...
75 .br
76         }
77 .br
78 .DE
79 This configuration will cause accounting packets to be logged to the
80 \fI${radacctdir}/radrelay/detail\fP file.  This file should not be
81 rotated by standard log rotation scripts, as the \fBradrelay\fP
82 program will read and rotate it.
83 .SH RADRELAY.CONF EXAMPLE
84 See the \fBradrelay.conf\fP file for detailed instructions on
85 configuration entries, what they mean, and how to use them.
86
87 To have the "radrelay" portion of the server read the above detail
88 file, configure \fBradrelay.conf\fP with the following section:
89
90 .DS
91 .br
92         listen {
93 .br
94                 type = detail
95 .br
96                 detail = ${radacctdir}/radrelay/detail
97 .br
98                 max_outstanding = 100
99 .br
100                 identity = radrelay
101 .br
102         }
103 .br
104 .DE
105
106 The server will read the accounting packets from the detail file, and
107 process them just as if it had received them from the NAS.  Therefore,
108 you should configure the "accounting" section of \fBradrelay.conf\fP
109 to write the accounting records to an "sql" module, or to proxy them
110 to another RADIUS server.
111
112 Then, start the server via the following command:
113
114 $ radiusd -n radrelay
115
116 The server should start up, read the detail file, and process
117 accounting packets from it.
118 .SH NOTES
119 The \fBradiusd.conf\fP file is not read at all when the server is
120 running as radrelay.  Please edit \fBradrelay.conf\fP.
121 .SH CREDITS
122 The original "radrelay" program was written by Miquel van Smoorenburg
123 for the Cistron radius project, and ported to FreeRADIUS by Simon
124 Ekstrand.  The "radsqlrelay" was written by Kostas Kalavras.  It was
125 never released as part of an offical FreeRADIUS release, but served as
126 a basis for the design of this implementation.
127 .PP
128 .SH FILES
129 /etc/raddb/radrelay.conf
130 .SH "SEE ALSO"
131 .BR radiusd (8),
132 .BR radiusd.conf (5)
133 .SH AUTHOR
134 Alan DeKok <aland@ox.org>