3eaf0a0c10be2c0970e4ce3d2f4c5bced05b5b9e
[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 # libdir: Where to find the rlm_* modules.
44 #
45 #   This should be automatically set at configuration time.
46 #
47 #   If the server builds and installs, but fails at execution time
48 #   with an 'undefined symbol' error, then you can use the libdir
49 #   directive to work around the problem.
50 #
51 #   The cause is usually that a library has been installed on your
52 #   system in a place where the dynamic linker CANNOT find it.  When
53 #   executing as root (or another user), your personal environment MAY
54 #   be set up to allow the dynamic linker to find the library.  When
55 #   executing as a daemon, FreeRADIUS MAY NOT have the same
56 #   personalized configuration.
57 #
58 #   To work around the problem, find out which library contains that symbol,
59 #   and add the directory containing that library to the end of 'libdir',
60 #   with a colon separating the directory names.  NO spaces are allowed.
61 #
62 #   e.g. libdir = /usr/local/lib:/opt/package/lib
63 #
64 #   You can also try setting the LD_LIBRARY_PATH environment variable
65 #   in a script which starts the server.
66 #
67 #   If that does not work, then you can re-configure and re-build the
68 #   server to NOT use shared libraries, via:
69 #
70 #       ./configure --disable-shared
71 #       make
72 #       make install
73 #
74 libdir = @libdir@
75
76 #  pidfile: Where to place the PID of the RADIUS server.
77 #
78 #  The server may be signalled while it's running by using this
79 #  file.
80 #
81 #  This file is written when ONLY running in daemon mode.
82 #
83 #  e.g.:  kill -HUP `cat /var/run/radiusd/radiusd.pid`
84 #
85 pidfile = ${run_dir}/radiusd.pid
86
87
88 # user/group: The name (or #number) of the user/group to run radiusd as.
89 #
90 #   If these are commented out, the server will run as the user/group
91 #   that started it.  In order to change to a different user/group, you
92 #   MUST be root ( or have root privleges ) to start the server.
93 #
94 #   We STRONGLY recommend that you run the server with as few permissions
95 #   as possible.  That is, if you're not using shadow passwords, the
96 #   user and group items below should be set to 'nobody'.
97 #
98 #    On SCO (ODT 3) use "user = nouser" and "group = nogroup".
99 #
100 #  NOTE that some kernels refuse to setgid(group) when the value of
101 #  (unsigned)group is above 60000; don't use group nobody on these systems!
102 #
103 #  On systems with shadow passwords, you might have to set 'group = shadow'
104 #  for the server to be able to read the shadow password file.  If you can
105 #  authenticate users while in debug mode, but not in daemon mode, it may be
106 #  that the debugging mode server is running as a user that can read the
107 #  shadow info, and the user listed below can not.
108 #
109 #user = nobody
110 #group = nobody
111
112 #  max_request_time: The maximum time (in seconds) to handle a request.
113 #
114 #  Requests which take more time than this to process may be killed, and
115 #  a REJECT message is returned.
116 #
117 #  WARNING: If you notice that requests take a long time to be handled,
118 #  then this MAY INDICATE a bug in the server, in one of the modules
119 #  used to handle a request, OR in your local configuration.
120 #
121 #  This problem is most often seen when using an SQL database.  If it takes
122 #  more than a second or two to receive an answer from the SQL database,
123 #  then it probably means that you haven't indexed the database.  See your
124 #  SQL server documentation for more information.
125 #
126 #  Useful range of values: 5 to 120
127 #
128 max_request_time = 30
129
130 #  delete_blocked_requests: If the request takes MORE THAN 'max_request_time'
131 #  to be handled, then maybe the server should delete it.
132 #
133 #  If you're running in threaded, or thread pool mode, this setting
134 #  should probably be 'no'.  Setting it to 'yes' when using a threaded
135 #  server MAY cause the server to crash!
136 #
137 delete_blocked_requests = no
138
139 #  cleanup_delay: The time to wait (in seconds) before cleaning up
140 #  a reply which was sent to the NAS.
141 #
142 #  The RADIUS request is normally cached internally for a short period
143 #  of time, after the reply is sent to the NAS.  The reply packet may be
144 #  lost in the network, and the NAS will not see it.  The NAS will then
145 #  re-send the request, and the server will respond quickly with the
146 #  cached reply.
147 #
148 #  If this value is set too low, then duplicate requests from the NAS
149 #  MAY NOT be detected, and will instead be handled as seperate requests.
150 #
151 #  If this value is set too high, then the server will cache too many
152 #  requests, and some new requests may get blocked.  (See 'max_requests'.)
153 #
154 #  Useful range of values: 2 to 10
155 #
156 cleanup_delay = 5
157
158 #  max_requests: The maximum number of requests which the server keeps
159 #  track of.  This should be 256 multiplied by the number of clients.
160 #  e.g. With 4 clients, this number should be 1024.
161 #
162 #  If this number is too low, then when the server becomes busy,
163 #  it will not respond to any new requests, until the 'cleanup_delay'
164 #  time has passed, and it has removed the old requests.
165 #
166 #  If this number is set too high, then the server will use a bit more
167 #  memory for no real benefit.
168 #
169 #  If you aren't sure what it should be set to, it's better to set it
170 #  too high than too low.  Setting it to 1000 per client is probably
171 #  the highest it should be.
172 #
173 #  Useful range of values: 256 to infinity
174 #
175 max_requests = 1024
176
177 #  bind_address:  Make the server listen on a particular IP address, and
178 #  send replies out from that address.  This directive is most useful
179 #  for machines with multiple IP addresses on one interface.
180 #
181 #  It can either contain "*", or an IP address, or a fully qualified
182 #  Internet domain name.  The default is "*"
183 #
184 bind_address = *
185
186 #  port: Allows you to bind FreeRADIUS to a specific port.
187 #
188 #  The default port that most NAS boxes use is 1645, which is historical.
189 #  RFC 2138 defines 1812 to be the new port.  Many new servers and
190 #  NAS boxes use 1812, which can create interoperability problems.
191 #
192 #  The port is defined here to be 0 so that the server will pick up
193 #  the machine's local configuration for the radius port, as defined
194 #  in /etc/services.
195 #
196 #  If you want to use the default RADIUS port as defined on your server,
197 #  (usually through 'grep radius /etc/services') set this to 0 (zero).
198 #
199 #  A port given on the command-line via '-p' over-rides this one.
200 #
201 port = 0
202
203 #  hostname_lookups: Log the names of clients or just their IP addresses
204 #  e.g., www.freeradius.org (on) or 206.47.27.232 (off).
205 #
206 #  The default is 'off' because it would be overall better for the net
207 #  if people had to knowingly turn this feature on, since enabling it
208 #  means that each client request will result in AT LEAST one lookup
209 #  request to the nameserver.   Enabling hostname_lookups will also
210 #  mean that your server may stop randomly for 30 seconds from time
211 #  to time, if the DNS requests take too long.
212 #
213 #  Turning hostname lookups off also means that the server won't block
214 #  for 30 seconds, if it sees an IP address which has no name associated
215 #  with it.
216 #
217 #  allowed values: {no, yes}
218 #
219 hostname_lookups = no
220
221 #  Core dumps are a bad thing.  This should only be set to 'yes'
222 #  if you're debugging a problem with the server.
223 #
224 #  allowed values: {no, yes}
225 #
226 allow_core_dumps = no
227
228 #  Regular expressions
229 #
230 #  These items are set at configure time.  If they're set to "yes",
231 #  then setting them to "no" turns off regular expression support.
232 #
233 #  If they're set to "no" at configure time, then setting them to "yes"
234 #  WILL NOT WORK.  It will give you an error.
235 #
236 regular_expressions     = @REGEX@
237 extended_expressions    = @REGEX_EXTENDED@
238
239 #  Log the full User-Name attribute, as it was found in the request.
240 #
241 # allowed values: {no, yes}
242 #
243 log_stripped_names = no
244
245 #  Log authentication requests to the log file.
246 #
247 #  allowed values: {no, yes}
248 #
249 log_auth = no
250
251 #  Log passwords with the authentication requests.
252 #  log_auth_badpass  - logs password if it's rejected
253 #  log_auth_goodpass - logs password if it's correct
254 #
255 #  allowed values: {no, yes}
256 #
257 log_auth_badpass = no
258 log_auth_goodpass = no
259
260 # usercollide:  Turn "username collision" code on and off.  See the
261 # "doc/duplicate-users" file
262 #
263 usercollide = no
264
265 # lower_user / lower_pass:  
266 # Lower case the username/password "before" or "after"
267 # attempting to authenticate.  
268 #
269 #  If "before", the server will first modify the request and then try
270 #  to auth the user.  If "after", the server will first auth using the
271 #  values provided by the user.  If that fails it will reprocess the
272 #  request after modifying it as you specify below.
273 #
274 #  This is as close as we can get to case insensitivity.  It is the
275 #  admin's job to ensure that the username on the auth db side is
276 #  *also* lowercase to make this work
277 #
278 # Default is 'no' (don't lowercase values)
279 # Valid values = "before" / "after" / "no"
280 #
281 lower_user = no
282 lower_pass = no
283
284 # nospace_user / nospace_pass:
285 #
286 #  Some users like to enter spaces in their username or password
287 #  incorrectly.  To save yourself the tech support call, you can
288 #  eliminate those spaces here:
289 #
290 # Default is 'no' (don't remove spaces)
291 # Valid values = "before" / "after" / "no" (explanation above)
292 #
293 nospace_user = no
294 nospace_pass = no
295
296 #  The program to execute to do concurrency checks.
297 checkrad = ${sbindir}/checkrad
298
299 # SECURITY CONFIGURATION
300 #
301 #  There may be multiple methods of attacking on the server.  This
302 #  section holds the configuration items which minimize the impact
303 #  of those attacks
304 #
305 security {
306         #
307         #  max_attributes: The maximum number of attributes
308         #  permitted in a RADIUS packet.  Packets which have MORE
309         #  than this number of attributes in them will be dropped.
310         #
311         #  If this number is set too low, then no RADIUS packets
312         #  will be accepted.
313         #
314         #  If this number is set too high, then an attacker may be
315         #  able to send a small number of packets which will cause
316         #  the server to use all available memory on the machine.
317         #
318         #  Setting this number to 0 means "allow any number of attributes"
319         max_attributes = 200
320
321         #
322         #  delayed_reject: When sending an Access-Reject, it can be
323         #  delayed for a few seconds.  This may help slow down a DoS
324         #  attack.  It also helps to slow down people trying to brute-force
325         #  crack a users password.
326         #
327         #  Setting this number to 0 means "send rejects immediately"
328         #
329         #  If this number is set higher than 'cleanup_delay', then the
330         #  rejects will be sent at 'cleanup_delay' time, when the request
331         #  is deleted from the internal cache of requests.
332         #
333         #  Useful ranges: 1 to 5
334         reject_delay = 1
335
336         #
337         #  status_server: Whether or not the server will respond
338         #  to Status-Server requests.
339         #
340         #  Normally this should be set to "no", because they're useless.
341         #  See: http://www.freeradius.org/rfc/rfc2865.html#Keep-Alives
342         #
343         #  However, certain NAS boxes may require them. 
344         #
345         #  When sent a Status-Server message, the server responds with
346         #  and Access-Accept packet, containing a Reply-Message attribute,
347         #  which is a string describing how long the server has been
348         #  running.
349         #
350         status_server = no
351 }
352
353 # PROXY CONFIGURATION
354 #
355 #  proxy_requests: Turns proxying of RADIUS requests on or off.
356 #
357 #  The server has proxying turned on by default.  If your system is NOT
358 #  set up to proxy requests to another server, then you can turn proxying
359 #  off here.  This will save a small amount of resources on the server.
360 #
361 #  If you have proxying turned off, and your configuration files say
362 #  to proxy a request, then an error message will be logged.
363 #
364 #  To disable proxying, change the "yes" to "no", and comment the
365 #  $INCLUDE line.
366 #
367 #  allowed values: {no, yes}
368 #
369 proxy_requests  = yes
370 $INCLUDE  ${confdir}/proxy.conf
371
372
373 # CLIENTS CONFIGURATION
374 #
375 #  Client configuration is defined in "clients.conf".  
376 #
377
378 #  The 'clients.conf' file contains all of the information from the old
379 #  'clients' and 'naslist' configuration files.  We recommend that you
380 #  do NOT use 'client's or 'naslist', although they are still
381 #  supported.
382 #
383 #  Anything listed in 'clients.conf' will take precedence over the
384 #  information from the old-style configuration files.
385 #
386 $INCLUDE  ${confdir}/clients.conf
387
388
389 # SNMP CONFIGURATION
390 #
391 #  Snmp configuration is only valid if SNMP support was enabled
392 #  at compile time.
393 #
394 #  To enable SNMP querying of the server, set the value of the
395 #  'snmp' attribute to 'yes'
396 #
397 snmp    = no
398 $INCLUDE  ${confdir}/snmp.conf
399
400
401 # THREAD POOL CONFIGURATION
402 #
403 #  The thread pool is a long-lived group of threads which
404 #  take turns (round-robin) handling any incoming requests.
405 #
406 #  You probably want to have a few spare threads around,
407 #  so that high-load situations can be handled immediately.  If you
408 #  don't have any spare threads, then the request handling will
409 #  be delayed while a new thread is created, and added to the pool.
410 #
411 #  You probably don't want too many spare threads around,
412 #  otherwise they'll be sitting there taking up resources, and
413 #  not doing anything productive.
414 #
415 #  The numbers given below should be adequate for most situations.
416 #
417 thread pool {
418         #  Number of servers to start initially --- should be a reasonable
419         #  ballpark figure.
420         start_servers = 5
421
422         #  Limit on the total number of servers running.
423         #
424         #  If this limit is ever reached, clients will be LOCKED OUT, so it
425         #  should NOT BE SET TOO LOW.  It is intended mainly as a brake to
426         #  keep a runaway server from taking the system with it as it spirals
427         #  down...
428         #
429         #  You may find that the server is regularly reaching the
430         #  'max_servers' number of threads, and that increasing
431         #  'max_servers' doesn't seem to make much difference.
432         #
433         #  If this is the case, then the problem is MOST LIKELY that
434         #  your back-end databases are taking too long to respond, and
435         #  are preventing the server from responding in a timely manner.
436         #
437         #  The solution is NOT do keep increasing the 'max_servers'
438         #  value, but instead to fix the underlying cause of the
439         #  problem: slow database, or 'hostname_lookups=yes'.
440         #
441         #  For more information, see 'max_request_time', above.
442         #
443         max_servers = 32
444
445         #  Server-pool size regulation.  Rather than making you guess
446         #  how many servers you need, FreeRADIUS dynamically adapts to
447         #  the load it sees, that is, it tries to maintain enough
448         #  servers to handle the current load, plus a few spare
449         #  servers to handle transient load spikes.
450         #
451         #  It does this by periodically checking how many servers are
452         #  waiting for a request.  If there are fewer than
453         #  min_spare_servers, it creates a new spare.  If there are
454         #  more than max_spare_servers, some of the spares die off.
455         #  The default values are probably OK for most sites.
456         #
457         min_spare_servers = 3
458         max_spare_servers = 10
459
460         #  There may be memory leaks or resource allocation problems with
461         #  the server.  If so, set this value to 300 or so, so that the
462         #  resources will be cleaned up periodically.
463         #
464         #  This should only be necessary if there are serious bugs in the
465         #  server which have not yet been fixed.
466         #
467         #  '0' is a special value meaning 'infinity', or 'the servers never
468         #  exit'
469         max_requests_per_server = 0
470 }
471
472 # MODULE CONFIGURATION
473 #
474 #  The names and configuration of each module is located in this section.
475 #
476 #  After the modules are defined here, they may be referred to by name,
477 #  in other sections of this configuration file.
478 #
479 modules {
480
481         # PAP module to authenticate users based on their stored password
482         #
483         #  Supports multiple encryption schemes
484         #  clear: Clear text
485         #  crypt: Unix crypt
486         #    md5: MD5 ecnryption
487         #   sha1: SHA1 encryption.
488         #  DEFAULT: crypt
489         pap {
490                 encryption_scheme = crypt
491         }
492
493         # CHAP module
494         #
495         #  To authenticate requests containing a CHAP-Password attribute.
496         #
497         chap {
498                 authtype = CHAP
499         }
500
501         # Pluggable Authentication Modules
502         #
503         #  For Linux, see:
504         #       http://www.kernel.org/pub/linux/libs/pam/index.html
505         #
506         pam {
507                 #
508                 #  The name to use for PAM authentication.
509                 #  PAM looks in /etc/pam.d/${pam_auth_name}
510                 #  for it's configuration.  See 'redhat/radiusd-pam'
511                 #  for a sample PAM configuration file.
512                 #
513                 #  Note that any Pam-Auth attribute set in the 'authorize'
514                 #  section will over-ride this one.
515                 #
516                 pam_auth = radiusd
517         }
518
519         # Unix /etc/passwd style authentication
520         #
521         unix {
522                 #
523                 #  Cache /etc/passwd, /etc/shadow, and /etc/group
524                 #
525                 #  The default is to NOT cache them.
526                 #
527                 #  For FreeBSD, you do NOT want to enable the cache,
528                 #  as it's password lookups are done via a database, so
529                 #  set this value to 'no'.
530                 #
531                 #  Some systems (e.g. RedHat Linux with pam_pwbd) can
532                 #  take *seconds* to check a password, from a passwd
533                 #  file containing 1000's of entries.  For those systems,
534                 #  you should set the cache value to 'yes', and set
535                 #  the locations of the 'passwd', 'shadow', and 'group'
536                 #  files, below.
537                 #
538                 # allowed values: {no, yes}
539                 cache = no
540
541                 # Reload the cache every 600 seconds (10mins). 0 to disable.
542                 cache_reload = 600
543
544                 #
545                 #  Define the locations of the normal passwd, shadow, and
546                 #  group files.
547                 #
548                 #  'shadow' is commented out by default, because not all
549                 #  systems have shadow passwords.
550                 #
551                 #  To force the module to use the system password functions,
552                 #  instead of reading the files, leave the following entries
553                 #  commented out.
554                 #
555                 #  This is required for some systems, like FreeBSD,
556                 #  and Mac OSX.
557                 #
558                 #       passwd = /etc/passwd
559                 #       shadow = /etc/shadow
560                 #       group = /etc/group
561
562
563                 #
564                 #  Where the 'wtmp' file is located.
565                 #  This should be moved to it's own module soon.
566                 #
567                 #  The only use for 'radlast'.  If you don't use
568                 #  'radlast', then you can comment out this item.
569                 #
570                 radwtmp = ${logdir}/radwtmp
571         }
572
573         # Extensible Authentication Protocol
574         #
575         #  For all EAP related authentications 
576         eap {
577                 # Invoke the default supported EAP type when
578                 # EAP-Identity response is received
579                 #       default_eap_type = md5
580
581                 # Default expiry time to clean the EAP list,
582                 # It is maintained to co-relate the
583                 # EAP-response for each EAP-request sent.
584                 #       timer_expire     = 60
585
586                 # Supported EAP-types
587                 md5 {
588                 }
589
590                 ## EAP-TLS is highly experimental EAP-Type at the moment.  
591                 #       Please give feedback on the mailing list.
592                 #tls {
593                 #       private_key_password = password
594                 #       private_key_file = /path/filename
595
596                 #       If Private key & Certificate are located in the
597                 #       same file, then private_key_file & certificate_file
598                 #       must contain the same file name.
599                 #       certificate_file = /path/filename
600
601                 #       Trusted Root CA list
602                         #CA_file = /path/filename
603
604                 #       dh_file = /path/filename
605                         #random_file = /path/filename
606                 #
607                 #       This can never exceed MAX_RADIUS_LEN (4096)
608                 #       preferably half the MAX_RADIUS_LEN, to
609                 #       accomodate other attributes in RADIUS packet.
610                 #       On most APs the MAX packet length is configured
611                 #       between 1500 - 1600. In these cases, fragment
612                 #       size should be <= 1024.
613                 #
614                 #               fragment_size = 1024
615
616                 #       include_length is a flag which is by default set to yes
617                 #       If set to yes, Total Length of the message is included
618                 #       in EVERY packet we send.
619                 #       If set to no, Total Length of the message is included
620                 #       ONLY in the First packet of a fragment series.
621                 #
622                 #               include_length = yes
623                 #}
624         }
625
626         # Microsoft CHAP authentication
627         #
628         #  This module supports SAMBA passwd file authorization
629         #  and MS-CHAP, MS-CHAPv2 authentication.  However, we recommend
630         #  using the 'passwd' module, below, as it's more general.
631         #
632         mschap {
633                 # Location of the SAMBA passwd file
634                 #       passwd = /etc/smbpasswd
635
636                 # authtype value, if present, will be used
637                 # to overwrite (or add) Auth-Type during
638                 # authorization. Normally should be MS-CHAP
639                 authtype = MS-CHAP
640                 
641                 # If ignore_password is set to yes mschap will
642                 # ignore the password set by any other module during
643                 # authorization and will always use the SAMBA password file
644                 #       ignore_password = yes  
645
646                 # if use_mppe is not set to no mschap will
647                 # add MS-CHAP-MPPE-Keys for MS-CHAPv1 and
648                 # MS-MPPE-Recv-Key/MS-MPPE-Send-Key for MS-CHAPv2
649                 #       use_mppe = no
650
651                 # if mppe is enabled require_encryption makes
652                 # encryption moderate
653                 #       require_encryption = yes
654
655                 # require_strong always requires 128 bit key
656                 # encryption
657                 #       require_strong = yes
658         }
659
660         # Lightweight Directory Access Protocol (LDAP)
661         #
662         #  This module definition allows you to use LDAP for
663         #  authorization and authentication (Auth-Type := LDAP)
664         #
665         #  See doc/rlm_ldap for description of configuration options 
666         #  and sample authorize{} and authenticate{} blocks 
667         ldap {
668                 server = "ldap.your.domain"
669                 # identity = "cn=admin,o=My Org,c=UA"
670                 # password = mypass
671                 basedn = "o=My Org,c=UA"
672                 filter = "(uid=%{Stripped-User-Name:-%{User-Name}})"
673
674                 # set this to 'yes' to use TLS encrypted connections
675                 # to the LDAP database by using the StartTLS extended
676                 # operation.
677                 start_tls = no
678                 # set this to 'yes' to use TLS encrypted connections to the
679                 # LDAP database by passing the LDAP_OPT_X_TLS_TRY option to
680                 # the ldap library.
681                 tls_mode = no
682
683                 # default_profile = "cn=radprofile,ou=dialup,o=My Org,c=UA"
684                 # profile_attribute = "radiusProfileDn"
685                 access_attr = "dialupAccess"
686
687                 # Mapping of RADIUS dictionary attributes to LDAP
688                 # directory attributes.
689                 dictionary_mapping = ${raddbdir}/ldap.attrmap
690
691                 # ldap_cache_timeout = 120
692                 # ldap_cache_size = 0
693                 ldap_connections_number = 5
694                 # password_header = "{clear}"
695                 # password_attribute = userPassword
696                 # groupname_attribute = cn
697                 # groupmembership_filter = "(|(&(objectClass=GroupOfNames)(member=%{Ldap-UserDn}))(&(objectClass=GroupOfUniqueNames)(uniquemember=%{Ldap-UserDn})))"
698                 # groupmembership_attribute = radiusGroupName
699                 timeout = 4
700                 timelimit = 3
701                 net_timeout = 1
702                 # compare_check_items = yes
703                 # access_attr_used_for_allow = yes
704         }
705
706         # passwd module allows to do authorization via any passwd-like
707         # file and to extract any attributes from these modules
708         #
709         # parameters are:
710         #   filename - path to filename
711         #   format - format for filename record. This parameters
712         #            correlates record in the passwd file and RADIUS
713         #            attributes.
714         #
715         #            Field marked as '*' is key field. That is, the parameter
716         #            with this name from the request is used to search for
717         #            the record from passwd file
718         #
719         #            Field marked as ',' may contain a comma separated list
720         #            of attributes.
721         #   authtype - if record found this Auth-Type is used to authenticate
722         #            user
723         #   hashsize - hashtable size. If 0 or not specified records are not
724         #            stored in memory and file is red on every request.
725         #   allowmultiplekeys - if few records for every key are allowed
726         #   ignorenislike - ignore NIS-related records
727         #   delimiter - symbol to use as a field separator in passwd file,
728         #            for format ':' symbol is always used. '\0', '\n' are
729         #            not allowed 
730         #
731         #passwd etc_smbpasswd {
732         #       filename = /etc/smbpasswd
733         #       format = "*User-Name::LM-Password:NT-Password:SMB-Account-CTRL-TEXT::"
734         #       authtype = MS-CHAP
735         #       hashsize = 100
736         #       ignorenislike = no
737         #       allowmultiplekeys = no
738         #}
739
740         #  Similar configuration, for the /etc/group file. Adds a Group-Name
741         #  attribute for every group that the user is member of.
742         #
743         #passwd etc_group {
744         #       filename = /etc/group
745         #       format = "Group-Name:::*,User-Name"
746         #       hashsize = 50
747         #       ignorenislike = yes
748         #       allowmultiplekeys = yes
749         #       delimiter = ":"
750         #}
751
752         # Realm module, for proxying.
753         #
754         #  You can have multiple instances of the realm module to
755         #  support multiple realm syntaxs at the same time.  The
756         #  search order is defined the order in the authorize and
757         #  preacct blocks after the module config block.
758         #
759         #  Two config options:
760         #       format     -  must be 'prefix' or 'suffix'
761         #       delimiter  -  must be a single character
762
763         #  'username@realm'
764         #
765         realm suffix {
766                 format = suffix
767                 delimiter = "@"
768         }
769
770         #  'realm/username'
771         #
772         #  Using this entry, IPASS users have their realm set to "IPASS".
773         realm realmslash {
774                 format = prefix
775                 delimiter = "/"
776         }
777
778         #  'username%realm'
779         #
780         realm realmpercent {
781                 format = suffix
782                 delimiter = "%"
783         }
784         
785         #  rewrite arbitrary packets.  Useful in accounting and authorization.
786         #
787         ## This module is highly experimental at the moment.  Please give 
788         ## feedback to the mailing list.
789         #
790         #  The module can also use the Rewrite-Rule attribute. If it
791         #  is set and matches the name of the module instance, then
792         #  that module instance will be the only one which runs.
793         #
794         #  Also if new_attribute is set to yes then a new attribute
795         #  will be created containing the value replacewith and it
796         #  will be added to searchin (packet, reply or config).
797         # searchfor,ignore_case and max_matches will be ignored in that case.
798
799         #
800         #attr_rewrite sanecallerid {
801         #       attribute = Called-Station-Id
802                 # may be "packet", "reply", or "config"
803         #       searchin = packet
804         #       searchfor = "[+ ]"
805         #       replacewith = ""
806         #       ignore_case = no
807         #       new_attribute = no
808         #       max_matches = 10
809         #       ## If set to yes then the replace string will be appended to the original string
810         #       append = no
811         #}
812
813         # Preprocess the incoming RADIUS request, before handing it off
814         # to other modules.
815         #
816         #  This module processes the 'huntgroups' and 'hints' files.
817         #  In addition, it re-writes some weird attributes created
818         #  by some NASes, and converts the attributes into a form which
819         #  is a little more standard.
820         #
821         preprocess {
822                 huntgroups = ${confdir}/huntgroups
823                 hints = ${confdir}/hints
824
825                 # This hack changes Ascend's wierd port numberings
826                 # to standard 0-??? port numbers so that the "+" works
827                 # for IP address assignments.
828                 with_ascend_hack = no
829                 ascend_channels_per_line = 23
830
831                 # Windows NT machines often authenticate themselves as
832                 # NT_DOMAIN\username
833                 #
834                 # If this is set to 'yes', then the NT_DOMAIN portion
835                 # of the user-name is silently discarded.
836                 with_ntdomain_hack = no
837
838                 # Specialix Jetstream 8500 24 port access server.
839                 #
840                 # If the user name is 10 characters or longer, a "/"
841                 # and the excess characters after the 10th are
842                 # appended to the user name.
843                 #
844                 # If you're not running that NAS, you don't need
845                 # this hack.
846                 with_specialix_jetstream_hack = no
847
848                 # Cisco sends it's VSA attributes with the attribute
849                 # name *again* in the string, like:
850                 #
851                 #   H323-Attribute = "h323-attribute=value".
852                 #
853                 # If this configuration item is set to 'yes', then
854                 # the redundant data in the the attribute text is stripped
855                 # out.  The result is:
856                 #
857                 #  H323-Attribute = "value"
858                 #
859                 # If you're not running a Cisco NAS, you don't need
860                 # this hack.
861                 with_cisco_vsa_hack = no
862         }
863
864         # Livingston-style 'users' file
865         #
866         files {
867                 usersfile = ${confdir}/users
868                 acctusersfile = ${confdir}/acct_users
869
870                 #  If you want to use the old Cistron 'users' file
871                 #  with FreeRADIUS, you should change the next line
872                 #  to 'compat = cistron'.  You can the copy your 'users'
873                 #  file from Cistron.
874                 compat = no
875         }
876
877         # Write a detailed log of all accounting records received.
878         #
879         detail {
880                 #  Note that we do NOT use NAS-IP-Address here, as
881                 #  that attribute MAY BE from the originating NAS, and
882                 #  NOT from the proxy which actually sent us the
883                 #  request.  The Client-IP-Address attribute is ALWAYS
884                 #  the address of the client which sent us the
885                 #  request.
886                 #
887                 #  The following line creates a new detail file for
888                 #  every radius client (by IP address or hostname).
889                 #  In addition, a new detail file is created every
890                 #  day, so that the detail file doesn't have to go
891                 #  through a 'log rotation'
892                 #
893                 #  If your detail files are large, you may also want
894                 #  to add a ':%H' (see doc/variables.txt) to the end
895                 #  of it, to create a new detail file every hour, e.g.:
896                 #
897                 #   ..../detail-%Y%m%d:%H
898                 #
899                 #  This will create a new detail file for every hour.
900                 #
901                 detailfile = ${radacctdir}/%{Client-IP-Address}/detail-%Y%m%d
902
903                 #
904                 #  The Unix-style permissions on the 'detail' file.
905                 #
906                 #  The detail file often contains secret or private
907                 #  information about users.  So by keeping the file
908                 #  permissions restrictive, we can prevent unwanted
909                 #  people from seeing that information.
910                 detailperm = 0600
911         }
912
913         # Create a unique accounting session Id.  Many NASes re-use or
914         # repeat values for Acct-Session-Id, causing no end of
915         # confusion.
916         #
917         #  This module will add a (probably) unique session id 
918         #  to an accounting packet based on the attributes listed
919         #  below found in the packet.  See doc/rlm_acct_unique for
920         #  more information.
921         #
922         acct_unique {
923                 key = "User-Name, Acct-Session-Id, NAS-IP-Address, Client-IP-Address, NAS-Port-Id"
924         }
925
926
927         #  Include another file that has the SQL-related configuration.
928         #  This is another file solely because it tends to be big.
929         #
930         #  The following configuration file is for use with MySQL.
931         #
932         #  For Postgresql, use:         ${confdir}/postgresql.conf
933         #  For MS-SQL, use:             ${confdir}/mssql.conf
934         #
935         $INCLUDE  ${confdir}/sql.conf
936
937         #  Write a 'utmp' style file, of which users are currently
938         #  logged in, and where they've logged in from.
939         #
940         #  This file is used mainly for Simultaneous-Use checking,
941         #  and also 'radwho', to see who's currently logged in.
942         #
943         radutmp {
944                 #  Where the file is stored.  It's not a log file,
945                 #  so it doesn't need rotating.
946                 #
947                 filename = ${logdir}/radutmp
948
949                 #  The field in the packet to key on for the
950                 #  'user' name,  If you have other fields which you want
951                 #  to use to key on to control Simultaneous-Use,
952                 #  then you can use them here.
953                 #
954                 #  Note, however, that the size of the field in the
955                 #  'utmp' data structure is small, around 32
956                 #  characters, so that will limit the possible choices
957                 #  of keys.
958                 #
959                 username = %{User-Name}
960
961                 #  Whether or not we want to treat "user" the same
962                 #  as "USER", or "User".  Some systems have problems
963                 #  with case sensitivity, so this should be set to
964                 #  'no' to enable the comparisons of the key attribute
965                 #  to be case insensitive.
966                 #
967                 case_sensitive = yes
968
969                 #  Accounting information may be lost, so the user MAY
970                 #  have logged off of the NAS, but we haven't noticed.
971                 #  If so, we can verify this information with the NAS,
972                 #
973                 #  If we want to believe the 'utmp' file, then this
974                 #  configuration entry can be set to 'no'.
975                 #
976                 check_with_nas = yes            
977
978                 # Set the file permissions, as the contents of this file
979                 # are usually private.
980                 perm = 0600
981
982                 callerid = "yes"
983         }
984
985         # "Safe" radutmp - does not contain caller ID, so it can be
986         # world-readable, and radwho can work for normal users, without
987         # exposing any information that isn't already exposed by who(1).
988         #
989         # This is another instance of the radutmp module, but it is given
990         # then name "sradutmp" to identify it later in the "accounting"
991         # section.
992         radutmp sradutmp {
993                 filename = ${logdir}/sradutmp
994                 perm = 0644
995                 callerid = "no"
996         }
997
998         # attr_filter - filters the attributes received in replies from
999         # proxied servers, to make sure we send back to our RADIUS client
1000         # only allowed attributes.
1001         attr_filter {
1002                 attrsfile = ${confdir}/attrs
1003         }
1004
1005         #  This module takes an attribute (count-attribute).
1006         #  It also takes a key, and creates a counter for each unique
1007         #  key.  The count is incremented when accounting packets are
1008         #  received by the server.  The value of the increment depends
1009         #  on the attribute type.
1010         #  If the attribute is Acct-Session-Time or an integer we add the
1011         #  value of the attribute. If it is anything else we increase the
1012         #  counter by one.
1013         #
1014         #  The 'reset' parameter defines when the counters are all reset to
1015         #  zero.  It can be hourly, daily, weekly, monthly or never.
1016         #  It can also be user defined. It should be of the form:
1017         #  num[hdwm] where:
1018         #  h: hours, d: days, w: weeks, m: months
1019         #  If the letter is ommited days will be assumed. In example:
1020         #  reset = 10h (reset every 10 hours)
1021         #  reset = 12  (reset every 12 days)
1022         #
1023         #
1024         #  The check-name attribute defines an attribute which will be
1025         #  registered by the counter module and can be used to set the
1026         #  maximum allowed value for the counter after which the user
1027         #  is rejected.
1028         #  Something like:
1029         #
1030         #  DEFAULT Max-Daily-Session := 36000
1031         #          Fall-Through = 1
1032         #
1033         #  You should add the counter module in the instantiate
1034         #  section so that it registers check-name before the files
1035         #  module reads the users file.
1036         #
1037         #  If check-name is set and the user is to be rejected then we
1038         #  send back a Reply-Message and we log a Failure-Message in
1039         #  the radius.log
1040         #
1041         #  The counter-name can also be used like below:
1042         #
1043         #  DEFAULT  Daily-Session-Time > 3600, Auth-Type = Reject
1044         #      Reply-Message = "You've used up more than one hour today"
1045         #
1046         #  The allowed-servicetype attribute can be used to only take
1047         #  into account specific sessions. For example if a user first
1048         #  logs in through a login menu and then selects ppp there will
1049         #  be two sessions. One for Login-User and one for Framed-User
1050         #  service type. We only need to take into account the second one.
1051         #
1052         #  The module should be added in the instantiate, authorize and
1053         #  accounting sections.  Make sure that in the authorize
1054         #  section it comes after any module which sets the
1055         #  'check-name' attribute.
1056         #
1057         counter daily {
1058                 filename = ${raddbdir}/db.daily
1059                 key = User-Name
1060                 count-attribute = Acct-Session-Time
1061                 reset = daily
1062                 counter-name = Daily-Session-Time
1063                 check-name = Max-Daily-Session
1064                 allowed-servicetype = Framed-User
1065                 cache-size = 5000
1066         }
1067
1068         # The "always" module is here for debugging purposes. Each
1069         # instance simply returns the same result, always, without
1070         # doing anything.
1071         always fail {
1072                 rcode = fail
1073         }
1074         always reject {
1075                 rcode = reject
1076         }
1077         always ok {
1078                 rcode = ok
1079                 simulcount = 0
1080                 mpp = no
1081         }
1082
1083         #
1084         #  The 'expression' module current has no configuration.
1085         expr {
1086         }
1087
1088         # ANSI X9.9 token support.  Not included by default.
1089         # $INCLUDE  ${confdir}/x99.conf
1090
1091 }
1092
1093 # Instantiation
1094 #
1095 #  This section orders the loading of the modules.  Modules
1096 #  listed here will get loaded BEFORE the later sections like
1097 #  authorize, authenticate, etc. get examined.
1098 #
1099 #  This section is not strictly needed.  When a section like
1100 #  authorize refers to a module, it's automatically loaded and
1101 #  initialized.  However, some modules may not be listed in any
1102 #  of the following sections, so they can be listed here.
1103 #
1104 #  Also, listing modules here ensures that you have control over
1105 #  the order in which they are initalized.  If one module needs
1106 #  something defined by another module, you can list them in order
1107 #  here, and ensure that the configuration will be OK.
1108 #
1109 instantiate {
1110         #
1111         #  The expression module doesn't do authorization,
1112         #  authentication, or accounting.  It only does dynamic
1113         #  translation, of the form:
1114         #
1115         #       Session-Timeout = `%{expr:2 + 3}`
1116         #
1117         #  So the module needs to be instantiated, but CANNOT be
1118         #  listed in any other section.  See 'doc/rlm_expr' for
1119         #  more information.
1120         #
1121         expr
1122         #
1123         # We add the counter module here so that it registers
1124         # the check-name attribute before any module which sets
1125         # it
1126 #       daily
1127 }
1128
1129 #  Authorization. First preprocess (hints and huntgroups files),
1130 #  then realms, and finally look in the "users" file.
1131 #
1132 #  The order of the realm modules will determine the order that
1133 #  we try to find a matching realm.
1134 #
1135 #  Make *sure* that 'preprocess' comes before any realm if you 
1136 #  need to setup hints for the remote radius server
1137 authorize {
1138         #
1139         #  The preprocess module takes care of sanitizing some bizarre
1140         #  attributes in the request, and turning them into attributes
1141         #  which are more standard.
1142         #
1143         #  It takes care of processing the 'raddb/hints' and the
1144         #  'raddb/huntgroups' files.
1145         #
1146         #  It also adds a Client-IP-Address attribute to the request.
1147         preprocess
1148         
1149         #
1150         #  The chap module will set 'Auth-Type := CHAP' if we are
1151         #  handling a CHAP request and Auth-Type has not already been set
1152         chap
1153
1154         #
1155         #  If the users are logging in with an MS-CHAP-Challenge
1156         #  attribute for authentication, the mschap module will find
1157         #  the MS-CHAP-Challenge attribute, and add 'Auth-Type := MS-CHAP'
1158         #  to the request, which will cause the server to then use
1159         #  the mschap module for authentication.
1160         mschap
1161
1162 #       attr_filter
1163 #       eap
1164         suffix
1165         files
1166 #       etc_smbpasswd
1167
1168
1169 # The ldap module will set Auth-Type to LDAP if it has not already been set
1170 #       ldap
1171 #       daily
1172 }
1173
1174
1175 # Authentication.
1176 #
1177 #  This section lists which modules are available for authentication.
1178 #  Note that it does NOT mean 'try each module in order'.  It means
1179 #  that you have to have a module from the 'authorize' section add
1180 #  a configuration attribute 'Auth-Type := FOO'.  That authentication type
1181 #  is then used to pick the apropriate module from the list below.
1182 #
1183 #  The default Auth-Type is Local.  That is, whatever is not included inside
1184 # an authtype section will be called only if Auth-Type is set to Local.
1185 #
1186 # So you should do the following:
1187 # - Set Auth-Type to an appropriate value in the authorize modules above.
1188 #   For example, the chap module will set Auth-Type to CHAP, ldap to LDAP, etc.
1189 # - After that create corresponding authtype sections in the
1190 #   authenticate section below and call the appropriate modules.
1191 authenticate {
1192         #
1193         #  PAP authentication, when a back-end database listed
1194         #  in the 'authorize' section supplies a password.  The
1195         #  password can be clear-text, or encrypted.
1196         authtype PAP {
1197                 pap
1198         }
1199
1200         #
1201         #  Most people want CHAP authentication
1202         #  A back-end database listed in the 'authorize' section
1203         #  MUST supply a CLEAR TEXT password.  Encrypted passwords
1204         #  won't work.
1205         authtype CHAP {
1206                 chap
1207         }
1208
1209         #
1210         #  MSCHAP authentication.
1211         authtype MS-CHAP {
1212                 mschap
1213         }
1214
1215 #       pam
1216
1217         #
1218         #  See 'man getpwent' for information on how the 'unix'
1219         #  module checks the users password.  Note that packets
1220         #  containing CHAP-Password attributes CANNOT be authenticated
1221         #  against /etc/passwd!  See the FAQ for details.
1222         #  
1223         unix
1224
1225         # Uncomment it if you want to use ldap for authentication
1226 #       authtype LDAP {
1227 #               ldap
1228 #       }
1229
1230
1231 #       eap
1232 }
1233
1234
1235 #  Pre-accounting. Look for proxy realm in order of realms, then 
1236 #  acct_users file, then preprocess (hints file).
1237 preacct {
1238         preprocess
1239         suffix
1240         files
1241 }
1242
1243
1244 #  Accounting. Log to detail file, and to the radwtmp file, and maintain
1245 #  radutmp.
1246 accounting {
1247         acct_unique
1248         detail
1249 #       daily
1250         unix            # wtmp file
1251         radutmp
1252 #       sradutmp
1253 }
1254
1255
1256 #  Session database, used for checking Simultaneous-Use. Either the radutmp 
1257 #  or rlm_sql module can handle this.
1258 #  The rlm_sql module is *much* faster
1259 session {
1260         radutmp
1261 #       sql
1262 }
1263
1264
1265 #  Post-Authentication
1266 #  Once we KNOW that the user has been authenticated, there are
1267 #  additional steps we can take.
1268 post-auth {
1269           #  Get an address from the IP Pool.
1270           #main_pool
1271 }