Pre-client pipeline for dynamic client matching before normal client resolution
@pre-client
@pre-client defines a pipeline that runs before normal client matching for a server.
Use it when client data comes from a backend, script, or database instead of a static clients list.
If that backend or database is not responding, @pre-client can return an error.
Typical uses include:
- Looking up a client by source IP address in a backend or script
- Setting client properties dynamically before normal matching continues
- Rejecting unknown or unauthorized client sources early
For RADIUS servers, this pipeline can set radius.client.secret before the request proceeds to normal client resolution.
Example
servers {
radius "RADIUS_UDP_1812" {
listen {
protocol udp;
port 1812;
ip 0.0.0.0;
}
@pre-client {
# radius.client.ip is used on the backend to query and return radius.client identifier and radius.client.secret
backend {
name "SQL_DATABASE_CLIENTS_INTERNAL";
query "FIND_RADIUS_CLIENT";
}
}
}
}
The example above demonstrates client lookup from the database.
Client matching order
A server must configure at least one of clients or @pre-client. Configuration loading fails if neither is set.
When both are configured, Radiator checks @pre-client first:
- If
@pre-clientselects a client (for example throughacceptwith modifiedradius.client.*values), that client is used. - If
@pre-clientreturnsignoreor does not select a client, Radiator falls back to the static clients list. - If
@pre-clientreturns an error (for example a backend timeout), Radiator logs the error and falls back to the staticclientslist. Repeated errors are upsampled to a periodic warning to keep the log readable.
Configuring both is most useful during migration from a static clients list to dynamic matching, or as a failover path when the dynamic source is temporarily unavailable.
See also
- servers.clients - Static client list binding for servers
- accept - Continue request processing after a successful pre-client decision
- backends - Backend lookups for dynamic client data