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