> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ouster.com/sensor-docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ouster.com/sensor-docs/_mcp/server.

# Override a static IP address

PUT http://os-992244000006.local/api/v1/system/network/ipv4/override
Content-Type: application/json

Override the default dynamic behavior and set a static IP address and optional gateway.

__Note:__ The sensor will reset the network configuration after a short sub second delay (to allow for the HTTP response to be sent). After this delay the sensor will only be reachable on the newly set IPv4 address.  The sensor needs to be reachable either by link-local or dynamic DHCP configuration or by an existing static IP override from the host reconfiguring the sensor. The sensor may be reset back to using DHCP with `DELETE api/v1/sensor/config`.

__Warning:__ If an unreachable network address is set, the sensor will not be accessible. Tools such as avahi-browse, dns-sd, or mDNS browser can help with finding a sensor on a network. Static IP override should only be used in special use cases. DHCP configuration is recommended where possible.

__Note:__ Sensor can be accessed on the sensor's self-assigned link-local IPv4 or IPv6 addresses, in case the sensor becomes unreachable on the configured network due to a misconfiguration. To discover the self-assigned link-local IPv4 or IPv6 addresses for a sensor one can use a network sniffer (such as wireshark) on the same network segment as the sensor.

Reference: https://docs.ouster.com/sensor-docs/firmware/api-reference/ouster-http-api/system/put-network-i-pv-4-override

## Request

### Body (application/json)

This endpoint expects a System_putNetworkIPv4Override_Request.

- `System_putNetworkIPv4Override_Request`

## Response

### 200

No error

## Types

### IPv4Override

Recommended IP address format

- `addr` (string, required)
- `gateway` (string, optional)

## Examples

**Request**

```json
{
  "addr": "192.168.200.2/24"
}
```

**Response**

```json
{}
```

**SDK Code**

```python
import requests

url = "http://os-992244000006.local/api/v1/system/network/ipv4/override"

payload = { "addr": "192.168.200.2/24" }
headers = {"Content-Type": "application/json"}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'http://os-992244000006.local/api/v1/system/network/ipv4/override';
const options = {
  method: 'PUT',
  headers: {'Content-Type': 'application/json'},
  body: '{"addr":"192.168.200.2/24"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "http://os-992244000006.local/api/v1/system/network/ipv4/override"

	payload := strings.NewReader("{\n  \"addr\": \"192.168.200.2/24\"\n}")

	req, _ := http.NewRequest("PUT", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("http://os-992244000006.local/api/v1/system/network/ipv4/override")

http = Net::HTTP.new(url.host, url.port)

request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n  \"addr\": \"192.168.200.2/24\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("http://os-992244000006.local/api/v1/system/network/ipv4/override")
  .header("Content-Type", "application/json")
  .body("{\n  \"addr\": \"192.168.200.2/24\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'http://os-992244000006.local/api/v1/system/network/ipv4/override', [
  'body' => '{
  "addr": "192.168.200.2/24"
}',
  'headers' => [
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("http://os-992244000006.local/api/v1/system/network/ipv4/override");
var request = new RestRequest(Method.PUT);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"addr\": \"192.168.200.2/24\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/json"]
let parameters = ["addr": "192.168.200.2/24"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "http://os-992244000006.local/api/v1/system/network/ipv4/override")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```