Changed
[freeradius.git] / raddb / templates.conf
1 ######################################################################
2 #
3 #  Version 2.0 has a useful new feature called "templates".
4 #
5 #  Use templates by adding a line in radiusd.conf:
6 #
7 #       $INCLUDE templates.conf.
8 #
9 #  Templates are not included in the default configuration because
10 #  they can have large effects on the server configuration.
11 #
12 #  The goal of the templates is to have common configuration located
13 #  in this file, and to list only the *differences* in the individual
14 #  sections.  This feature is most useful for sections like "clients"
15 #  or "home_servers", where many may be defined, and each one has
16 #  similar repeated configuration.
17 #
18 #  Something similar to templates can be done by putting common
19 #  configuration into separate files, and using "$INCLUDE file...",
20 #  but this is more flexible, and simpler to understand.  It's also
21 #  cheaper for the server, because "$INCLUDE" makes a copy of the
22 #  configuration for inclusion, and templates are simply referenced.
23 #
24 #  The templates are defined in the "templates" section, so that they
25 #  do not affect the rest of the server configuration.
26 #
27 templates {
28           #
29           #  The contents of the templates section are other
30           #  configuration sections that would normally go into
31           #  the configuration files.
32           #
33
34           #
35           #  This is a default template for the "home_server" section.
36           #  Note that there is no name for the section.
37           #
38           #  Any configuration item that is valid for a "home_server"
39           #  section is also valid here.  When a "home_server" section
40           #  is defined in proxy.conf, this section is referenced as
41           #  the template.
42           #
43           #  Configuration items that are explicitly listed in a
44           #  "home_server" section of proxy.conf are used in
45           #  preference to the configuration items listed here.
46           #
47           #  However, if a configuration item is NOT listed in a
48           #  "home_server" section of proxy.conf, then the value here
49           #  is used.
50           #
51           #  This functionality lets you put common configuration into
52           #  a template, and to put only the unique configuration
53           #  items in "proxy.conf".
54           #
55           home_server {
56                         response_window = 20
57                         zombie_period = 40
58                         revive_interval = 120
59                         #
60                         #  Etc.
61           }
62
63           #
64           #  You can also have named templates.  For example, if you
65           #  are proxying to 3 different home servers all at the same
66           #  site, with identical configurations (other than IP
67           #  addresses), you can use this named template.
68           #
69
70           #  Then, each "home_server" section in "proxy.conf" would
71           #  only list the IP address of that home server, and a
72           #  line saying
73           #
74           #             template = example.com
75           #
76           #  That would tell FreeRADIUS to look in the section below
77           #  for the rest of the configuration items.
78           #
79           home_server example.com {
80                       type = auth
81                       port = 1812
82                       secret = testing123
83                       response_window = 20
84                       #
85                       # Etc...
86           }
87
88           #
89           #  You can have templates for other sections, too, but they
90           #  seem to be most useful for home_servers.
91           #
92           #  For now, you can use templates only for sections in
93           #  radiusd.conf, not sub-sections.  So you still have to use
94           #  the "$INCLUDE file.." method for things like defining
95           #  multiple "sql" modules, each with similar configuration.
96           #       
97 }