---
title: How to Reassign or Unassign BYOIP IPs
description: Reassign or Unassign a BYOIP IP address from a Droplet.
product: Networking
url: https://docs.digitalocean.com/products/networking/reserved-ips/how-to/modify-byoip-ip/
last_updated: "2026-06-09"
---

> **For AI agents:** The documentation index is at [https://docs.digitalocean.com/llms.txt](https://docs.digitalocean.com/llms.txt). Markdown versions of pages use the same URL with `index.html.md` in place of the HTML page (for example, append `index.html.md` to the directory path instead of opening the HTML document).

# How to Reassign or Unassign BYOIP IPs

DigitalOcean Reserved IPs are publicly-accessible static IPv4 and IPv6 addresses. Assign and reassign reserved IP addresses to Droplets as needed, or implement an automated failover mechanism with reserved IPs to build a high availability infrastructure.

## Reassign a BYOIP IP Address Using Automation

Use the standard reserved IP `assign` actions to reassign BYOIP IP addresses. Substitute the address you’d like to reassign for any `<reserved-ip>` placeholders. You can only reassign BYOIP IPs to Droplets in the same datacenter.

## How to Reassign a BYOIP Address Using the DigitalOcean CLI

1. [Install `doctl`](https://docs.digitalocean.com/reference/doctl/how-to/install/index.html.md), the official DigitalOcean CLI.
2. [Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with `doctl`.
3. Use the token to grant `doctl` access to your DigitalOcean account.

   ```shell
   doctl auth init
   ```
4. Finally, run `doctl compute reserved-ip-action assign`. Basic usage looks like this, but you can [read the usage docs](https://docs.digitalocean.com/reference/doctl/reference/compute/reserved-ip-action/assign/index.html.md) for more details:

   ```shell
   doctl compute reserved-ip-action assign <reserved-ip> <droplet-id> [flags]
   ```

   The following example assigns the reserved IP address `203.0.113.25` to a Droplet with the ID `386734086`:

   ```shell
   doctl compute reserved-ip-action assign 203.0.113.25 386734086
   ```

## How to Reassign a BYOIP Address Using the DigitalOcean API

[Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with the API.

### cURL

Send a POST request to [`https://api.digitalocean.com/v2/reserved_ips/{reserved_ip}/actions`](https://docs.digitalocean.com/reference/api/reference/reserved-ip-actions/index.html.md#reservedIPsActions_post).

Using cURL:

```shell
# Assign a Reserved IP to a Droplet
curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
  -d '{"type":"assign","droplet_id":8219222}' \
  "https://api.digitalocean.com/v2/reserved_ips/45.55.96.47/actions"

# Unassign a Reserved IP
# curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
  -d '{"type":"unassign"}' \
  "https://api.digitalocean.com/v2/reserved_ips/45.55.96.47/actions"
```

### Go

Using [Godo](https://github.com/digitalocean/godo), the official DigitalOcean API client for Go:

```go
import (
    "context"
    "os"

    "github.com/digitalocean/godo"
)

func main() {
    token := os.Getenv("DIGITALOCEAN_TOKEN")

    client := godo.NewFromToken(token)
    ctx := context.TODO()

  // Assign a Reserved IP to a Droplet
    action, _, err := client.ReservedIPActions.Assign(ctx, "45.55.96.47", 8219222)

  // Unassign a Reserved IP
  action, _, err := client.ReservedIPActions.Unassign(ctx, "45.55.96.47")
}
```

### Ruby

Using [DropletKit](https://github.com/digitalocean/droplet_kit), the official DigitalOcean API client for Ruby:

```ruby
require 'droplet_kit'
token = ENV['DIGITALOCEAN_TOKEN']
client = DropletKit::Client.new(access_token: token)

# Assign a Reserved IP to a Droplet
client.reserved_ip_actions.assign(ip: '45.55.96.47', droplet_id: 8219222)

# Unassign a Reserved IP
# client.reserved_ip_actions.unassign(ip: '45.55.96.47')
```

### Python

Using [PyDo](https://github.com/digitalocean/pydo), the official DigitalOcean API client for Python:

```python
import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req={
  "type": "unassign"
}

resp = client.reserved_ips_actions.post(reserved_ip="49.32.13.21", body=req)
```

## Reassign a BYOIP IP Address Using the Control Panel

To reassign a BYOIP IP address from the [Control Panel](https://cloud.digitalocean.com?utm_source=docs-agent&utm_medium=md), click **Networking** in the main menu, then click **Reserved IPs** to see a list of your reserved IPs and BYOIP prefixes.

Click the prefix that contains the IP address you’d like to reassign. You’re taken to a page with details about your BYOIP prefix, including a list of IP address that are assigned to Droplets.

Find the IP address in the list, click its **…** (More) menu, and then click **Reassign**.

In the **Reassign** window, select a Droplet to reassign the IP address to, and then click **Reassign Reserved IP**. You can only reassign BYOIP IPs to Droplets in the same datacenter.

## Unassign a BYOIP IP Address Using Automation

Use the standard reserved IP `unassign` actions to unassign BYOIP IP addresses. Substitute the address you’d like to unassign for any `<reserved-ip>` placeholders.

## How to Unassign a BYOIP Address Using the DigitalOcean CLI

1. [Install `doctl`](https://docs.digitalocean.com/reference/doctl/how-to/install/index.html.md), the official DigitalOcean CLI.
2. [Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with `doctl`.
3. Use the token to grant `doctl` access to your DigitalOcean account.

   ```shell
   doctl auth init
   ```
4. Finally, run `doctl compute reserved-ip-action unassign`. Basic usage looks like this, but you can [read the usage docs](https://docs.digitalocean.com/reference/doctl/reference/compute/reserved-ip-action/unassign/index.html.md) for more details:

   ```shell
   doctl compute reserved-ip-action unassign <reserved-ip> [flags]
   ```

   The following example unassigns the reserved IP address `203.0.113.25` from a resource:

   ```shell
   doctl compute reserved-ip-action unassign 203.0.113.25
   ```

## How to Unassign a BYOIP Address Using the DigitalOcean API

[Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with the API.

### cURL

Send a POST request to [`https://api.digitalocean.com/v2/reserved_ips/{reserved_ip}/actions`](https://docs.digitalocean.com/reference/api/reference/reserved-ip-actions/index.html.md#reservedIPsActions_post).

Using cURL:

```shell
# Assign a Reserved IP to a Droplet
curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
  -d '{"type":"assign","droplet_id":8219222}' \
  "https://api.digitalocean.com/v2/reserved_ips/45.55.96.47/actions"

# Unassign a Reserved IP
# curl -X POST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \
  -d '{"type":"unassign"}' \
  "https://api.digitalocean.com/v2/reserved_ips/45.55.96.47/actions"
```

### Go

Using [Godo](https://github.com/digitalocean/godo), the official DigitalOcean API client for Go:

```go
import (
    "context"
    "os"

    "github.com/digitalocean/godo"
)

func main() {
    token := os.Getenv("DIGITALOCEAN_TOKEN")

    client := godo.NewFromToken(token)
    ctx := context.TODO()

  // Assign a Reserved IP to a Droplet
    action, _, err := client.ReservedIPActions.Assign(ctx, "45.55.96.47", 8219222)

  // Unassign a Reserved IP
  action, _, err := client.ReservedIPActions.Unassign(ctx, "45.55.96.47")
}
```

### Ruby

Using [DropletKit](https://github.com/digitalocean/droplet_kit), the official DigitalOcean API client for Ruby:

```ruby
require 'droplet_kit'
token = ENV['DIGITALOCEAN_TOKEN']
client = DropletKit::Client.new(access_token: token)

# Assign a Reserved IP to a Droplet
client.reserved_ip_actions.assign(ip: '45.55.96.47', droplet_id: 8219222)

# Unassign a Reserved IP
# client.reserved_ip_actions.unassign(ip: '45.55.96.47')
```

### Python

Using [PyDo](https://github.com/digitalocean/pydo), the official DigitalOcean API client for Python:

```python
import os
from pydo import Client

client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN"))

req={
  "type": "unassign"
}

resp = client.reserved_ips_actions.post(reserved_ip="49.32.13.21", body=req)
```

## Unassign a BYOIP IP Address Using the Control Panel

To unassign a BYOIP IP address from the [Control Panel](https://cloud.digitalocean.com?utm_source=docs-agent&utm_medium=md), click **Networking** in the main menu, then click **Reserved IPs** to see a list of your reserved IPs and BYOIP prefixes.

Click the prefix that contains the IP address you’d like to unassign. A page with details about your BYOIP prefix loads, including a list of IP address that are assigned to Droplets.

Find the IP address in the list, click its **…** (More) menu, and then click **Unassign**.

In the **Unassign** window, type the name of the currently assigned Droplet to confirm, and then click **Unassign IP address**.