anchor.diff: -= IP Filtering Policy
  += IP filtering policy
   
   ifdef::env-github[]
   image:https://ci.gravitee.io/buildStatus/icon?job=gravitee-io/gravitee-policy-ipfiltering/master["Build status", link="https://ci.gravitee.io/job/gravitee-io/job/gravitee-policy-ipfiltering/"]
  
positive.code: |===
  
  == Description
  The IP Filtering policy lets you control access to your API via IP addresses.
  You can allow or deny a specific IP address or a range of IP by using https://tools.ietf.org/html/rfc1519[CIDR].
  
  The whitelist mode excludes all IPs excepts those with an IP which is part of the whitelist.
  The blacklist mode allows all IPs excepts those with an IP which is part of the blacklist.
  
  If an IP is part of the blacklist and the whitelist, the policy reject the request.
  
  You can specify a host to be resolved and checked against the remote IP.
  
  == Configuration
  You can configure the policy with the following options :
  
  |===
  |Property |Required |Description |Type |Default
  
  |matchAllFromXForwardedFor
  |No
  |if set to true, each IP from the *X-Forwarded-For* header parameter is parsed.
  |boolean
  |_false_
  
  |whitelistIps
  |No
  |a list of allowed IPs with or without CIDR notation (host is allowed).
  |string list
  |_empty_
  
  |blacklistIps
  |No
  |a list of denyed IPs with or without CIDR notation (host is allowed).
  |string list
  |_empty_
  
  |===
  
  
  [source, json]
  .Sample
  ----
  "ip-filtering": {
    "matchAllFromXForwardedFor": true,
  
negative.code: }
  ----
  
  == Errors
  
  === HTTP status code
  
  |===
  |Code |Message
  
  | ```403```
  | Your IP (0.0.0.0) or one of the proxies your request passed through is not allowed to reach this resource
  
  |===
  