Notes on new listener "type = proxy"
[freeradius.git] / raddb / radiusd.conf.in
1 # -*- text -*-
2 ##
3 ## radiusd.conf -- FreeRADIUS server configuration file.
4 ##
5 ##      http://www.freeradius.org/
6 ##      $Id$
7 ##
8
9 ######################################################################
10 #
11 #       Read "man radiusd" before editing this file.  See the section
12 #       titled DEBUGGING.  It outlines a method where you can quickly
13 #       obtain the configuration you want, without running into
14 #       trouble.
15 #
16 #       Run the server in debugging mode, and READ the output.
17 #
18 #               $ radiusd -X
19 #
20 #       We cannot emphasize this point strongly enough.  The vast
21 #       majority of problems can be solved by carefully reading the
22 #       debugging output, which includes warnings about common issues,
23 #       and suggestions for how they may be fixed.
24 #
25 #       There may be a lot of output, but look carefully for words like:
26 #       "warning", "error", "reject", or "failure".  The messages there
27 #       will usually be enough to guide you to a solution.
28 #
29 #       If you are going to ask a question on the mailing list, then
30 #       explain what you are trying to do, and include the output from
31 #       debugging mode (radiusd -X).  Failure to do so means that all
32 #       of the responses to your question will be people telling you
33 #       to "post the output of radiusd -X".
34
35 ######################################################################
36 #
37 #       The location of other config files and logfiles are declared
38 #       in this file.
39 #
40 #       Also general configuration for modules can be done in this
41 #       file, it is exported through the API to modules that ask for
42 #       it.
43 #
44 #       See "man radiusd.conf" for documentation on the format of this
45 #       file.  Note that the individual configuration items are NOT
46 #       documented in that "man" page.  They are only documented here,
47 #       in the comments.
48 #
49 #       As of 2.0.0, FreeRADIUS supports a simple processing language
50 #       in the "authorize", "authenticate", "accounting", etc. sections.
51 #       See "man unlang" for details.
52 #
53
54 prefix = @prefix@
55 exec_prefix = @exec_prefix@
56 sysconfdir = @sysconfdir@
57 localstatedir = @localstatedir@
58 sbindir = @sbindir@
59 logdir = @logdir@
60 raddbdir = @raddbdir@
61 radacctdir = @radacctdir@
62
63 #  Location of config and logfiles.
64 confdir = ${raddbdir}
65 run_dir = ${localstatedir}/run/radiusd
66
67 # Should likely be ${localstatedir}/lib/radiusd
68 db_dir = $(raddbdir)
69
70 #
71 # libdir: Where to find the rlm_* modules.
72 #
73 #   This should be automatically set at configuration time.
74 #
75 #   If the server builds and installs, but fails at execution time
76 #   with an 'undefined symbol' error, then you can use the libdir
77 #   directive to work around the problem.
78 #
79 #   The cause is usually that a library has been installed on your
80 #   system in a place where the dynamic linker CANNOT find it.  When
81 #   executing as root (or another user), your personal environment MAY
82 #   be set up to allow the dynamic linker to find the library.  When
83 #   executing as a daemon, FreeRADIUS MAY NOT have the same
84 #   personalized configuration.
85 #
86 #   To work around the problem, find out which library contains that symbol,
87 #   and add the directory containing that library to the end of 'libdir',
88 #   with a colon separating the directory names.  NO spaces are allowed.
89 #
90 #   e.g. libdir = /usr/local/lib:/opt/package/lib
91 #
92 #   You can also try setting the LD_LIBRARY_PATH environment variable
93 #   in a script which starts the server.
94 #
95 #   If that does not work, then you can re-configure and re-build the
96 #   server to NOT use shared libraries, via:
97 #
98 #       ./configure --disable-shared
99 #       make
100 #       make install
101 #
102 libdir = @libdir@
103
104 #  pidfile: Where to place the PID of the RADIUS server.
105 #
106 #  The server may be signalled while it's running by using this
107 #  file.
108 #
109 #  This file is written when ONLY running in daemon mode.
110 #
111 #  e.g.:  kill -HUP `cat /var/run/radiusd/radiusd.pid`
112 #
113 pidfile = ${run_dir}/radiusd.pid
114
115
116 # user/group: The name (or #number) of the user/group to run radiusd as.
117 #
118 #   If these are commented out, the server will run as the user/group
119 #   that started it.  In order to change to a different user/group, you
120 #   MUST be root ( or have root privleges ) to start the server.
121 #
122 #   We STRONGLY recommend that you run the server with as few permissions
123 #   as possible.  That is, if you're not using shadow passwords, the
124 #   user and group items below should be set to 'nobody'.
125 #
126 #    On SCO (ODT 3) use "user = nouser" and "group = nogroup".
127 #
128 #  NOTE that some kernels refuse to setgid(group) when the value of
129 #  (unsigned)group is above 60000; don't use group nobody on these systems!
130 #
131 #  On systems with shadow passwords, you might have to set 'group = shadow'
132 #  for the server to be able to read the shadow password file.  If you can
133 #  authenticate users while in debug mode, but not in daemon mode, it may be
134 #  that the debugging mode server is running as a user that can read the
135 #  shadow info, and the user listed below can not.
136 #
137 #user = nobody
138 #group = nobody
139
140 #  max_request_time: The maximum time (in seconds) to handle a request.
141 #
142 #  Requests which take more time than this to process may be killed, and
143 #  a REJECT message is returned.
144 #
145 #  WARNING: If you notice that requests take a long time to be handled,
146 #  then this MAY INDICATE a bug in the server, in one of the modules
147 #  used to handle a request, OR in your local configuration.
148 #
149 #  This problem is most often seen when using an SQL database.  If it takes
150 #  more than a second or two to receive an answer from the SQL database,
151 #  then it probably means that you haven't indexed the database.  See your
152 #  SQL server documentation for more information.
153 #
154 #  Useful range of values: 5 to 120
155 #
156 max_request_time = 30
157
158 #  cleanup_delay: The time to wait (in seconds) before cleaning up
159 #  a reply which was sent to the NAS.
160 #
161 #  The RADIUS request is normally cached internally for a short period
162 #  of time, after the reply is sent to the NAS.  The reply packet may be
163 #  lost in the network, and the NAS will not see it.  The NAS will then
164 #  re-send the request, and the server will respond quickly with the
165 #  cached reply.
166 #
167 #  If this value is set too low, then duplicate requests from the NAS
168 #  MAY NOT be detected, and will instead be handled as seperate requests.
169 #
170 #  If this value is set too high, then the server will cache too many
171 #  requests, and some new requests may get blocked.  (See 'max_requests'.)
172 #
173 #  Useful range of values: 2 to 10
174 #
175 cleanup_delay = 5
176
177 #  max_requests: The maximum number of requests which the server keeps
178 #  track of.  This should be 256 multiplied by the number of clients.
179 #  e.g. With 4 clients, this number should be 1024.
180 #
181 #  If this number is too low, then when the server becomes busy,
182 #  it will not respond to any new requests, until the 'cleanup_delay'
183 #  time has passed, and it has removed the old requests.
184 #
185 #  If this number is set too high, then the server will use a bit more
186 #  memory for no real benefit.
187 #
188 #  If you aren't sure what it should be set to, it's better to set it
189 #  too high than too low.  Setting it to 1000 per client is probably
190 #  the highest it should be.
191 #
192 #  Useful range of values: 256 to infinity
193 #
194 max_requests = 1024
195
196 #  listen: Make the server listen on a particular IP address, and send
197 #  replies out from that address. This directive is most useful for
198 #  hosts with multiple IP addresses on one interface.
199 #
200 #  If you want the server to listen on additional addresses, or on
201 #  additionnal ports, you can use multiple "listen" sections.
202 #
203 #  Each section make the server listen for only one type of packet,
204 #  therefore authentication and accounting have to be configured in
205 #  different sections.
206 #
207 #  The server ignore all "listen" section if you are using '-i' and '-p'
208 #  on the command line.
209 #
210 listen {
211         #  Type of packets to listen for.
212         #  Allowed values are:
213         #       auth    listen for authentication packets
214         #       acct    listen for accounting packets
215         #       proxy   IP to use for sending proxied packets
216         #
217         type = auth
218
219         #  Note: "type = proxy" lets you control the source IP used for
220         #        proxying packets, with some limitations:
221         #
222         #    * Only ONE proxy listener can be defined.
223         #    * A proxy listener CANNOT be used in a virtual server section.
224         #    * You should probably set "port = 0".
225         #    * Any "clients" configuration will be ignored.
226
227         #  IP address on which to listen.
228         #  Allowed values are:
229         #       dotted quad (1.2.3.4)
230         #       hostname    (radius.example.com)
231         #       wildcard    (*)
232         ipaddr = *
233
234         #  OR, you can use an IPv6 address, but not both
235         #  at the same time.
236 #       ipv6addr = ::   # any.  ::1 == localhost
237
238         #  Port on which to listen.
239         #  Allowed values are:
240         #       integer port number (1812)
241         #       0 means "use /etc/services for the proper port"
242         port = 0
243
244         #  Some systems support binding to an interface, in addition
245         #  to the IP address.  This feature isn't strictly necessary,
246         #  but for sites with many IP addresses on one interface,
247         #  it's useful to say "listen on all addresses for eth0".
248         #
249         #  If your system does not support this feature, you will
250         #  get an error if you try to use it.
251         #
252 #       interface = eth0
253
254         #  Per-socket lists of clients.  This is a very useful feature.
255         #
256         #  The name here is a reference to a section elsewhere in
257         #  radiusd.conf, or clients.conf.  Having the name as
258         #  a reference allows multiple sockets to use the same
259         #  set of clients.
260         #
261         #  If this configuration is used, then the global list of clients
262         #  is IGNORED for this "listen" section.  Take care configuring
263         #  this feature, to ensure you don't accidentally disable a
264         #  client you need.
265         #
266         #  See clients.conf for the configuration of "per_socket_clients".
267         #
268 #       clients = per_socket_clients
269 }
270
271 #  This second "listen" section is for listening on the accounting
272 #  port, too.
273 #
274 listen {
275         ipaddr = *
276 #       ipv6addr = ::
277         port = 0
278         type = acct
279 #       interface = eth0
280 #       clients = per_socket_clients
281 }
282
283 #  hostname_lookups: Log the names of clients or just their IP addresses
284 #  e.g., www.freeradius.org (on) or 206.47.27.232 (off).
285 #
286 #  The default is 'off' because it would be overall better for the net
287 #  if people had to knowingly turn this feature on, since enabling it
288 #  means that each client request will result in AT LEAST one lookup
289 #  request to the nameserver.   Enabling hostname_lookups will also
290 #  mean that your server may stop randomly for 30 seconds from time
291 #  to time, if the DNS requests take too long.
292 #
293 #  Turning hostname lookups off also means that the server won't block
294 #  for 30 seconds, if it sees an IP address which has no name associated
295 #  with it.
296 #
297 #  allowed values: {no, yes}
298 #
299 hostname_lookups = no
300
301 #  Core dumps are a bad thing.  This should only be set to 'yes'
302 #  if you're debugging a problem with the server.
303 #
304 #  allowed values: {no, yes}
305 #
306 allow_core_dumps = no
307
308 #  Regular expressions
309 #
310 #  These items are set at configure time.  If they're set to "yes",
311 #  then setting them to "no" turns off regular expression support.
312 #
313 #  If they're set to "no" at configure time, then setting them to "yes"
314 #  WILL NOT WORK.  It will give you an error.
315 #
316 regular_expressions     = @REGEX@
317 extended_expressions    = @REGEX_EXTENDED@
318
319 #
320 #  Logging section.  The various "log_*" configuration items
321 #  will eventually be moved here.
322 #
323 log {
324         #
325         #  Destination for log messages.  This can be one of:
326         #
327         #       files - log to "file", as defined below.
328         #       syslog - to syslog (see also the "syslog_facility", below.
329         #       stdout - standard output
330         #       stderr - standard error.
331         #
332         #  The command-line option "-X" over-rides this option, and forces
333         #  logging to go to stdout.
334         #
335         destination = files
336
337         #
338         #  The logging messages for the server are appended to the
339         #  tail of this file if ${destination} == "files"
340         #
341         #  If the server is running in debugging mode, this file is
342         #  NOT used.
343         #
344         file = ${logdir}/radius.log
345
346         #
347         #  Which syslog facility to use, if ${destination} == "syslog"
348         #
349         #  The exact values permitted here are OS-dependent.  You probably
350         #  don't want to change this.
351         #
352         syslog_facility = daemon
353
354         #  Log the full User-Name attribute, as it was found in the request.
355         #
356         # allowed values: {no, yes}
357         #
358         stripped_names = no
359
360         #  Log authentication requests to the log file.
361         #
362         #  allowed values: {no, yes}
363         #
364         auth = no
365
366         #  Log passwords with the authentication requests.
367         #  auth_badpass  - logs password if it's rejected
368         #  auth_goodpass - logs password if it's correct
369         #
370         #  allowed values: {no, yes}
371         #
372         auth_badpass = no
373         auth_goodpass = no
374 }
375
376 #  The program to execute to do concurrency checks.
377 checkrad = ${sbindir}/checkrad
378
379 # SECURITY CONFIGURATION
380 #
381 #  There may be multiple methods of attacking on the server.  This
382 #  section holds the configuration items which minimize the impact
383 #  of those attacks
384 #
385 security {
386         #
387         #  max_attributes: The maximum number of attributes
388         #  permitted in a RADIUS packet.  Packets which have MORE
389         #  than this number of attributes in them will be dropped.
390         #
391         #  If this number is set too low, then no RADIUS packets
392         #  will be accepted.
393         #
394         #  If this number is set too high, then an attacker may be
395         #  able to send a small number of packets which will cause
396         #  the server to use all available memory on the machine.
397         #
398         #  Setting this number to 0 means "allow any number of attributes"
399         max_attributes = 200
400
401         #
402         #  reject_delay: When sending an Access-Reject, it can be
403         #  delayed for a few seconds.  This may help slow down a DoS
404         #  attack.  It also helps to slow down people trying to brute-force
405         #  crack a users password.
406         #
407         #  Setting this number to 0 means "send rejects immediately"
408         #
409         #  If this number is set higher than 'cleanup_delay', then the
410         #  rejects will be sent at 'cleanup_delay' time, when the request
411         #  is deleted from the internal cache of requests.
412         #
413         #  Useful ranges: 1 to 5
414         reject_delay = 1
415
416         #
417         #  status_server: Whether or not the server will respond
418         #  to Status-Server requests.
419         #
420         #  When sent a Status-Server message, the server responds with
421         #  an Access-Accept or Accounting-Response packet.
422         #
423         #  This is mainly useful for administrators who want to "ping"
424         #  the server, without adding test users, or creating fake
425         #  accounting packets.
426         #
427         #  It's also useful when a NAS marks a RADIUS server "dead".
428         #  The NAS can periodically "ping" the server with a Status-Server
429         #  packet.  If the server responds, it must be alive, and the
430         #  NAS can start using it for real requests.
431         #
432         status_server = yes
433 }
434
435 # PROXY CONFIGURATION
436 #
437 #  proxy_requests: Turns proxying of RADIUS requests on or off.
438 #
439 #  The server has proxying turned on by default.  If your system is NOT
440 #  set up to proxy requests to another server, then you can turn proxying
441 #  off here.  This will save a small amount of resources on the server.
442 #
443 #  If you have proxying turned off, and your configuration files say
444 #  to proxy a request, then an error message will be logged.
445 #
446 #  To disable proxying, change the "yes" to "no", and comment the
447 #  $INCLUDE line.
448 #
449 #  allowed values: {no, yes}
450 #
451 proxy_requests  = yes
452 $INCLUDE proxy.conf
453
454
455 # CLIENTS CONFIGURATION
456 #
457 #  Client configuration is defined in "clients.conf".  
458 #
459
460 #  The 'clients.conf' file contains all of the information from the old
461 #  'clients' and 'naslist' configuration files.  We recommend that you
462 #  do NOT use 'client's or 'naslist', although they are still
463 #  supported.
464 #
465 #  Anything listed in 'clients.conf' will take precedence over the
466 #  information from the old-style configuration files.
467 #
468 $INCLUDE clients.conf
469
470
471 # SNMP CONFIGURATION
472 #
473 #  Snmp configuration is only valid if SNMP support was enabled
474 #  at compile time.
475 #
476 #  To enable SNMP querying of the server, set the value of the
477 #  'snmp' attribute to 'yes'
478 #
479 snmp    = no
480 $INCLUDE snmp.conf
481
482
483 # THREAD POOL CONFIGURATION
484 #
485 #  The thread pool is a long-lived group of threads which
486 #  take turns (round-robin) handling any incoming requests.
487 #
488 #  You probably want to have a few spare threads around,
489 #  so that high-load situations can be handled immediately.  If you
490 #  don't have any spare threads, then the request handling will
491 #  be delayed while a new thread is created, and added to the pool.
492 #
493 #  You probably don't want too many spare threads around,
494 #  otherwise they'll be sitting there taking up resources, and
495 #  not doing anything productive.
496 #
497 #  The numbers given below should be adequate for most situations.
498 #
499 thread pool {
500         #  Number of servers to start initially --- should be a reasonable
501         #  ballpark figure.
502         start_servers = 5
503
504         #  Limit on the total number of servers running.
505         #
506         #  If this limit is ever reached, clients will be LOCKED OUT, so it
507         #  should NOT BE SET TOO LOW.  It is intended mainly as a brake to
508         #  keep a runaway server from taking the system with it as it spirals
509         #  down...
510         #
511         #  You may find that the server is regularly reaching the
512         #  'max_servers' number of threads, and that increasing
513         #  'max_servers' doesn't seem to make much difference.
514         #
515         #  If this is the case, then the problem is MOST LIKELY that
516         #  your back-end databases are taking too long to respond, and
517         #  are preventing the server from responding in a timely manner.
518         #
519         #  The solution is NOT do keep increasing the 'max_servers'
520         #  value, but instead to fix the underlying cause of the
521         #  problem: slow database, or 'hostname_lookups=yes'.
522         #
523         #  For more information, see 'max_request_time', above.
524         #
525         max_servers = 32
526
527         #  Server-pool size regulation.  Rather than making you guess
528         #  how many servers you need, FreeRADIUS dynamically adapts to
529         #  the load it sees, that is, it tries to maintain enough
530         #  servers to handle the current load, plus a few spare
531         #  servers to handle transient load spikes.
532         #
533         #  It does this by periodically checking how many servers are
534         #  waiting for a request.  If there are fewer than
535         #  min_spare_servers, it creates a new spare.  If there are
536         #  more than max_spare_servers, some of the spares die off.
537         #  The default values are probably OK for most sites.
538         #
539         min_spare_servers = 3
540         max_spare_servers = 10
541
542         #  There may be memory leaks or resource allocation problems with
543         #  the server.  If so, set this value to 300 or so, so that the
544         #  resources will be cleaned up periodically.
545         #
546         #  This should only be necessary if there are serious bugs in the
547         #  server which have not yet been fixed.
548         #
549         #  '0' is a special value meaning 'infinity', or 'the servers never
550         #  exit'
551         max_requests_per_server = 0
552 }
553
554 # MODULE CONFIGURATION
555 #
556 #  The names and configuration of each module is located in this section.
557 #
558 #  After the modules are defined here, they may be referred to by name,
559 #  in other sections of this configuration file.
560 #
561 modules {
562         #
563         #  Each module has a configuration as follows:
564         #
565         #       name [ instance ] {
566         #               config_item = value
567         #               ...
568         #       }
569         #
570         #  The 'name' is used to load the 'rlm_name' library
571         #  which implements the functionality of the module.
572         #
573         #  The 'instance' is optional.  To have two different instances
574         #  of a module, it first must be referred to by 'name'.
575         #  The different copies of the module are then created by
576         #  inventing two 'instance' names, e.g. 'instance1' and 'instance2'
577         #
578         #  The instance names can then be used in later configuration
579         #  INSTEAD of the original 'name'.  See the 'radutmp' configuration
580         #  below for an example.
581         #
582
583         # PAP module to authenticate users based on their stored password
584         #
585         #  Supports multiple encryption/hash schemes.  See "man passwd"
586         #  for details.
587         #
588         #  The "auto_header" configuration item can be set to "yes".
589         #  In this case, the module will look inside of the User-Password
590         #  attribute for the headers {crypt}, {clear}, etc., and will
591         #  automatically create the attribute on the right-hand side,
592         #  with the correct value.  It will also automatically handle
593         #  Base-64 encoded data, hex strings, and binary data.
594         pap {
595                 auto_header = no
596         }
597
598         # CHAP module
599         #
600         #  To authenticate requests containing a CHAP-Password attribute.
601         #
602         chap {
603                 authtype = CHAP
604         }
605
606         # Pluggable Authentication Modules
607         #
608         #  For Linux, see:
609         #       http://www.kernel.org/pub/linux/libs/pam/index.html
610         #
611         #  WARNING: On many systems, the system PAM libraries have
612         #           memory leaks!  We STRONGLY SUGGEST that you do not
613         #           use PAM for authentication, due to those memory leaks.
614         #
615         pam {
616                 #
617                 #  The name to use for PAM authentication.
618                 #  PAM looks in /etc/pam.d/${pam_auth_name}
619                 #  for it's configuration.  See 'redhat/radiusd-pam'
620                 #  for a sample PAM configuration file.
621                 #
622                 #  Note that any Pam-Auth attribute set in the 'authorize'
623                 #  section will over-ride this one.
624                 #
625                 pam_auth = radiusd
626         }
627
628         # Unix /etc/passwd style authentication
629         #
630         unix {
631                 #  As of 1.1.0, the Unix module no longer reads,
632                 #  or caches /etc/passwd, /etc/shadow, or /etc/group.
633                 #  If you wish to cache those files, see the passwd
634                 #  module, above.
635                 #
636
637                 #
638                 #  The location of the "wtmp" file.
639                 #  This should be moved to it's own module soon.
640                 #
641                 #  The only use for 'radlast'.  If you don't use
642                 #  'radlast', then you can comment out this item.
643                 #
644                 radwtmp = ${logdir}/radwtmp
645         }
646
647         #  Extensible Authentication Protocol
648         #
649         #  For all EAP related authentications.
650         #  Now in another file, because it is very large.
651         #
652 $INCLUDE eap.conf
653
654         # Microsoft CHAP authentication
655         #
656         #  This module supports MS-CHAP and MS-CHAPv2 authentication.
657         #  It also enforces the SMB-Account-Ctrl attribute.
658         #
659         mschap {
660                 #
661                 #  As of 0.9, the mschap module does NOT support
662                 #  reading from /etc/smbpasswd.
663                 #
664                 #  If you are using /etc/smbpasswd, see the 'passwd'
665                 #  module for an example of how to use /etc/smbpasswd
666
667                 # if use_mppe is not set to no mschap will
668                 # add MS-CHAP-MPPE-Keys for MS-CHAPv1 and
669                 # MS-MPPE-Recv-Key/MS-MPPE-Send-Key for MS-CHAPv2
670                 #
671                 #use_mppe = no
672
673                 # if mppe is enabled require_encryption makes
674                 # encryption moderate
675                 #
676                 #require_encryption = yes
677
678                 # require_strong always requires 128 bit key
679                 # encryption
680                 #
681                 #require_strong = yes
682
683                 # Windows sends us a username in the form of
684                 # DOMAIN\user, but sends the challenge response
685                 # based on only the user portion.  This hack
686                 # corrects for that incorrect behavior.
687                 #
688                 #with_ntdomain_hack = no
689
690                 # The module can perform authentication itself, OR
691                 # use a Windows Domain Controller.  This configuration
692                 # directive tells the module to call the ntlm_auth
693                 # program, which will do the authentication, and return
694                 # the NT-Key.  Note that you MUST have "winbindd" and
695                 # "nmbd" running on the local machine for ntlm_auth
696                 # to work.  See the ntlm_auth program documentation
697                 # for details.
698                 #
699                 # Be VERY careful when editing the following line!
700                 #
701                 # You can also try setting the user name as:
702                 #
703                 #       ... --username=%{mschap:User-Name} ...
704                 #
705                 # In that case, the mschap module will look at the User-Name
706                 # attribute, and do prefix/suffix checks in order to obtain
707                 # the "best" user name for the request.
708                 #
709                 #ntlm_auth = "/path/to/ntlm_auth --request-nt-key --username=%{Stripped-User-Name:-%{User-Name:-None}} --challenge=%{mschap:Challenge:-00} --nt-response=%{mschap:NT-Response:-00}"
710         }
711
712         # Lightweight Directory Access Protocol (LDAP)
713         #
714         #  This module definition allows you to use LDAP for
715         #  authorization and authentication.
716         #
717         #  See doc/rlm_ldap for description of configuration options 
718         #  and sample authorize{} and authenticate{} blocks 
719         #
720         #  However, LDAP can be used for authentication ONLY when the
721         #  Access-Request packet contains a clear-text User-Password
722         #  attribute.  LDAP authentication will NOT work for any other
723         #  authentication method.
724         #
725         #  This means that LDAP servers don't understand EAP.  If you
726         #  force "Auth-Type = LDAP", and then send the server a
727         #  request containing EAP authentication, then authentication
728         #  WILL NOT WORK.
729         #
730         #  The solution is to use the default configuration, which does
731         #  work.
732         #
733         #  Setting "Auth-Type = LDAP" is ALMOST ALWAYS WRONG.  We
734         #  really can't emphasize this enough.
735         #       
736         ldap {
737                 #
738                 #  Note that this needs to match the name in the LDAP
739                 #  server certificate, if you're using ldaps.
740                 server = "ldap.your.domain"
741                 #identity = "cn=admin,o=My Org,c=UA"
742                 #password = mypass
743                 basedn = "o=My Org,c=UA"
744                 filter = "(uid=%{Stripped-User-Name:-%{User-Name}})"
745                 #base_filter = "(objectclass=radiusprofile)"
746
747                 #  How many connections to keep open to the LDAP server.
748                 #  This saves time over opening a new LDAP socket for
749                 #  every authentication request.
750                 ldap_connections_number = 5
751
752                 # seconds to wait for LDAP query to finish. default: 20
753                 timeout = 4
754
755                 #  seconds LDAP server has to process the query (server-side
756                 #  time limit). default: 20
757                 #
758                 #  LDAP_OPT_TIMELIMIT is set to this value.
759                 timelimit = 3
760
761                 #
762                 #  seconds to wait for response of the server. (network
763                 #   failures) default: 10
764                 #
765                 #  LDAP_OPT_NETWORK_TIMEOUT is set to this value.
766                 net_timeout = 1
767
768                 #
769                 #  This subsection configures the tls related items
770                 #  that control how FreeRADIUS connects to an LDAP
771                 #  server.  It contains all of the "tls_*" configuration
772                 #  entries used in older versions of FreeRADIUS.  Those
773                 #  configuration entries can still be used, but we recommend
774                 #  using these.
775                 #
776                 tls {
777                         # Set this to 'yes' to use TLS encrypted connections
778                         # to the LDAP database by using the StartTLS extended
779                         # operation.
780                         #                       
781                         # The StartTLS operation is supposed to be
782                         # used with normal ldap connections instead of
783                         # using ldaps (port 689) connections
784                         start_tls = no
785
786                         # cacertfile    = /path/to/cacert.pem
787                         # cacertdir             = /path/to/ca/dir/
788                         # certfile              = /path/to/radius.crt
789                         # keyfile               = /path/to/radius.key
790                         # randfile              = /path/to/rnd
791
792                         #  Certificate Verification requirements.  Can be:
793                         #    "never" (don't even bother trying)
794                         #    "allow" (try, but don't fail if the cerificate
795                         #               can't be verified)
796                         #    "demand" (fail if the certificate doesn't verify.)
797                         #
798                         #       The default is "allow"
799                         # require_cert  = "demand"
800                 }
801
802                 # default_profile = "cn=radprofile,ou=dialup,o=My Org,c=UA"
803                 # profile_attribute = "radiusProfileDn"
804                 # access_attr = "dialupAccess"
805
806                 # Mapping of RADIUS dictionary attributes to LDAP
807                 # directory attributes.
808                 dictionary_mapping = ${confdir}/ldap.attrmap
809
810                 #  Set password_attribute = nspmPassword to get the
811                 #  user's password from a Novell eDirectory
812                 #  backend. This will work ONLY IF FreeRADIUS has been
813                 #  built with the --with-edir configure option.
814                 #
815                 # password_attribute = userPassword
816
817                 #  Un-comment the following to disable Novell
818                 #  eDirectory account policy check and intruder
819                 #  detection. This will work *only if* FreeRADIUS is
820                 #  configured to build with --with-edir option.
821                 #
822                 edir_account_policy_check = no
823
824                 #
825                 #  Group membership checking.  Disabled by default.
826                 #
827                 # groupname_attribute = cn
828                 # groupmembership_filter = "(|(&(objectClass=GroupOfNames)(member=%{Ldap-UserDn}))(&(objectClass=GroupOfUniqueNames)(uniquemember=%{Ldap-UserDn})))"
829                 # groupmembership_attribute = radiusGroupName
830
831                 # compare_check_items = yes
832                 # do_xlat = yes
833                 # access_attr_used_for_allow = yes
834
835                 #
836                 #  By default, if the packet contains a User-Password,
837                 #  and no other module is configured to handle the
838                 #  authentication, the LDAP module sets itself to do
839                 #  LDAP bind for authentication.
840                 #
841                 #  THIS WILL ONLY WORK FOR PAP AUTHENTICATION.
842                 #
843                 #  THIS WILL NOT WORK FOR CHAP, MS-CHAP, or 802.1x (EAP). 
844                 #
845                 #  You can disable this behavior by setting the following
846                 #  configuration entry to "no".
847                 #
848                 #  allowed values: {no, yes}
849                 # set_auth_type = yes
850
851                 #  ldap_debug: debug flag for LDAP SDK
852                 #  (see OpenLDAP documentation).  Set this to enable
853                 #  huge amounts of LDAP debugging on the screen.
854                 #  You should only use this if you are an LDAP expert.
855                 #
856                 #       default: 0x0000 (no debugging messages)
857                 #       Example:(LDAP_DEBUG_FILTER+LDAP_DEBUG_CONNS)
858                 #ldap_debug = 0x0028 
859         }
860
861         # passwd module allows to do authorization via any passwd-like
862         # file and to extract any attributes from these modules
863         #
864         # parameters are:
865         #   filename - path to filename
866         #   format - format for filename record. This parameters
867         #            correlates record in the passwd file and RADIUS
868         #            attributes.
869         #
870         #            Field marked as '*' is key field. That is, the parameter
871         #            with this name from the request is used to search for
872         #            the record from passwd file
873         #            Attribute marked as '=' is added to reply_itmes instead
874         #            of default configure_itmes
875         #            Attribute marked as '~' is added to request_items
876         #
877         #            Field marked as ',' may contain a comma separated list
878         #            of attributes.
879         #   hashsize - hashtable size. If 0 or not specified records are not
880         #            stored in memory and file is red on every request.
881         #   allowmultiplekeys - if few records for every key are allowed
882         #   ignorenislike - ignore NIS-related records
883         #   delimiter - symbol to use as a field separator in passwd file,
884         #            for format ':' symbol is always used. '\0', '\n' are
885         #            not allowed 
886         #
887
888         #  An example configuration for using /etc/smbpasswd.
889         #
890         #passwd etc_smbpasswd {
891         #       filename = /etc/smbpasswd
892         #       format = "*User-Name::LM-Password:NT-Password:SMB-Account-CTRL-TEXT::"
893         #       hashsize = 100
894         #       ignorenislike = no
895         #       allowmultiplekeys = no
896         #}
897
898         #  Similar configuration, for the /etc/group file. Adds a Group-Name
899         #  attribute for every group that the user is member of.
900         #
901         #passwd etc_group {
902         #       filename = /etc/group
903         #       format = "=Group-Name:::*,User-Name"
904         #       hashsize = 50
905         #       ignorenislike = yes
906         #       allowmultiplekeys = yes
907         #       delimiter = ":"
908         #}
909
910         # Realm module, for proxying.
911         #
912         #  You can have multiple instances of the realm module to
913         #  support multiple realm syntaxs at the same time.  The
914         #  search order is defined by the order in the authorize and
915         #  preacct sections.
916         #
917         #  Four config options:
918         #       format         -  must be "prefix" or "suffix"
919         #                         The special cases of "DEFAULT"
920         #                         and "NULL" are allowed, too.
921         #       delimiter      -  must be a single character
922
923         #  'realm/username'
924         #
925         #  Using this entry, IPASS users have their realm set to "IPASS".
926         realm IPASS {
927                 format = prefix
928                 delimiter = "/"
929         }
930
931         #  'username@realm'
932         #
933         realm suffix {
934                 format = suffix
935                 delimiter = "@"
936         }
937
938         #  'username%realm'
939         #
940         realm realmpercent {
941                 format = suffix
942                 delimiter = "%"
943         }
944
945         #
946         #  'domain\user'
947         #
948         realm ntdomain {
949                 format = prefix
950                 delimiter = "\\"
951         }       
952
953         #  A simple value checking module
954         #
955         #  It can be used to check if an attribute value in the request
956         #  matches a (possibly multi valued) attribute in the check
957         #  items This can be used for example for caller-id
958         #  authentication.  For the module to run, both the request
959         #  attribute and the check items attribute must exist
960         #
961         #  i.e.
962         #  A user has an ldap entry with 2 radiusCallingStationId
963         #  attributes with values "12345678" and "12345679".  If we
964         #  enable rlm_checkval, then any request which contains a
965         #  Calling-Station-Id with one of those two values will be
966         #  accepted.  Requests with other values for
967         #  Calling-Station-Id will be rejected.
968         #
969         #  Regular expressions in the check attribute value are allowed
970         #  as long as the operator is '=~'
971         #
972         checkval {
973                 # The attribute to look for in the request
974                 item-name = Calling-Station-Id
975
976                 # The attribute to look for in check items. Can be multi valued
977                 check-name = Calling-Station-Id
978
979                 # The data type. Can be
980                 # string,integer,ipaddr,date,abinary,octets
981                 data-type = string
982
983                 # If set to yes and we dont find the item-name attribute in the
984                 # request then we send back a reject
985                 # DEFAULT is no
986                 #notfound-reject = no
987         }
988         
989         #  rewrite arbitrary packets.  Useful in accounting and authorization.
990         #
991         #
992         #  The module can also use the Rewrite-Rule attribute. If it
993         #  is set and matches the name of the module instance, then
994         #  that module instance will be the only one which runs.
995         #
996         #  Also if new_attribute is set to yes then a new attribute
997         #  will be created containing the value replacewith and it
998         #  will be added to searchin (packet, reply, proxy,
999         #  proxy_reply or config).
1000         #
1001         # searchfor,ignore_case and max_matches will be ignored in that case.
1002         #
1003         # Backreferences are supported.
1004         #       %{0} will contain the string the whole match
1005         #       %{1} to %{8} will contain the contents of the 1st to
1006         #       the 8th parentheses
1007         #
1008         # If max_matches is greater than one, the backreferences will
1009         # correspond to the first attributed that matched.
1010
1011         #
1012         #attr_rewrite sanecallerid {
1013         #       attribute = Called-Station-Id
1014                 # may be "packet", "reply", "proxy", "proxy_reply" or "config"
1015         #       searchin = packet
1016         #       searchfor = "[+ ]"
1017         #       replacewith = ""
1018         #       ignore_case = no
1019         #       new_attribute = no
1020         #       max_matches = 10
1021         #
1022         #       ## If set to yes then the replace string will be
1023         #       ## appended to the original string
1024         #       append = no
1025         #}
1026
1027         # Preprocess the incoming RADIUS request, before handing it off
1028         # to other modules.
1029         #
1030         #  This module processes the 'huntgroups' and 'hints' files.
1031         #  In addition, it re-writes some weird attributes created
1032         #  by some NASes, and converts the attributes into a form which
1033         #  is a little more standard.
1034         #
1035         preprocess {
1036                 huntgroups = ${confdir}/huntgroups
1037                 hints = ${confdir}/hints
1038
1039                 # This hack changes Ascend's wierd port numberings
1040                 # to standard 0-??? port numbers so that the "+" works
1041                 # for IP address assignments.
1042                 with_ascend_hack = no
1043                 ascend_channels_per_line = 23
1044
1045                 # Windows NT machines often authenticate themselves as
1046                 # NT_DOMAIN\username
1047                 #
1048                 # If this is set to 'yes', then the NT_DOMAIN portion
1049                 # of the user-name is silently discarded.
1050                 #
1051                 # This configuration entry SHOULD NOT be used.
1052                 # See the "realms" module for a better way to handle
1053                 # NT domains.
1054                 with_ntdomain_hack = no
1055
1056                 # Specialix Jetstream 8500 24 port access server.
1057                 #
1058                 # If the user name is 10 characters or longer, a "/"
1059                 # and the excess characters after the 10th are
1060                 # appended to the user name.
1061                 #
1062                 # If you're not running that NAS, you don't need
1063                 # this hack.
1064                 with_specialix_jetstream_hack = no
1065
1066                 # Cisco (and Quintum in Cisco mode) sends it's VSA attributes
1067                 # with the attribute name *again* in the string, like:
1068                 #
1069                 #   H323-Attribute = "h323-attribute=value".
1070                 #
1071                 # If this configuration item is set to 'yes', then
1072                 # the redundant data in the the attribute text is stripped
1073                 # out.  The result is:
1074                 #
1075                 #  H323-Attribute = "value"
1076                 #
1077                 # If you're not running a Cisco or Quintum NAS, you don't
1078                 # need this hack.
1079                 with_cisco_vsa_hack = no
1080         }
1081
1082         # Livingston-style 'users' file
1083         #
1084         files {
1085                 # The default key attribute to use for matches.  The content
1086                 # of this attribute is used to match the "name" of the
1087                 # entry.
1088                 #key = "%{Stripped-User-Name:-%{User-Name}}"
1089
1090                 usersfile = ${confdir}/users
1091                 acctusersfile = ${confdir}/acct_users
1092                 preproxy_usersfile = ${confdir}/preproxy_users
1093
1094                 #  If you want to use the old Cistron 'users' file
1095                 #  with FreeRADIUS, you should change the next line
1096                 #  to 'compat = cistron'.  You can the copy your 'users'
1097                 #  file from Cistron.
1098                 compat = no
1099         }
1100
1101         # Write a detailed log of all accounting records received.
1102         #
1103         detail {
1104                 #  Note that we do NOT use NAS-IP-Address here, as
1105                 #  that attribute MAY BE from the originating NAS, and
1106                 #  NOT from the proxy which actually sent us the
1107                 #  request.  The Client-IP-Address attribute is ALWAYS
1108                 #  the address of the client which sent us the
1109                 #  request.
1110                 #
1111                 #  The following line creates a new detail file for
1112                 #  every radius client (by IP address or hostname).
1113                 #  In addition, a new detail file is created every
1114                 #  day, so that the detail file doesn't have to go
1115                 #  through a 'log rotation'
1116                 #
1117                 #  If your detail files are large, you may also want
1118                 #  to add a ':%H' (see doc/variables.txt) to the end
1119                 #  of it, to create a new detail file every hour, e.g.:
1120                 #
1121                 #   ..../detail-%Y%m%d:%H
1122                 #
1123                 #  This will create a new detail file for every hour.
1124                 #
1125                 detailfile = ${radacctdir}/%{Client-IP-Address}/detail-%Y%m%d
1126
1127                 #
1128                 #  The Unix-style permissions on the 'detail' file.
1129                 #
1130                 #  The detail file often contains secret or private
1131                 #  information about users.  So by keeping the file
1132                 #  permissions restrictive, we can prevent unwanted
1133                 #  people from seeing that information.
1134                 detailperm = 0600
1135
1136                 #
1137                 #  Every entry in the detail file has a header which
1138                 #  is a timestamp.  By default, we use the ctime
1139                 #  format (see "man ctime" for details).
1140                 #
1141                 #  The header can be customized by editing this
1142                 #  string.  See "doc/variables.txt" for a description
1143                 #  of what can be put here.
1144                 #
1145                 header = "%t"
1146
1147                 #
1148                 # Certain attributes such as User-Password may be
1149                 # "sensitive", so they should not be printed in the
1150                 # detail file.  This section lists the attributes
1151                 # that should be suppressed.
1152                 #
1153                 # The attributes should be listed one to a line.
1154                 #
1155                 #suppress {
1156                         # User-Password
1157                 #}
1158
1159         }
1160
1161         #
1162         #  Many people want to log authentication requests.
1163         #  Rather than modifying the server core to print out more
1164         #  messages, we can use a different instance of the 'detail'
1165         #  module, to log the authentication requests to a file.
1166         #
1167         #  You will also need to un-comment the 'auth_log' line
1168         #  in the 'authorize' section, below.
1169         #
1170         # detail auth_log {
1171                 # detailfile = ${radacctdir}/%{Client-IP-Address}/auth-detail-%Y%m%d
1172
1173                 #
1174                 #  This MUST be 0600, otherwise anyone can read
1175                 #  the users passwords!
1176                 # detailperm = 0600
1177
1178                 # You may also strip out passwords completely
1179                 #suppress {
1180                         # User-Password
1181                 #}
1182         # }
1183
1184         #
1185         #  This module logs authentication reply packets sent
1186         #  to a NAS.  Both Access-Accept and Access-Reject packets
1187         #  are logged.
1188         #
1189         #  You will also need to un-comment the 'reply_log' line
1190         #  in the 'post-auth' section, below.
1191         #
1192         # detail reply_log {
1193                 # detailfile = ${radacctdir}/%{Client-IP-Address}/reply-detail-%Y%m%d
1194
1195                 # detailperm = 0600
1196         # }
1197
1198         #
1199         #  This module logs packets proxied to a home server.
1200         #
1201         #  You will also need to un-comment the 'pre_proxy_log' line
1202         #  in the 'pre-proxy' section, below.
1203         #
1204         # detail pre_proxy_log {
1205                 # detailfile = ${radacctdir}/%{Client-IP-Address}/pre-proxy-detail-%Y%m%d
1206
1207                 #
1208                 #  This MUST be 0600, otherwise anyone can read
1209                 #  the users passwords!
1210                 # detailperm = 0600
1211
1212                 # You may also strip out passwords completely
1213                 #suppress {
1214                         # User-Password
1215                 #}
1216         # }
1217
1218         #
1219         #  This module logs response packets from a home server.
1220         #
1221         #  You will also need to un-comment the 'post_proxy_log' line
1222         #  in the 'post-proxy' section, below.
1223         #
1224         # detail post_proxy_log {
1225                 # detailfile = ${radacctdir}/%{Client-IP-Address}/post-proxy-detail-%Y%m%d
1226
1227                 # detailperm = 0600
1228         # }
1229
1230         #
1231         #  The rlm_sql_log module appends the SQL queries in a log
1232         #  file which is read later by the radsqlrelay program.
1233         #
1234         #  This module only performs the dynamic expansion of the
1235         #  variables found in the SQL statements. No operation is
1236         #  executed on the database server. (this could be done
1237         #  later by an external program) That means the module is
1238         #  useful only with non-"SELECT" statements.
1239         #
1240         #  See rlm_sql_log(5) manpage.
1241         #
1242 #       sql_log {
1243 #               path = "${radacctdir}/sql-relay"
1244 #               acct_table = "radacct"
1245 #               postauth_table = "radpostauth"
1246 #               sql_user_name = "%{%{User-Name}:-DEFAULT}"
1247 #
1248 #               Start = "INSERT INTO ${acct_table} (AcctSessionId, UserName, \
1249 #                NASIPAddress, FramedIPAddress, AcctStartTime, AcctStopTime, \
1250 #                AcctSessionTime, AcctTerminateCause) VALUES                 \
1251 #                ('%{Acct-Session-Id}', '%{User-Name}', '%{NAS-IP-Address}', \
1252 #                '%{Framed-IP-Address}', '%S', '0', '0', '');"
1253 #               Stop = "INSERT INTO ${acct_table} (AcctSessionId, UserName,  \
1254 #                NASIPAddress, FramedIPAddress, AcctStartTime, AcctStopTime, \
1255 #                AcctSessionTime, AcctTerminateCause) VALUES                 \
1256 #                ('%{Acct-Session-Id}', '%{User-Name}', '%{NAS-IP-Address}', \
1257 #                '%{Framed-IP-Address}', '0', '%S', '%{Acct-Session-Time}',  \
1258 #                '%{Acct-Terminate-Cause}');"
1259 #               Alive = "INSERT INTO ${acct_table} (AcctSessionId, UserName, \
1260 #                NASIPAddress, FramedIPAddress, AcctStartTime, AcctStopTime, \
1261 #                AcctSessionTime, AcctTerminateCause) VALUES                 \
1262 #                ('%{Acct-Session-Id}', '%{User-Name}', '%{NAS-IP-Address}', \
1263 #                '%{Framed-IP-Address}', '0', '0', '%{Acct-Session-Time}','');"
1264 #
1265 #               Post-Auth = "INSERT INTO ${postauth_table}                   \
1266 #                (username, pass, reply, authdate) VALUES                            \
1267 #                ('%{User-Name}', '%{User-Password:-Chap-Password}',         \
1268 #                '%{reply:Packet-Type}', '%S');"
1269 #       }
1270
1271         #
1272         #  Create a unique accounting session Id.  Many NASes re-use
1273         #  or repeat values for Acct-Session-Id, causing no end of
1274         #  confusion.
1275         #
1276         #  This module will add a (probably) unique session id 
1277         #  to an accounting packet based on the attributes listed
1278         #  below found in the packet.  See doc/rlm_acct_unique for
1279         #  more information.
1280         #
1281         acct_unique {
1282                 key = "User-Name, Acct-Session-Id, NAS-IP-Address, Client-IP-Address, NAS-Port"
1283         }
1284
1285
1286         #  Include another file that has the SQL-related configuration.
1287         #  This is another file only because it tends to be big.
1288         #
1289         $INCLUDE sql.conf
1290
1291
1292         #  For Cisco VoIP specific accounting with Postgresql,
1293         #  use:         ${confdir}/sql/postgresql/voip-postpaid.conf
1294         #
1295         #  You will also need the sql schema from:
1296         #        src/billing/cisco_h323_db_schema-postgres.sql
1297         #  Note: This config can be use AS WELL AS the standard sql
1298         #  config if you need SQL based Auth
1299         
1300
1301         #  Write a 'utmp' style file, of which users are currently
1302         #  logged in, and where they've logged in from.
1303         #
1304         #  This file is used mainly for Simultaneous-Use checking,
1305         #  and also 'radwho', to see who's currently logged in.
1306         #
1307         radutmp {
1308                 #  Where the file is stored.  It's not a log file,
1309                 #  so it doesn't need rotating.
1310                 #
1311                 filename = ${logdir}/radutmp
1312
1313                 #  The field in the packet to key on for the
1314                 #  'user' name,  If you have other fields which you want
1315                 #  to use to key on to control Simultaneous-Use,
1316                 #  then you can use them here.
1317                 #
1318                 #  Note, however, that the size of the field in the
1319                 #  'utmp' data structure is small, around 32
1320                 #  characters, so that will limit the possible choices
1321                 #  of keys.
1322                 #
1323                 #  You may want instead: %{Stripped-User-Name:-%{User-Name}}
1324                 username = %{User-Name}
1325
1326
1327                 #  Whether or not we want to treat "user" the same
1328                 #  as "USER", or "User".  Some systems have problems
1329                 #  with case sensitivity, so this should be set to
1330                 #  'no' to enable the comparisons of the key attribute
1331                 #  to be case insensitive.
1332                 #
1333                 case_sensitive = yes
1334
1335                 #  Accounting information may be lost, so the user MAY
1336                 #  have logged off of the NAS, but we haven't noticed.
1337                 #  If so, we can verify this information with the NAS,
1338                 #
1339                 #  If we want to believe the 'utmp' file, then this
1340                 #  configuration entry can be set to 'no'.
1341                 #
1342                 check_with_nas = yes            
1343
1344                 # Set the file permissions, as the contents of this file
1345                 # are usually private.
1346                 perm = 0600
1347
1348                 callerid = "yes"
1349         }
1350
1351         # "Safe" radutmp - does not contain caller ID, so it can be
1352         # world-readable, and radwho can work for normal users, without
1353         # exposing any information that isn't already exposed by who(1).
1354         #
1355         # This is another 'instance' of the radutmp module, but it is given
1356         # then name "sradutmp" to identify it later in the "accounting"
1357         # section.
1358         radutmp sradutmp {
1359                 filename = ${logdir}/sradutmp
1360                 perm = 0644
1361                 callerid = "no"
1362         }
1363
1364         # attr_filter - filters the attributes received in replies from
1365         # proxied servers, to make sure we send back to our RADIUS client
1366         # only allowed attributes.
1367         attr_filter attr_filter.post-proxy {
1368                 attrsfile = ${confdir}/attrs
1369         }
1370
1371         # attr_filter - filters the attributes in the packets we send to
1372         # the RADIUS home servers.
1373         attr_filter attr_filter.pre-proxy {
1374                 attrsfile = ${confdir}/attrs.pre-proxy
1375         }
1376
1377         # Enforce RFC requirements on the contents of Access-Reject
1378         # packets.  See the comments at the top of the file for
1379         # more details.
1380         #
1381         attr_filter attr_filter.access_reject {
1382                 key = %{User-Name}
1383                 attrsfile = ${confdir}/attrs.access_reject
1384         }
1385
1386         #  Enforce RFC requirements on the contents of the
1387         #  Accounting-Response packets.  See the comments at the
1388         #  top of the file for more details.
1389         #
1390         attr_filter attr_filter.accounting_response {
1391                 key = %{User-Name}
1392                 attrsfile = ${confdir}/attrs.accounting_response
1393         }
1394
1395         #  counter module:
1396         #  This module takes an attribute (count-attribute).
1397         #  It also takes a key, and creates a counter for each unique
1398         #  key.  The count is incremented when accounting packets are
1399         #  received by the server.  The value of the increment depends
1400         #  on the attribute type.
1401         #  If the attribute is Acct-Session-Time or of an integer type we add
1402         #  the value of the attribute. If it is anything else we increase the
1403         #  counter by one.
1404         #
1405         #  The 'reset' parameter defines when the counters are all reset to
1406         #  zero.  It can be hourly, daily, weekly, monthly or never.
1407         #
1408         #  hourly: Reset on 00:00 of every hour
1409         #  daily: Reset on 00:00:00 every day
1410         #  weekly: Reset on 00:00:00 on sunday
1411         #  monthly: Reset on 00:00:00 of the first day of each month
1412         #
1413         #  It can also be user defined. It should be of the form:
1414         #  num[hdwm] where:
1415         #  h: hours, d: days, w: weeks, m: months
1416         #  If the letter is ommited days will be assumed. In example:
1417         #  reset = 10h (reset every 10 hours)
1418         #  reset = 12  (reset every 12 days)
1419         #
1420         #
1421         #  The check-name attribute defines an attribute which will be
1422         #  registered by the counter module and can be used to set the
1423         #  maximum allowed value for the counter after which the user
1424         #  is rejected.
1425         #  Something like:
1426         #
1427         #  DEFAULT Max-Daily-Session := 36000
1428         #          Fall-Through = 1
1429         #
1430         #  You should add the counter module in the instantiate
1431         #  section so that it registers check-name before the files
1432         #  module reads the users file.
1433         #
1434         #  If check-name is set and the user is to be rejected then we
1435         #  send back a Reply-Message and we log a Failure-Message in
1436         #  the radius.log
1437         #
1438         #  If the count attribute is Acct-Session-Time then on each
1439         #  login we send back the remaining online time as a
1440         #  Session-Timeout attribute ELSE and if the reply-name is
1441         #  set, we send back that attribute.  The reply-name attribute
1442         #  MUST be of an integer type.
1443         #
1444         #  The counter-name can also be used instead of using the check-name
1445         #  like below:
1446         #
1447         #  DEFAULT  Daily-Session-Time > 3600, Auth-Type = Reject
1448         #      Reply-Message = "You've used up more than one hour today"
1449         #
1450         #  The allowed-servicetype attribute can be used to only take
1451         #  into account specific sessions. For example if a user first
1452         #  logs in through a login menu and then selects ppp there will
1453         #  be two sessions. One for Login-User and one for Framed-User
1454         #  service type. We only need to take into account the second one.
1455         #
1456         #  The module should be added in the instantiate, authorize and
1457         #  accounting sections.  Make sure that in the authorize
1458         #  section it comes after any module which sets the
1459         #  'check-name' attribute.
1460         #
1461         counter daily {
1462                 filename = ${db_dir}/db.daily
1463                 key = User-Name
1464                 count-attribute = Acct-Session-Time
1465                 reset = daily
1466                 counter-name = Daily-Session-Time
1467                 check-name = Max-Daily-Session
1468                 reply-name = Session-Timeout
1469                 allowed-servicetype = Framed-User
1470                 cache-size = 5000
1471         }
1472
1473         #
1474         #  This module is an SQL enabled version of the counter module.
1475         #
1476         #  Rather than maintaining seperate (GDBM) databases of
1477         #  accounting info for each counter, this module uses the data
1478         #  stored in the raddacct table by the sql modules. This
1479         #  module NEVER does any database INSERTs or UPDATEs.  It is
1480         #  totally dependent on the SQL module to process Accounting
1481         #  packets.
1482         #
1483         $INCLUDE sql/mysql/counter.conf
1484         #$INCLUDE sql/postgresql/counter.conf
1485
1486         #
1487         # The "always" module is here for debugging purposes. Each
1488         # instance simply returns the same result, always, without
1489         # doing anything.
1490         always fail {
1491                 rcode = fail
1492         }
1493         always reject {
1494                 rcode = reject
1495         }
1496         always noop {
1497                 rcode = noop
1498         }
1499         always handled {
1500                 rcode = handled
1501         }
1502         always updated {
1503                 rcode = updated
1504         }
1505         always notfound {
1506                 rcode = notfound
1507         }
1508         always ok {
1509                 rcode = ok
1510                 simulcount = 0
1511                 mpp = no
1512         }
1513
1514         #
1515         #  The 'expression' module currently has no configuration.
1516         #
1517         #  This module is useful only for 'xlat'.  To use it,
1518         #  put 'exec' into the 'instantiate' section.  You can then
1519         #  do dynamic translation of attributes like:
1520         #
1521         #  Attribute-Name = `%{expr:2 + 3 + %{exec: uid -u}}`
1522         #
1523         #  The value of the attribute will be replaced with the output
1524         #  of the program which is executed.  Due to RADIUS protocol
1525         #  limitations, any output over 253 bytes will be ignored.
1526         #
1527         #  The module also registers a few paircompare functions
1528         expr {
1529         }
1530
1531         #
1532         #  The 'digest' module currently has no configuration.
1533         #
1534         #  "Digest" authentication against a Cisco SIP server.
1535         #  See 'doc/rfc/draft-sterman-aaa-sip-00.txt' for details
1536         #  on performing digest authentication for Cisco SIP servers.
1537         #
1538         digest {
1539         }
1540
1541         #
1542         # The expiration module. This handles the Expiration attribute
1543         # It should be included in the *end* of the authorize section
1544         # in order to handle user Expiration. It should also be included
1545         # in the instantiate section in order to register the Expiration
1546         # compare function
1547         #
1548         expiration {
1549                 #
1550                 # The Reply-Message which will be sent back in case the
1551                 # account has expired. Dynamic substitution is supported
1552                 #
1553                 reply-message = "Password Has Expired\r\n" 
1554 #               reply-message = "Your account has expired, %{User-Name}\r\n"
1555         }
1556
1557         # The logintime module. This handles the Login-Time,
1558         # Current-Time, and Time-Of-Day attributes.  It should be
1559         # included in the *end* of the authorize section in order to
1560         # handle Login-Time checks. It should also be included in the
1561         # instantiate section in order to register the Current-Time
1562         # and Time-Of-Day comparison functions.
1563         #
1564         # When the Login-Time attribute is set to some value, and the
1565         # user has bene permitted to log in, a Session-Timeout is
1566         # calculated based on the remaining time.  See "doc/README".
1567         #
1568         logintime {
1569                 #
1570                 # The Reply-Message which will be sent back in case
1571                 # the account is calling outside of the allowed
1572                 # timespan. Dynamic substitution is supported.
1573                 #
1574                 reply-message = "You are calling outside your allowed timespan\r\n"
1575 #               reply-message = "Outside allowed timespan (%{control:Login-Time}), %{User-Name}\r\n"
1576
1577                 # The minimum timeout (in seconds) a user is allowed
1578                 # to have. If the calculated timeout is lower we don't
1579                 # allow the logon. Some NASes do not handle values
1580                 # lower than 60 seconds well.
1581                 minimum-timeout = 60
1582         }
1583         #
1584         #  Execute external programs
1585         #
1586         #  This module is useful only for 'xlat'.  To use it,
1587         #  put 'exec' into the 'instantiate' section.  You can then
1588         #  do dynamic translation of attributes like:
1589         #
1590         #  Attribute-Name = `%{exec:/path/to/program args}`
1591         #
1592         #  The value of the attribute will be replaced with the output
1593         #  of the program which is executed.  Due to RADIUS protocol
1594         #  limitations, any output over 253 bytes will be ignored.
1595         #
1596         #  The RADIUS attributes from the user request will be placed
1597         #  into environment variables of the executed program, as
1598         #  described in 'doc/variables.txt'
1599         #
1600         exec {
1601                 wait = yes
1602                 input_pairs = request
1603                 shell_escape = yes
1604                 output = none
1605         }
1606
1607         #
1608         #  This is a more general example of the execute module.
1609         #
1610         #  This one is called "echo".
1611         #
1612         #  Attribute-Name = `%{echo:/path/to/program args}`
1613         #
1614         #  If you wish to execute an external program in more than
1615         #  one section (e.g. 'authorize', 'pre_proxy', etc), then it
1616         #  is probably best to define a different instance of the
1617         #  'exec' module for every section.     
1618         #
1619         #  The return value of the program run determines the result
1620         #  of the exec instance call as follows:
1621         #  (See doc/configurable_failover for details)
1622         #
1623         #  < 0 : fail      the module failed
1624         #  = 0 : ok        the module succeeded
1625         #  = 1 : reject    the module rejected the user
1626         #  = 2 : fail      the module failed
1627         #  = 3 : ok        the module succeeded
1628         #  = 4 : handled   the module has done everything to handle the request
1629         #  = 5 : invalid   the user's configuration entry was invalid
1630         #  = 6 : userlock  the user was locked out
1631         #  = 7 : notfound  the user was not found
1632         #  = 8 : noop      the module did nothing
1633         #  = 9 : updated   the module updated information in the request
1634         #  > 9 : fail      the module failed
1635         #
1636         exec echo {
1637                 #
1638                 #  Wait for the program to finish.
1639                 #
1640                 #  If we do NOT wait, then the program is "fire and
1641                 #  forget", and any output attributes from it are ignored.
1642                 #
1643                 #  If we are looking for the program to output
1644                 #  attributes, and want to add those attributes to the
1645                 #  request, then we MUST wait for the program to
1646                 #  finish, and therefore set 'wait=yes'
1647                 #
1648                 # allowed values: {no, yes}
1649                 wait = yes
1650
1651                 #
1652                 #  The name of the program to execute, and it's
1653                 #  arguments.  Dynamic translation is done on this
1654                 #  field, so things like the following example will
1655                 #  work.
1656                 #
1657                 program = "/bin/echo %{User-Name}"
1658
1659                 #
1660                 #  The attributes which are placed into the
1661                 #  environment variables for the program.
1662                 #
1663                 #  Allowed values are:
1664                 #
1665                 #       request         attributes from the request
1666                 #       config          attributes from the configuration items list
1667                 #       reply           attributes from the reply
1668                 #       proxy-request   attributes from the proxy request
1669                 #       proxy-reply     attributes from the proxy reply
1670                 #
1671                 #  Note that some attributes may not exist at some
1672                 #  stages.  e.g. There may be no proxy-reply
1673                 #  attributes if this module is used in the
1674                 #  'authorize' section.
1675                 #
1676                 input_pairs = request
1677
1678                 #
1679                 #  Where to place the output attributes (if any) from
1680                 #  the executed program.  The values allowed, and the
1681                 #  restrictions as to availability, are the same as
1682                 #  for the input_pairs.
1683                 #
1684                 output_pairs = reply
1685
1686                 #
1687                 #  When to execute the program.  If the packet
1688                 #  type does NOT match what's listed here, then
1689                 #  the module does NOT execute the program.
1690                 #
1691                 #  For a list of allowed packet types, see
1692                 #  the 'dictionary' file, and look for VALUEs
1693                 #  of the Packet-Type attribute.
1694                 #
1695                 #  By default, the module executes on ANY packet.
1696                 #  Un-comment out the following line to tell the
1697                 #  module to execute only if an Access-Accept is
1698                 #  being sent to the NAS.
1699                 #
1700                 #packet_type = Access-Accept
1701
1702                 #
1703                 #  Should we escape the environment variables?
1704                 #  
1705                 #  If this is set, all the RADIUS attributes
1706                 #  are capitalised and dashes replaced with
1707                 #  underscores. Also, RADIUS values are surrounded
1708                 #  with double-quotes.
1709                 #
1710                 #  That is to say: User-Name=BobUser => USER_NAME="BobUser"
1711                 shell_escape = yes
1712
1713         }
1714
1715         #  Do server side ip pool management. Should be added in
1716         #  post-auth and accounting sections.
1717         #
1718         #  The module also requires the existance of the Pool-Name
1719         #  attribute. That way the administrator can add the Pool-Name
1720         #  attribute in the user profiles and use different pools for
1721         #  different users. The Pool-Name attribute is a *check* item
1722         #  not a reply item.
1723         #
1724         #  The Pool-Name should be set to the ippool module instance
1725         #  name or to DEFAULT to match any module.
1726
1727         #
1728         # Example:
1729         # radiusd.conf: ippool students { [...] }
1730         #               ippool teachers { [...] }
1731         # users file  : DEFAULT Group == students, Pool-Name := "students"
1732         #               DEFAULT Group == teachers, Pool-Name := "teachers"
1733         #               DEFAULT Group == other, Pool-Name := "DEFAULT"
1734         #
1735         # ********* IF YOU CHANGE THE RANGE PARAMETERS YOU MUST *********
1736         # ********* THEN ERASE THE DB FILES                     *********
1737         #
1738         ippool main_pool {
1739
1740                 #  range-start,range-stop:
1741                 #       The start and end ip addresses for this pool.
1742                 range-start = 192.168.1.1
1743                 range-stop = 192.168.3.254
1744
1745                 #  netmask:
1746                 #       The network mask used for this pool.
1747                 netmask = 255.255.255.0
1748
1749                 #  cache-size:
1750                 #       The gdbm cache size for the db files. Should
1751                 #       be equal to the number of ip's available in
1752                 #       the ip pool
1753                 cache-size = 800
1754
1755                 # session-db:
1756                 #       The main db file used to allocate addresses.
1757                 session-db = ${db_dir}/db.ippool
1758
1759                 # ip-index:
1760                 #       Helper db index file used in multilink
1761                 ip-index = ${db_dir}/db.ipindex
1762
1763                 # override:
1764                 #       If set, the Framed-IP-Address already in the
1765                 #       reply (if any) will be discarded, and replaced
1766                 #       with a Framed-IP-Address assigned here.
1767                 override = no
1768
1769                 # maximum-timeout:
1770                 #       Specifies the maximum time in seconds that an
1771                 #       entry may be active.  If set to zero, means
1772                 #       "no timeout".  The default value is 0
1773                 maximum-timeout = 0
1774
1775                 # key:
1776                 #       The key to use for the session database (which
1777                 #       holds the allocated ip's) normally it should
1778                 #       just be the nas ip/port (which is the default).
1779                 #
1780                 #       If your NAS sends the same value of NAS-Port
1781                 #       all requests, the key should be based on some
1782                 #       other attribute that is in ALL requests, AND
1783                 #       is unique to each machine needing an IP address.
1784                 #key = "%{NAS-IP-Address} %{NAS-Port}"
1785         }
1786
1787         # $INCLUDE sqlippool.conf
1788
1789         # OTP token support.  Not included by default.
1790         # $INCLUDE otp.conf
1791
1792         #
1793         #  Kerberos.  See doc/rlm_krb5 for minimal docs.
1794         #
1795 #       krb5 {
1796 #               keytab = /path/to/keytab
1797 #               service_principal = name_of_principle
1798 #       }
1799
1800         #
1801         #  Module implementing a DIFFERENT policy language.
1802         #  The syntax here is NOT "unlang", but something else.
1803         #
1804         #  See the "policy.txt" file for documentation and examples.
1805         #
1806         policy {
1807                #  The only configuration item is a filename containing
1808                #  the policies to execute.
1809                #
1810                #  When "policy" is listed in a section (e.g. "authorize"),
1811                #  it will run a policy named for that section.
1812                # 
1813                filename = ${confdir}/policy.txt
1814         }
1815
1816 }
1817
1818 # Instantiation
1819 #
1820 #  This section orders the loading of the modules.  Modules
1821 #  listed here will get loaded BEFORE the later sections like
1822 #  authorize, authenticate, etc. get examined.
1823 #
1824 #  This section is not strictly needed.  When a section like
1825 #  authorize refers to a module, it's automatically loaded and
1826 #  initialized.  However, some modules may not be listed in any
1827 #  of the following sections, so they can be listed here.
1828 #
1829 #  Also, listing modules here ensures that you have control over
1830 #  the order in which they are initalized.  If one module needs
1831 #  something defined by another module, you can list them in order
1832 #  here, and ensure that the configuration will be OK.
1833 #
1834 instantiate {
1835         #
1836         #  Allows the execution of external scripts.
1837         #  The entire command line (and output) must fit into 253 bytes.
1838         #
1839         #  e.g. Framed-Pool = `%{exec:/bin/echo foo}`
1840         exec
1841
1842         #
1843         #  The expression module doesn't do authorization,
1844         #  authentication, or accounting.  It only does dynamic
1845         #  translation, of the form:
1846         #
1847         #       Session-Timeout = `%{expr:2 + 3}`
1848         #
1849         #  So the module needs to be instantiated, but CANNOT be
1850         #  listed in any other section.  See 'doc/rlm_expr' for
1851         #  more information.
1852         #
1853         expr
1854
1855         #
1856         # We add the counter module here so that it registers
1857         # the check-name attribute before any module which sets
1858         # it
1859 #       daily
1860         expiration
1861         logintime
1862
1863         # subsections here can be thought of as "virtual" modules.
1864         #
1865         # e.g. If you have two redundant SQL servers, and you want to
1866         # use them in the authorize and accounting sections, you could
1867         # place a "redundant" block in each section, containing the
1868         # exact same text.  Or, you could uncomment the following
1869         # lines, and list "redundant_sql" in the authorize and
1870         # accounting sections.
1871         #
1872         #redundant redundant_sql {
1873         #       sql1
1874         #       sql2
1875         #}
1876 }
1877
1878 ######################################################################
1879 #
1880 #       Policies that can be applied in multiple places are listed
1881 #       globally.  That way, they can be defined once, and referred
1882 #       to multiple times.
1883 #
1884 ######################################################################
1885 $INCLUDE policy.conf
1886
1887 ######################################################################
1888 #
1889 #       As of 2.0.0, the "authorize", "authenticate", etc. sections
1890 #       are in separate configuration files, per virtual host.
1891 #
1892 ######################################################################
1893
1894 ######################################################################
1895 #
1896 #       Include all enabled virtual hosts.
1897 #
1898 #       The following directory is searched for files that match
1899 #       the regex:
1900 #
1901 #               /[a-zA-Z0-9_.]+/
1902 #
1903 #       The files are then included here, just as if they were cut
1904 #       and pasted into this file.
1905 #
1906 #       See "sites-enabled/default" for some additional documentation.
1907 #
1908 $INCLUDE sites-enabled/