> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/rpr/latest/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/components/rpr/latest/configuration/failover-servers.md).

# RADIUS servers for failover scenarios

In addition to the primary RADIUS relay servers, RADIUS Proxy supports secondary RADIUS servers that you can use in failover scenarios.

For example:

```yaml
auth:
  1:
    listen: 0.0.0.0
    ports:
      - 1812
    sources:
      - secret: "pgw-1-secret"
        source: 172.16.2.0/24
        nas_id: PGW1
        timeout: 3000
    relays:
      - address: "radius-server-1-host:1812"
        secret: "radius-server-1-secret"
        timeout: 5000
        retries: 3
        failover_server_pool: auth_pool
```

In the example above, the configuration of the RADIUS Authentication server allows to forward all the incoming requests to the default `radius-server-1-host:1812` relay. If RADIUS Proxy cannot receive a response more than three times (specified in the **auth.proxy_auth_1.relays[0].retries** parameter), the request is forwarded to a server(s) specified in the pool of secondary servers identified by the `auth_pool`. 

All the secondary server pools referenced by the relay configuration must be specified in the **pool** configuration:

```yaml
pool:
  auth_pool:
    - address: 172.16.2.1
      port: 1812
      secret: "failover-server-1-secret"
      retries: 3
      timeout: 1000
    - address: 172.16.2.2
      port: 1812
      secret: "failover-server-2-secret"
      retries: 1
      timeout: 1000
```

>**CAUTION:** If the **address** within a **pool** is not an IP address, but an FQDN name, this name must be valid and resolvable. Otherwise, RPR prints an error about it during start-up and exits.

A secondary RADIUS server remains active and can be used by RADIUS Proxy as a failover server, until it exceeds the number of failed requests specified in **pool.{POOL_NAME}.{SECONDARY_RADIUS_SERVER}.retries**. A request is considered as failed if no response was received within **pool.{POOL_NAME}.{SECONDARY_RADIUS_SERVER}.timeout** milliseconds. If the secondary RADIUS server exceeds the possible number of failures, such a secondary RADIUS server is marked as inactive. An inactive RADIUS server is not used to forward the incoming request for **radius.unreachable_timeout** milliseconds. After this time, it is returned to the pool of active secondary RADIUS servers. If all secondary servers are marked as inactive, RADIUS Proxy uses only the suitable relay to forward the incoming requests.
