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