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