# IP Restriction Configuration

The `ip-restriction` plugin restricts access to upstream resources based on an IP address whitelist or blacklist, improving API security.<!-- --> <!-- -->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.

* whitelist

  array\[string]

  ***

  List of IPs to whitelist. Support IPv4, IPv6, and CIDR notations.

  At least one of the `whitelist` and `blacklist` should be configured, but they cannot be configured at the same time.

* blacklist

  array\[string]

  ***

  List of IPs to blacklist. Support IPv4, IPv6, and CIDR notations.

  At least one of the `whitelist` and `blacklist` should be configured, but they cannot be configured at the same time.

* message

  string

  default: `Your IP address is not allowed`

  ***

  Message returned when the IP address is denied access.

* response\_code

  integer

  default: `403`

  valid value:

  between 403 and 404 inclusive

  ***

  HTTP response code returned when the request is rejected due to IP address restriction. Available in API7 Enterprise from version 3.10.3.
