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