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