template
The template directive expands a previously defined reusable configuration fragment in place.
It is a lightweight macro mechanism intended to eliminate repetitive blocks (e.g. common
listener definitions, standard logging setups, or recurring AAA handler scaffolding).
template "STANDARD_RADIUS_LISTENER";
template "COMMON_LOGGING";
If a template with the referenced name is not defined, configuration loading fails.
The directive performs a structural expansion during configuration processing; after expansion the resulting configuration behaves exactly as if you had written the expanded content inline.
Syntax
template "<NAME>";
| Parameter | Required | Description |
|---|---|---|
<NAME> | Yes | The exact (case-sensitive) name of a defined template |
Typical Use Cases
| Use Case | Example Template Name | Contents (Illustrative) |
|---|---|---|
| Standard RADIUS listener | STANDARD_RADIUS_LISTENER | listen { protocol udp; port 1812; ip 0.0.0.0; } |
| Common TLS listener base | TLS_BASE | A listen block plus TLS policy hooks |
| Uniform AAA handler preamble | AAA_HANDLER_BASE | Shared pre-authentication logging |
| Logging defaults | COMMON_LOGGING | Application + AAA logger baseline |
(Exact template definitions depend on how templates are declared in your configuration set.)
Example
Assume a template STANDARD_RADIUS_LISTENER defined elsewhere:
servers {
radius "auth-1" {
template "STANDARD_RADIUS_LISTENER";
clients "RADIUS_CLIENTS";
policy "AUTH_POL";
}
radius "auth-2" {
template "STANDARD_RADIUS_LISTENER";
clients "RADIUS_CLIENTS";
policy "AUTH_POL";
}
}
Without templates you'd duplicate the same listen { ... } block for each server.