Radiator Server Documentation — v10.33.3

Pre-client pipeline for dynamic client matching before normal client resolution

Table of Contents
  • @pre-client
  • Example
  • Client matching order
  • See also

@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-client selects a client (for example through accept with modified radius.client.* values), that client is used.
  • If @pre-client returns ignore or does not select a client, Radiator falls back to the static clients list.
  • If @pre-client returns an error (for example a backend timeout), Radiator logs the error and falls back to the static clients list. 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
Navigation
  • @init

  • @verification

  • aaa

  • backends

  • caches

  • captures

  • certificates

  • clients

  • conditions

  • dictionary

  • hmac-otp

  • include

  • ip-accept

  • license

  • logging

  • management

  • proxy-protocol

  • scripts

  • servers

    • buffer

    • clients

    • http

    • ip

    • keepalive

    • policy

    • port

    • pre-client

    • protocol

    • radius

    • timeout

    • tls

  • statistics

  • stats

  • ui