# Real IP Configuration

Configure the real-ip plugin to set the client address from request headers or query parameters and verify the address sent upstream.<!-- --> <!-- -->Configuration covers plugin parameters.

## Parameters[​](#parameters "Direct link to Parameters")

See plugin [common configurations](https://docs.api7.ai/apisix/reference/plugin-common-configurations.md) for configuration options available to all plugins.

* source

  string

  required

  ***

  A [built-in variable](https://docs.api7.ai/apisix/reference/built-in-variables.md), such as `http_x_forwarded_for` or `arg_realip`. The variable value should be a valid IP address that represents the client's real IP address, with an optional port.

* trusted\_addresses

  array\[string]

  valid value:

  array of IPv4 or IPv6 addresses (CIDR notation acceptable)

  ***

  Addresses of trusted proxies that can supply a replacement address through `source`.

  When this list is configured, the plugin changes the client address only when the current connection address matches it.

  When `recursive` is true and `source` is `http_x_forwarded_for`, the plugin also uses this list to skip trusted intermediaries in the forwarded chain and selects the last non-trusted address.

  If omitted, the plugin accepts the value from `source` for connections from any peer. Configure trusted addresses when untrusted clients can control the source value.

* recursive

  boolean

  default: `false`

  ***

  If false, replace the original client address that matches one of the trusted addresses by the last address sent in the configured `source`.

  If true, replace the original client address that matches one of the trusted addresses by the last non-trusted address sent in the configured `source`.
