> For the complete documentation index, see [llms.txt](https://docs.cennso.com/components/rpr/3.0/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/3.0/configuration/disconnect-forwarding.md).

# Forwarding of the Disconnect RADIUS requests

Besides forwarding the [RADIUS Authorization and Accounting](https://docs.cennso.com/components/rpr/3.0/configuration/aaa-forwarding.md) requests, RADIUS Proxy (RPR) also supports forwarding of the [RADIUS CoA and Disconnect](https://www.ietf.org/rfc/rfc3576.txt) requests.

You can configure RADIUS CoA and Disconnect servers and relays using these configuration options:

- `coa.listen` - the RADIUS server listener address.
- `coa.port` - the RADIUS server listener port. Only a single value is supported. It is recommended to use port `3799` for RADIUS CoA and Disconnect requests.
- `coa.sources` - the list of sources from where the given RADIUS server accepts incoming RADIUS CoA and Disconnect messages. Each source must provide a RADIUS secret, the source address or range of addresses in the `192.0.2.0/24` format, and the optional `nas_id`. The logic of handling the CoA sources configuration is the same as in [Forwarding of the AAA RADIUS requests](https://docs.cennso.com/components/rpr/3.0/configuration/aaa-forwarding.md).
- `coa.allow_attrs` - the list of RADIUS attributes to preserve in the forwarded request. If the list is empty, RADIUS Proxy doesn't preserve any attributes. If the list is not empty, only the given RADIUS attributes are preserved in the forwarded request.
- `coa.remove_attrs` - the list of RADIUS attributes removed from all incoming CoA/Disconnect requests.
- `coa.route_attr` - the name of the RADIUS attribute used by RADIUS Proxy to determine how and where to forward incoming CoA and Disconnect requests.
- `coa.relays` - the list of RADIUS relays where RADIUS Proxy forwards the incoming RADIUS requests. Each relay must have an address and a RADIUS secret specified. If instead of an IP address, the FQDN name is given in the `relay` configuration, and it can be assigned to multiple IP addresses, RPR distributes requests to all of them in a random order. To determine where to forward the given RADIUS request, RADIUS Proxy uses the value of the `coa.route_attr` configuration option. When a RADIUS request arrives to RADIUS Proxy, it checks the value of the RADIUS attribute specified in the `coa.route_attr` configuration option. If the value matches the value given in one of `coa.relays.{RELAY}.route_attr`, the message is forwarded to that relay. If there is no suitable relay found, the default relay is used. The default relay is the relay that does not provide `coa.relays.{RELAY}.route_attr` configuration.

  >**NOTE:** Each RADIUS server that is configured in RADIUS Proxy must have only one default relay.

- `coa.relays.{RELAY}.timeout` - the number of milliseconds RADIUS Proxy waits for the response. If not specified in the configuration, the default value of `5000` is used.
- `coa.relays.{RELAY}.retries` - the number of re-tries to send a RADIUS request failed by timeout to the given RADIUS relay. If not specified, the default value of `3` is used. If the number of retries for a primary RADIUS server is exhausted, the failover RADIUS servers are used. Only after that, the client returns a response or an error. For more information, see the [RADIUS servers for failover scenarios](https://docs.cennso.com/components/rpr/3.0/configuration/failover-servers.md) document.
- `coa.relays.{RELAY}.failover_server_pool` - the name of a pool of secondary RADIUS servers used for failover scenarios. For more information, see the [RADIUS servers for failover scenarios](https://docs.cennso.com/components/rpr/3.0/configuration/failover-servers.md) document.

See the configuration example:

```yaml
coa:
  listen: 0.0.0.0
  port: 3799
  sources:
    - secret: "secret"
      source: 172.2.1.1
      nas_id: OCS-1
  allow_attrs: ["NAS-IP-Address", "Acct-Session-Id", "Framed-IP-Address"]
  remove_attrs: []
  route_attr: "NAS-IP-Address"
  relays:
    - address: "172.2.1.2:3799"
      secret: "secret"
      retries: 1
    - address: "172.2.1.3:3799"
      secret: "secret"
      route_attr: "200.201.202.204"
      failover_server_pool: "coa_pool"
      timeout: 5000
      retries: 1
```

The CoA/Disconnect RADIUS server listens for the incoming RADIUS requests on the port `3799` and accepts the incoming RADIUS requests from the RADIUS servers that are located at the `172.16.1.1` address. Besides, only requests with the given `secret` are accepted. The list of allowed RADIUS attributes (`allow_attrs`) is not empty, so only these attributes are preserved in the outgoing RADIUS messages:

- `NAS-IP-Address`
- `Acct-Session-Id`
- `Framed-IP-Address`

All of the incoming RADIUS requests are forwarded to one of two possible relays:

- `172.2.1.2:3799`
- `172.2.1.3:3799`

The server where RADIUS Proxy forwards the given incoming RADIUS request depends on the AVPs located in the request. In the example above, the `coa.route_attr` is configured with the `NAS-IP-Address`. RADIUS Proxy checks the value of this attribute for each incoming RADIUS request. If the value of `NAS-IP-Address` is `200.201.202.204`, the request is forwarded to `172.2.1.3:3799`. Otherwise, the default route `172.2.1.2:3799` is used.
