This is the bigger part of the modular session framework. It is not ready to
[freeradius.git] / raddb / radiusd.conf.in
1 ##
2 ## radiusd.conf -- FreeRADIUS server configuration file.
3 ##
4 ##      http://www.freeradius.org/
5 ##
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
16 # Stuff from autoconf
17 prefix = @prefix@
18 exec_prefix = @exec_prefix@
19 sysconfdir = @sysconfdir@
20 localstatedir = @localstatedir@
21 sbindir = @sbindir@
22 logdir = @logdir@
23 libdir = @libdir@
24 raddbdir = @raddbdir@
25 radacctdir = @radacctdir@
26
27 #
28 #  Location of config and logfiles.
29 #
30 confdir    = ${raddbdir}
31
32 run_dir    = ${localstatedir}/run
33
34 #
35 #  pidfile: Where to place the PID of the RADIUS server.
36 #
37 #  The server may be signalled while it's running by using this
38 #  file.
39 #
40 #  e.g.:  kill -HUP `cat /var/run/radiusd.pid`
41 #
42 pidfile    = ${run_dir}/radiusd.pid
43
44 #
45 #  max_request_time: The maximum time (in seconds) to handle a request.
46 #
47 #  Requests which take more time than this to process are killed, and
48 #  a REJECT message is returned.
49 #
50 #  Useful range of values: 5 to 120
51 #
52 max_request_time        = 30
53
54 #
55 #  cleanup_delay: The time to wait (in seconds) before cleaning up
56 #  a reply which was sent to the NAS.
57 #
58 #  The RADIUS request is normally cached internally for a short period
59 #  of time, after the reply is sent to the NAS.  The reply packet may be
60 #  lost in the network, and the NAS will not see it.  The NAS will then
61 #  re-send the request, and the server will respond quickly with the
62 #  cached reply.
63 #
64 #  If this value is set too low, then duplicate requests from the NAS
65 #  MAY NOT be detected, and will instead be handled as seperate requests.
66 #
67 #  If this value is set too high, then the server will cache too many
68 #  requests, and some new requests may get blocked.  (See 'max_requests'.)
69 #
70 #  Useful range of values: 2 to 10
71 #
72 cleanup_delay           = 5
73
74 #
75 #  max_requests: The maximum number of requests which the server keeps
76 #  track of.  This should be 256 multiplied by the number of clients.
77 #  e.g. With 4 clients, this number should be 1024.
78 #
79 #  If this number is too low, then when the server becomes busy,
80 #  it will not respond to any new requests, until the 'cleanup_delay'
81 #  time has passed, and it has removed the old requests.
82 #
83 #  If this number is set too high, then the server will use a bit more
84 #  memory for no real benefit.
85 #
86 #  If you aren't sure what it should be set to, it's better to set it
87 #  too high than too low.  Setting it to 1000 per client is probably
88 #  the highest it should be.
89 #
90 #  Useful range of values: 256 to infinity
91 #
92 max_requests            = 1024
93
94 #
95 #  bind_address:  Make the server listen on a particular IP address, and
96 #  send replies out from that address.  This directive is most useful
97 #  for machines with multiple IP addresses on one interface.
98 #
99 #  It can either contain "*", or an IP address, or a fully qualified
100 #  Internet domain name.  The default is "*"
101 #
102 bind_address            = *
103
104 #
105 #  port: Allows you to bind FreeRADIUS to a specific port.
106 #
107 #  The default port that most NAS boxes use is 1645, which is historical.
108 #  RFC 2138 defines 1812 to be the new port.  Many new servers and
109 #  NAS boxes use 1812, which can create interoperability problems.
110 #
111 #  The port is defined here to be 0 so that the server will pick up
112 #  the machine's local configuration for the radius port, as defined
113 #  in /etc/services.
114 #
115 #  If you want to use the default RADIUS port as defined on your server,
116 #  (usually through 'grep radius /etc/services') set this to 0 (zero).
117 #
118 #  A port given on the command-line via '-p' over-rides this one.
119 #
120 port = 0
121
122 #
123 #  Which program to execute check doing concurrency checks.
124 #
125 checkrad   = ${sbindir}/checkrad
126
127 #
128 #  hostname_lookups: Log the names of clients or just their IP addresses
129 #  e.g., www.freeradius.org (on) or 206.47.27.232 (off).
130 #  The default is off because it'd be overall better for the net if people
131 #  had to knowingly turn this feature on, since enabling it means that
132 #  each client request will result in AT LEAST one lookup request to the
133 #  nameserver.
134 #
135 #  Turning hostname lookups off also means that the server won't block
136 #  for 30 seconds, if it sees an IP address which has no name associated
137 #  with it.
138 #
139 # allowed values: {no, yes}
140 #
141 hostname_lookups        = no
142
143 #
144 #  Core dumps are a bad thing.  This should only be set to 'yes'
145 #  if you're debugging a problem with the server.
146 #
147 # allowed values: {no, yes}
148 #
149 allow_core_dumps        = no
150
151 #
152 #  Log the full User-Name attribute, as it was found in the request.
153 #
154 # allowed values: {no, yes}
155 #
156 log_stripped_names      = no
157
158 #
159 #  Log authentication requests to the log file.
160 #
161 # allowed values: {no, yes}
162 #
163 log_auth        = no
164
165 #
166 #  Log passwords with the authentication requests.
167 #
168 # allowed values: {no, yes}
169 #
170 log_auth_pass   = no
171
172 #
173 #  proxy_requests: Turns proxying of RADIUS requests on or off.
174 #
175 #  The server has proxying turned on by default.  If your system is NOT
176 #  set up to proxy requests to another server, then you can turn proxying
177 #  off here.  This will save a small amount of resources on the server.
178 #
179 #  If you have proxying turned off, and your configuration files say
180 #  to proxy a request, then an error message will be logged.
181 #
182 # allowed values: {no, yes}
183 #
184 proxy_requests  = yes
185
186 #######################################################################
187 #
188 #  SNMP configuration
189 #
190 #  NOTE: This part will only work if your radiusd is compiled with SNMP
191 #  support.
192 #
193 #  smux_password: Password used for SMUX registration.
194 #
195 #  Specifies password used when connecting to the SNMP master agent.
196 #  This must match the password as configured on the agent. The OID
197 #  used to register the radius subagent is 1.3.6.1.4.1.3317.1.3.1.
198 #  A sample entry for the ucd-snmp deamon looks like this:
199 #
200 #  smuxpeer .1.3.6.1.4.1.3317.1.3.1 verysecret
201 #
202 #  A sample entry for AIX 4.3 is:
203 #
204 #  smux 1.3.6.1.4.1.3317.1.3.1 verysecret
205 #
206 #  The default password is an empty password.
207 #
208 #smux_password = verysecret
209 #
210 #  snmp_write_access:
211 #
212 #  Controls if write access to the radiusd via SNMP is enabled or not.
213 #  Set this value to yes, if you want to be able to reload radiusd from
214 #  your network management station.
215 #
216 #  For this to work, you also have to make sure that your master agent
217 #  is configured to allow SNMP set requests. For security reasons, this
218 #  setting defaults to no.
219 #
220 # allowed values: {no, yes}
221 #
222 #snmp_write_access = no
223
224 #######################################################################
225 #
226 #  Proxy server configuration
227 #
228 #  This entry controls the servers behaviour towards ALL other servers
229 #  to which it sends proxy requests.
230 #
231 proxy server {
232
233 #
234 #  If the NAS re-sends the request to us, we can immediately re-send
235 #  the proxy request to the end server.  To do so, use 'yes' here.
236 #
237 #  If this is set to 'no', then we send the retries on our own schedule,
238 #  and ignore any duplicate NAS requests.
239 #
240 #  If you want to have the server send proxy retries ONLY when the NAS
241 #  sends it's retries to the server, then set this to 'yes', and
242 #  set the other proxy configuration parameters to 0 (zero).
243 #
244 # allowed values: {no, yes}
245 #
246         synchronous = no
247
248 #
249 #  After sending a proxied request to the end server, we wait
250 #  'retry_delay' seconds for the response.  If we do not receive a response
251 #  from the end server within that time, then the proxy request is sent
252 #  again to the end server.  We then wait another for another retry_delay.
253 #
254 #  If this timeout is set too high, then the NAS *may* give up on the
255 #  request before we send a reply back to it.  Most NAS boxes will give up
256 #  on requests within 30 seconds.
257 #
258 #  If this timeout is set too low, then the end server may not have time
259 #  to finish processing the request, before it receives the retry.  Many
260 #  radius servers can take 2-3 seconds to process a request.
261 #
262         retry_delay = 5
263
264 #
265 #  The number of times we send retry packets to the end server.
266 #  If we send 'retry_count' packets without receiving a response,
267 #  then we give up on that server, and return a rejection
268 #  message to the NAS.
269 #
270         retry_count = 3
271 }
272
273 #######################################################################
274 #
275 #  Thread pool configuration.
276 #
277 #  The thread pool is a long-lived group of threads which
278 #  take turns (round-robin) handling any incoming requests.
279 #
280 #
281 #  You probably want to have a few spare threads around,
282 #  so that high-load situations can be handled immediately.  If you
283 #  don't have any spare threads, then the request handling will
284 #  be delayed while a new thread is created, and added to the pool.
285 #
286 #  You probably don't want too many spare threads around,
287 #  otherwise they'll be sitting there taking up resources, and
288 #  not doing anything productive.
289 #
290 #  The numbers given below should be adequate for most situations.
291 #
292 #
293 thread pool {
294 #
295 #  Number of servers to start initially --- should be a reasonable ballpark
296 #  figure.
297 #
298         start_servers     = 5
299
300 #
301 #  Limit on the total number of servers running.
302 #
303 #  If this limit is ever reached, clients will be LOCKED OUT, so it
304 #  should NOT BE SET TOO LOW.  It is intended mainly as a brake to
305 #  keep a runaway server from taking the system with it as it spirals
306 #  down...
307 #
308         max_servers       = 32
309
310 #
311 #  Server-pool size regulation.  Rather than making you guess how many
312 #  servers you need, FreeRADIUS dynamically adapts to the load it
313 #  sees --- that is, it tries to maintain enough servers to
314 #  handle the current load, plus a few spare servers to handle transient
315 #  load spikes.
316 #
317 #  It does this by periodically checking how many servers are waiting
318 #  for a request.  If there are fewer than min_spare_servers, it creates
319 #  a new spare.  If there are more than max_spare_servers, some of the
320 #  spares die off.  The default values are probably OK for most sites.
321 #
322         min_spare_servers = 3
323         max_spare_servers = 10
324
325 #
326 #  There may be memory leaks or resource allocation problems with
327 #  the server.  If so, set this value to 300 or so, so that the
328 #  resources will be cleaned up periodically.
329 #
330 #  This should only be necessary if there are serious bugs in the
331 #  server which have not yet been fixed.
332 #
333 #  '0' is a special value meaning 'infinity', or 'the servers never exit'
334 #
335         max_requests_per_server = 0
336 }
337
338 #######################################################################
339 #
340 #  Definition of a NAS or a client.
341 #
342 #  The information given here is in ADDITION to the 'clients' file.
343 #
344 #  If this is defined as "client foo" then the hostname/ipaddr "foo"
345 #  will be looked up according to the source IP address of the radius
346 #  rqeuest packet, and the secret here will be used to check the
347 #  integrety of the request.
348 #
349 #  If this is defined as "nas foo" then foo will be looked up first
350 #  as the NAS-IP-Address in the radius request, then as the NAS-Ident
351 #  in the radius request.
352 #
353 #  Normally you'd use "client" unless the request came in through a
354 #  proxy server and you want to define a short name for the NAS
355 #  for logging purposes, or you want to do a "checkrad" back to the
356 #  original NAS and not to the proxy radius server!
357 #
358 #  The "shortname" can be used for logging, and the "vendor",
359 #  "type", "login" and "password" fields are mainly used for checkrad.
360 #
361
362 client 127.0.0.1 {
363         secret          = testing123
364         shortname       = localhost
365 }
366
367 #client some.host.org {
368 #       secret          = testing123
369 #       shortname       = localhost
370 #}
371
372
373 client 10.10.10.10 {
374         # secret and password are mapped through the "secrets" file.
375         secret      = testing123
376         shortname   = liv1
377         vendor      = livingston
378         # Type should extend to the line type, because of the "hole".
379         #Line#/T S Port  SNMP Port
380         #-------------------------
381         #1 PRI   0-22    1-23
382         #2 PRI   24-46   25-47
383         #1 CT1   0-23    1-24
384         #2 CT1   24-47   25-48
385         #1 E1    0-28    1-29
386         #2 E1    30-58   31-59
387         #And C0 is 96 in Radius.
388         type        = pm3-eur # pm3-i23 pm3-ct24 pm3-i30
389         login       = !root
390         password    = someadminpas
391 }
392
393 #######################################################################
394 #
395 #  Configuration for the proxy module.
396 #
397 #  The information given here is in ADDITION to the 'realms' file.
398 #
399 #realm isp2.com {
400 #       type        = radius
401 #       authhost    = radius.isp2.com:1645
402 #       accthost    = radius.isp2.com:1646
403 #       secret      = TheirKey
404 #       nostrip
405 #       utmpfile   += /var/log/radutmp.isp2
406 #       wtmpfile   += /var/log/radwtmp.isp2
407 #       detailfile += /var/log/radacct/isp2/detail
408 #}
409
410 #realm company.com {
411 #       type            = radius
412 #       authhost        = radius.company.com:1600
413 #       accthost        = radius.company.com:1601
414 #       secret          = testing123
415 #}
416
417 #realm bla.com {
418 #       type            = radius
419 #       authhost        = LOCAL
420 #       accthost        = LOCAL
421 #       secret          = testing123
422 #}
423
424 #realm myfakerealm {
425 #      type            = radius
426 #      authhost        = radius.company.com:1600
427 #      accthost        = radius.company.com:1601
428 #      secret          = testing123
429 #      notsuffix
430 #}
431
432
433 modules {
434         pam {
435                 # No config options for this yet
436         }
437         unix {
438                 #
439                 #  Cache /etc/passwd, /etc/shadow, and /etc/group
440                 #
441                 #  The default is to NOT cache them.  However, caching them can
442                 #  speed up system authentications by a substantial amount.
443                 #
444                 # allowed values: {no, yes}
445                 cache           = no
446
447                 #
448                 #  Define the locations of the normal passwd, shadow, and
449                 #  group files.
450                 #
451                 #  'shadow' is commented out by default, because not all
452                 #  systems have shadow passwords.
453                 #
454                 passwd          = /etc/passwd
455                 #       shadow          = /etc/shadow
456                 group           = /etc/group
457         }
458
459 # Uncomment this if you want to use ldap (Auth-Type = LDAP)
460 # Also uncomment it in the authenticate{} block below
461 #       ldap {
462 #               server   = localhost
463 #               login    = "cn=admin,o=My Org,c=US"
464 #               password = mypass
465 #               basedn   = "o=My Org,c=US"
466 #               filter   = "(uid=%u)"
467 #       }
468
469         realm {
470                 # No config options for this yet
471         }
472         preprocess {
473                 # No config options for this yet
474         }
475         files {
476                 usersfile = ${confdir}/users
477                 acctusersfile = ${confdir}/acct_users
478
479                 #
480                 #  If you want to use the old Cistron 'users' file
481                 #  with FreeRADIUS, you should change the next line
482                 #  to 'compat = cistron'.  You can the copy your 'users'
483                 #  file from Cistron.
484                 #
485                 compat = no
486         }
487         detail {
488                 detailfile = %A/%n/detail
489                 detailperm = 0600
490         }
491
492         # This module will add a (probably) unique session id 
493         # to an accounting packet based on the attributes listed
494         # below found in the packet.  see doc/README.rlm_acct_unique
495         acct_unique {
496                 key = "User-Name, Acct-Session-Id, NAS-IP-Address, NAS-Port-Id"
497         }
498
499
500 #
501 #  Configuration for the SQL module.
502 #
503         sql {
504         
505                 # Connect info
506                 server          = "localhost"
507                 login           = "root"
508                 password        = "rootpass"
509                 
510                 # Database table configuration
511                 radius_db       = "radius"
512                 acct_table      = "radacct"
513                 
514                 authcheck_table = "radcheck"
515                 authreply_table = "radreply"
516                 
517                 groupcheck_table = "radgroupcheck"
518                 groupreply_table = "radgroupreply"
519                 
520                 usergroup_table = "usergroup"
521                 
522                 realms_table    = "realms"
523                 realmgroup_table = "realmgroup"
524                 
525                 # Check case on usernames
526                 sensitiveusername = no
527         
528                 # Remove stale session if checkrad does not see a double login
529                 deletestalesessions = yes
530         
531                 # Print all SQL statements when in debug mode (-x)
532                 sqltrace        = no
533         }
534
535 #
536 #  A second instance of the same module, with the name "sql2" to identify it
537 #
538         sql sql2 {
539         
540                 # Connect info
541                 server          = "myothersever"
542                 login           = "root"
543                 password        = "rootpass"
544                 
545                 # Database table configuration
546                 radius_db       = "radius"
547                 acct_table      = "radacct"
548                 
549                 authcheck_table = "radcheck"
550                 authreply_table = "radreply"
551                 
552                 groupcheck_table = "radgroupcheck"
553                 groupreply_table = "radgroupreply"
554                 
555                 usergroup_table = "usergroup"
556                 
557                 realms_table    = "realms"
558                 realmgroup_table = "realmgroup"
559                 
560                 # Check case on usernames
561                 sensitiveusername = no
562         
563                 # Remove stale session if checkrad does not see a double login
564                 deletestalesessions = yes
565         
566                 # Print all SQL statements when in debug mode (-x)
567                 sqltrace        = no
568         }
569
570 #######################################################################
571 #
572 #       Configuration for the example module.  Uncommenting it will cause it
573 #       to get loaded and initialized, but should have no real effect as long
574 #       it is not referencened in one of the autz/auth/preacct/acct sections
575 #
576        example {
577        #
578        #  Boolean variable.
579        #
580        # allowed values: {no, yes}
581        #
582                boolean          = yes
583
584        #
585        #  An integer, of any value.
586        #
587                integer          = 16
588
589        #
590        #  A string.
591        #
592                string           = "This is an example configuration string"
593
594        #
595        # An IP address, either in dotted quad (1.2.3.4) or hostname
596        # (example.com)
597        #
598                ipaddr           = 127.0.0.1
599
600        #
601        # A subsection
602        #
603                mysubsection {
604                        anotherinteger = 1000
605        #
606        # They nest
607        #
608                        deeply nested {
609                                string = "This is a different string"
610                        }
611                }
612        }
613 }
614
615 # Authentication types, Auth-Type = System and PAM for now.
616 authenticate {
617         pam
618         unix
619 # By grouping modules together in an authtype block, that authtype will be
620 # tried on each module in sequence until one returns REJECT or OK. This
621 # allows authentication failover if the first SQL server has crashed, for
622 # example.
623 #       authtype SQL {
624 #               sql
625 #               sql2
626 #       }
627 # Uncomment this if you want to use ldap (Auth-Type = LDAP)
628 #       ldap
629 }
630
631 # Authorization. First preprocess (hints and huntgroups files),
632 # then realms, and finally look in the "users" file.
633 # Make *sure* that 'preprocess' comes before 'realm' if you 
634 # need to setup hints for the remote radius server
635 authorize {
636         preprocess
637         realm
638         files
639 }
640
641 # Pre-accounting. Look for proxy realm, first with the @suffix rule, then the
642 # acct_users file, then preprocess (hints file).
643 preacct {
644         realm
645         files
646         preprocess
647 }
648
649 # Accounting. Log to detail file, and to the radwtmp file.
650 accounting {
651         #acct_unique
652         detail
653         unix
654 }
655
656 # Session database, used for checking Simultaneous-Use. The radutmp module
657 # handles this
658 session {
659        radutmp
660 }