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