Documentation

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>";
ParameterRequiredDescription
<NAME>YesThe exact (case-sensitive) name of a defined template

Typical Use Cases

Use CaseExample Template NameContents (Illustrative)
Standard RADIUS listenerSTANDARD_RADIUS_LISTENERlisten { protocol udp; port 1812; ip 0.0.0.0; }
Common TLS listener baseTLS_BASEA listen block plus TLS policy hooks
Uniform AAA handler preambleAAA_HANDLER_BASEShared pre-authentication logging
Logging defaultsCOMMON_LOGGINGApplication + 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.