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