import from branch_1_1:
[freeradius.git] / raddb / proxy.conf
1 #
2 # proxy.conf - proxy radius and realm configuration directives
3 #
4 # This file is included by default.  To disable it, you will need
5 # to modify the PROXY CONFIGURATION section of "radiusd.conf".
6 #
7 #######################################################################
8 #
9 #  Proxy server configuration
10 #
11 #  This entry controls the servers behaviour towards ALL other servers
12 #  to which it sends proxy requests.
13 #
14 proxy server {
15         #
16         #  Note that as of 2.0, the "synchronous", "retry_delay",
17         #  "retry_count", and "dead_time" have all been deprecated.
18         #  For backwards compatibility, they are are still accepted
19         #  by the server, but they ONLY apply to the old-style realm
20         #  configuration.  i.e. realms with "authhost" and/or "accthost"
21         #  entries.
22         #
23         #  i.e. "retry_delay" and "retry_count" have been replaced
24         #  with per-home-server configuration.  See the "home_server"
25         #  example below for details.
26         #
27         #  i.e. "dead_time" has been replaced with a per-home-server
28         #  "revive_interval".  We strongly recommend that this not
29         #  be used, however.  The new method is much better.
30
31         #
32         #  In 2.0, the server is always "synchronous", and setting
33         #  "synchronous = no" is impossible.  This simplifies the
34         #  server and increases the stability of the network.
35         #
36         #  If you need to set "synchronous = no", please send a
37         #  message to the list <freeradius-users@lists.freeradius.org>
38         #  explaining why this feature is vital for your network.
39
40         #
41         #  If a realm exists, but there are no live home servers for
42         #  it, we can fall back to using the "DEFAULT" realm.  This is
43         #  most useful for accounting, where the server can proxy
44         #  accounting requests to home servers, but if they're down,
45         #  use a DEFAULT realm that is LOCAL (i.e. accthost = LOCAL),
46         #  and then store the packets in the "detail" file.  That data
47         #  can be later proxied to the home servers by radrelay, when
48         #  those home servers come back up again.       
49
50         #  Setting this to "yes" may have issues for authentication.
51         #  i.e. If you are proxying for two different ISP's, and then
52         #  act as a general dial-up for Gric.  If one of the first two
53         #  ISP's has their RADIUS server go down, you do NOT want to
54         #  proxy those requests to GRIC.  Instead, you probably want
55         #  to just drop the requests on the floor.  In that case, set
56         #  this value to 'no'.
57         #
58         #  allowed values: {yes, no}
59         #
60         default_fallback = no
61
62 }
63
64 #######################################################################
65 #
66 #  Configuration for the proxy realms.
67 #
68 #  As of 2.0. the old-style "realms" file is deprecated, and is not
69 #  used by FreeRADIUS.
70 #
71 #  As of 2.0, the "realm" configuration has changed.  Instead of
72 #  specifying "authhost" and "accthost" in a realm section, the home
73 #  servers are specified seperately in a "home_server" section.  For
74 #  backwards compatibility, you can still use the "authhost" and
75 #  "accthost" directives.  If you only have one home server for a
76 #  realm, it is easier to use the old-style configuration.
77 #
78 #  However, if you have multiple servers for a realm, we STRONGLY
79 #  suggest moving to the new-style configuration.
80 #
81 #
82 #  Load-balancing and failover between home servers is handled via
83 #  a "server_pool" section.
84 #
85 #  Finally, The "realm" section defines the realm, some options, and
86 #  indicates which server pool should be used for the realm.
87 #
88 #  This change means that simple configurations now require multiple
89 #  ssections to define a realm.  However, complex configurations
90 #  are much simpler than before, as multiple realms can share the same
91 #  server pool.
92 #
93 #  That is, realms point to server pools, and server pools point to
94 #  home servers.  Multiple realms can point to one server pool.  One
95 #  server pool can point to multiple home servers.  Each home server
96 #  can appear in one or more pools.
97 #
98
99 ######################################################################
100 #
101 #  This section defines a "Home Server" which is another RADIUS
102 #  server that gets sent proxied requests.  In earlier versions
103 #  of FreeRADIUS, home servers were defined in "realm" sections,
104 #  which was awkward.  In 2.0, they have been made independent
105 #  from realms, which is better for a number of reasons.
106 #
107 home_server localhost {
108         #
109         #  Home servers can be sent Access-Request packets
110         #  or Accounting-Request packets.
111         #
112         #  Allowed values are:
113         #       auth      - Handles Access-Request packets
114         #       acct      - Handles Accounting-Request packets
115         #       auth+acct - Handles Access-Request packets at "port",
116         #                   and Accounting-Request packets at "port + 1"
117         type = auth
118
119         #
120         #  Configure ONE OF the following three entries:
121         #
122         #       IPv4 address
123         #
124         ipaddr = 127.0.0.1
125
126         #       OR IPv6 address
127         # ipv6addr = ::1
128
129         #       OR hostname, which will do address detection automatically
130         #
131         #       Note that we do NOT recommend using hostnames, because
132         #       it means that the server has to do a DNS lookup to
133         #       determine the IP address of the home server.  If the
134         #       DNS server is slow or unresponsible, it means that
135         #       FreeRADIUS will NOT be able to determine the IP
136         #       address, and will therefore NOT start.
137         #
138         # hostname = localhost
139
140         #
141         #  The port to which packets are sent.
142         #
143         #  Usually 1812 for type "auth", and  1813 for type "acct".
144         #  Older servers may use 1645 and 1646.
145         #
146         port = 1812
147
148         #
149         #  The shared secret use to "encrypt" and "sign" packets between
150         #  FreeRADIUS and the home server.
151         #
152         #  The secret can be any string, up to 8k characters in length.
153         #
154         #  Control codes can be entered vi octal encoding,
155         #       e.g. "\101\102" == "AB"
156         #  Quotation marks can be entered by escaping them,
157         #       e.g. "foo\"bar"
158         #  Spaces or other "special" characters can be entered
159         #  by putting quotes around the string.
160         #       e.g. "foo bar"
161         #            "foo;bar"
162         #
163         secret = testing123
164
165         ############################################################
166         #
167         #  The rest of the configuration items listed here are optional,
168         #  and do not have to appear in every home server definition.
169         #
170         ############################################################
171
172         #
173         #  If the home server doesn't respond to the request within
174         #  this time, this server will consider the request dead, and
175         #  respond to the NAS with an Access-Reject.
176         #
177         #  Useful range of values: 5 to 60
178         response_window = 20
179
180         #
181         #  If the home server does not respond to ANY packets for
182         #  a certain time, consider it dead.  This time period is
183         #  called the "zombie" period, because the server is neither
184         #  alive nor dead.
185         #
186         #  Useful range of values: 20 to 120
187         zombie_period = 40
188
189         ############################################################
190         #
191         #  As of 2.0, FreeRADIUS supports RADIUS layer "status
192         #  checks".  These are used by a proxy server to see if a home
193         #  server is alive.
194         #
195         #  These status packets are sent ONLY if the proxying server
196         #  believes that the home server is dead.  They are NOT sent
197         #  if the proxying server believes that the home server is
198         #  alive.  They are NOT sent if the proxying server is not
199         #  proxying packets.
200         #
201         #  If the home server responds to the status check packet,
202         #  then it is marked alive again, and is returned to use.
203         #
204         ############################################################
205
206         #
207         #  Some home servers do not support status checks via the
208         #  Status-Server packet.  Others may not have a "test" user
209         #  configured that can be used to query the server, to see if
210         #  it is alive.  For those servers, we have NO WAY of knowing
211         #  when it becomes alive again.  Therefore, after the server
212         #  has been marked dead, we wait a period of time, and mark
213         #  it alive again, in the hope that it has come back to
214         #  life.
215         #
216         #  If it has NOT come back to life, then FreeRADIUS will wait
217         #  for "zombie_period" before marking it dead again.  During
218         #  the "zombie_period", ALL AUTHENTICATIONS WILL FAIL, because
219         #  the home server is still dead.  There is NOTHING that can
220         #  be done about this, other than to enable the status checks,
221         #  as documented below.
222         #
223         #  e.g. if "zombie_period" is 40 seconds, and "revive_interval"
224         #  is 300 seconds, the for 40 seconds out of every 340, or about
225         #  10% of the time, all authentications will fail.
226         #
227         #  If the "zombie_period" and "revive_interval" configurations
228         #  are set smaller, than it is possible for up to 50% of
229         #  authentications to fail.
230         #
231         #  As a result, we recommend enabling status checks, and
232         #  we do NOT recommend using "revive_interval".
233         #
234         #  If the "status_check" entry below is not "none", then the
235         #  "revive_interval" entry can be deleted, as it will not be
236         #  used.
237         #
238         #  Useful range of values: 60 to 3600
239         revive_interval = 120
240
241         #
242         #  The proxying server (i.e. this one) can do periodic status
243         #  checks to see if a dead home server has come back alive.
244         #
245         #  If set to "none", then the other configuration items listed
246         #  below are not used, and the "revive_interval" time is used
247         #  instead.
248         #
249         #  If set to "status-server", the Status-Server packets are
250         #  sent.  Many RADIUS servers support Status-Server.  If a
251         #  server does not support it, please contact the server
252         #  vendor and request that they add it.
253         #
254         #  If set to "request", then Access-Request, or Accounting-Request
255         #  packets are sent, depending on the "type" entry above (auth/acct).
256         #  
257         #  Allowed values: none, status-server, request
258         status_check = status-server
259
260         #
261         #  If the home server does not support Status-Server packets,
262         #  then the server can still send Access-Request or
263         #  Accounting-Request packets, with a pre-defined user name.
264         #
265         #  This practice is NOT recommended, as it may potentially let
266         #  users gain network access by using these "test" accounts!
267         #
268         #  If it is used, we recommend that the home server ALWAYS
269         #  respond to these Access-Request status checks with
270         #  Access-Reject.  The status check just needs an answer, it
271         #  does not need an Access-Accept.
272         #
273         #  For Accounting-Request status checks, only the username
274         #  needs to be set.  The rest of the accounting attribute are
275         #  set to default values.  The home server that receives these
276         #  accounting packets SHOULD NOT treat them like normal user
277         #  accounting packets.  i.e It should probably NOT log them to
278         #  a database.
279         #
280         # username = "test_user_please_reject_me"
281         # password = "this is really secret"
282
283         #
284         #  Configure the interval between sending status check packets.
285         #
286         #  Setting it too low increases the probability of spurious
287         #  fail-over and fallback attempts.
288         #
289         #  Useful range of values: 6 to 120
290         check_interval = 30
291
292         #
293         #  Configure the number of status checks in a row that the
294         #  home server needs to respond to before it is marked alive.
295         #
296         #  If you want to mark a home server as alive after a short
297         #  time period of being responsive, it is best to use a small
298         #  "check_interval", and a large value for
299         #  "num_answers_to_alive".  Using a long "check_interval" and
300         #  a small number for "num_answers_to_alive" increases the
301         #  probability of spurious fail-over and fallback attempts.
302         #
303         #  Useful range of values: 3 to 10
304         num_answers_to_alive = 3
305 }
306
307
308 ######################################################################
309 #
310 #  This section defines a pool of home servers that is used
311 #  for fail-over and load-balancing.  In earlier versions of
312 #  FreeRADIUS, fail-over and load-balancing were defined per-realm.
313 #  As a result, if a server had 5 home servers, each of which served
314 #  the same 10 realms, you would need 50 "realm" entries.
315 #
316 #  In version 2.0, you would need 5 "home_server" sections,
317 #  10 'realm" sections, and one "server_pool" section to tie the
318 #  two together.
319 #
320 server_pool my_auth_failover {
321         #
322         #  The type of this pool controls how home servers are chosen.
323         #
324         #  fail-over - the request is sent to the first live
325         #       home server in the list.  i.e. If the first home server
326         #       is marked "dead", the second one is chosen, etc.
327         #
328         #  load-balance - the least busy home server is chosen,
329         #       where "least busy" is counted by taking the number of
330         #       requests sent to that home server, and subtracting the
331         #       number of responses received from that home server.
332         #
333         #       If there are two or more servers with the same low
334         #       load, then one of those servers is chosen at random.
335         #       This configuration is most similar to the old
336         #       "round-robin" method, though it is not exactly the same.
337         #
338         #       Note that load balancing does not work well with EAP,
339         #       as EAP requires packets for an EAP conversation to be
340         #       sent to the same home server.  The load balancing method
341         #       does not keep state in between packets, meaning that
342         #       EAP packets for the same conversation may be sent to
343         #       different home servers.  This will prevent EAP from
344         #       working.
345         #
346         #       For non-EAP authentication methods, and for accounting
347         #       packets, we recommend using "load-balance".  It will
348         #       ensure the highest availability for your network.
349         #
350         #  client-balance - the home server is chosen by hashing the
351         #       source IP address of the packet.  If that home server
352         #       is down, the next one in the list is used, just as
353         #       with "fail-over".
354         #
355         #       There is no way of predicting which source IP will map
356         #       to which home server.
357         #
358         #       This configuration is most useful to do simple load
359         #       balancing for EAP sessions, as the EAP session will
360         #       always be sent to the same home server.
361         #
362         #  client-port-balance - the home server is chosen by hashing
363         #       the source IP address and source port of the packet.
364         #       If that home server is down, the next one in the list
365         #       is used, just as with "fail-over".
366         #
367         #       This method provides slightly better load balancing
368         #       for EAP sessions than "client-balance".  However, it
369         #       also means that authentication and accounting packets
370         #       for the same session MAY go to different home servers.
371         #
372         type = fail-over
373
374         #
375         #  Next, a list of one or more home servers.  The names
376         #  of the home servers are NOT the hostnames, but the names
377         #  of the sections.  (e.g. home_server foo {...} has name "foo".
378         #
379         #  Note that ALL home servers listed here have to be of the same
380         #  type.  i.e. they all have to be "auth", or they all have to
381         #  be "acct", or the all have to be "auth+acct".
382         #
383         home_server = localhost
384
385         #  Additional home servers can be listed.
386         #  There is NO LIMIT to the number of home servers that can
387         #  be listed, though using more than 10 or so will become
388         #  difficult to manage.
389         #
390         # home_server = foo.example.com
391         # home_server = bar.example.com
392         # home_server = baz.example.com
393         # home_server = ...
394 }
395
396 ######################################################################
397 #
398 #
399 #  This section defines a new-style "realm".  Note the in version 2.0,
400 #  there are many fewer configuration items than in 1.x for a realm.
401 #
402 #  Automatic proxying is done via the "realms" module (see "man
403 #  rlm_realm").  To manually proxy the request put this entry in the
404 #  "users" file:
405
406 #
407 #
408 #DEFAULT        Proxy-To-Realm := "realm_name"
409 #
410 #
411 realm example.com {
412         #
413         #  Realms point to pools of home servers.
414 #
415         #  For authentication, the "auth_pool" configuration item
416         #  should point to a "server_pool" that was previously
417         #  defined.  All of the home servers in the "auth_pool" must
418         #  be of type "auth".
419         #
420         #  For accounting, the "acct_pool" configuration item
421         #  should point to a "server_pool" that was previously
422         #  defined.  All of the home servers in the "acct_pool" must
423         #  be of type "acct".
424         #
425         #  If you have a "server_pool" where all of the home servers
426         #  are of type "auth+acct", you can just use the "pool"
427         #  configuration item, instead of specifying both "auth_pool"
428         #  and "acct_pool".
429
430         auth_pool = my_auth_failover
431 #       acct_pool = acct
432
433         #
434         #  Normally, when an incoming User-Name is matched against the
435         #  realm, the realm name is "stripped" off, and the "stripped"
436         #  user name is used to perform matches.
437         #
438         #  e.g. User-Name = "bob@example.com" will result in two new
439         #  attributes being created by the "realms" module:
440         #
441         #       Stripped-User-Name = "bob"
442         #       Realm = "example.com"
443         #
444         #  The Stripped-User-Name is then used as a key in the "users"
445         #  file, for example.
446         #
447         #  If you do not want this to happen, uncomment "nostrip" below.
448         #
449         # nostrip
450
451         #  There are no more configuration entries for a realm.
452 }
453
454
455 #
456 #  This is a sample entry for iPass.
457 #  Note that you have to define "ipass_auth_pool" and
458 #  "ipass_acct_pool", along with home_servers for them, too.
459 #
460 #realm IPASS {
461 #       nostrip
462 #
463 #       auth_pool = ipass_auth_pool
464 #       acct_pool = ipass_acct_pool
465 #}
466
467 #
468 #  This realm is used mainly to cancel proxying.  You can have
469 #  the "realm suffix" module configured to proxy all requests for
470 #  a realm, and then later cancel the proxying, based on other
471 #  configuration.
472 #
473 #  For example, you want to terminate PEAP or EAP-TTLS locally,
474 #  you can add the following to the "users" file:
475 #
476 #  DEFAULT EAP-Type == PEAP, Proxy-To-Realm := LOCAL
477 #
478 realm LOCAL {
479         #  If we do not specify a server pool, the realm is LOCAL, and
480         #  requests are not proxied to it.
481 }
482
483 #
484 #  This realm is for requests which don't have an explicit realm
485 #  prefix or suffix.  User names like "bob" will match this one.
486 #
487 #realm NULL {
488 #       type            = radius
489 #       authhost        = radius.company.com:1600
490 #       accthost        = radius.company.com:1601
491 #       secret          = testing123
492 #}
493
494 #
495 #  This realm is for ALL OTHER requests.
496 #
497 #realm DEFAULT {
498 #       type            = radius
499 #       authhost        = radius.company.com:1600
500 #       accthost        = radius.company.com:1601
501 #       secret          = testing123
502 #}
503