---
title: client.geo.ip_override
summary: null
url: >-
  https://www.fastly.com/documentation/reference/vcl/variables/geolocation/client-geo-ip-override
---

**Type:** STRING  
**Access:** can be read and set, but not unset

**Available in:** all subroutines

Override the IP address for geolocation data. The default is to use `client.ip` as the source for geolocation.

On services that have [shielding](https://www.fastly.com/documentation/guides/concepts/shielding) enabled, the value of `client.ip` may be the address of another Fastly data center rather than the address of the end user. To access the end-user's geolocation data while on a shield server (which can be determined using the `fastly.ff.visits_this_service` variable), override the IP address using `client.geo.ip_override`.  

When Fastly sees a request for the first time, we set the `Fastly-Client-IP` header to the value of `client.ip`.  This value is not updated by upstream Fastly servers, which makes it useful for this purpose:

```vcl
if (fastly.ff.visits_this_service > 0) {
  set client.geo.ip_override = req.http.Fastly-Client-IP;
}
```

## Invalid addresses

It is possible to set `client.geo.ip_override` to an invalid IP address

```vcl
set client.geo.ip_override = "xxx";
```

in which case the various geolocation variables present values to indicate an
invalid region. `STRING` variables are set to the empty string, `FLOAT`
variables are set to 999.0, and `INTEGER` variables are set to 0.
