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