> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nodepick.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Public IP Management (np node attach-ip / detach-ip)

> Dynamically attach and detach public IPv4 and IPv6 addresses to compute nodes.

Compute nodes receive an isolated private IPv4 address on their VPC network upon provisioning. Routable public IPv4 and IPv6 addresses are dynamic add-ons that can be attached and detached at any time.

## Syntax

```bash theme={null}
# Attach public IP
np node attach-ip <node_id> [options]
# or inverted syntax
np node <node_id> attach-ip [options]

# Detach public IP
np node detach-ip <node_id> [options]
# or inverted syntax
np node <node_id> detach-ip [options]
```

***

## Attach Public IP (`np node attach-ip`)

Attaches a public IP address to a compute node. The CLI automatically detects whether the target is IPv4 or IPv6 based on the `--ip` argument.

### Options

| Option | Description | Default |
| - | - | - |
| `--ip` | Public IP address to attach, or `"auto"` (IPv4) / `"auto-ipv6"` (IPv6) | `"auto"` |

### Examples

<CodeGroup>
  ```bash Auto IPv4 (Default) theme={null}
  # Automatically allocate and attach the next available public IPv4
  np node attach-ip dev-server
  ```

  ```bash Auto IPv6 theme={null}
  # Automatically allocate and attach a routable public IPv6 prefix
  np node attach-ip dev-server --ip auto-ipv6
  ```

  ```bash Explicit IP Address theme={null}
  # Attach a specific reserved public IP address (IPv4 or IPv6)
  np node attach-ip dev-server --ip 184.105.163.137
  np node attach-ip dev-server --ip 2001:470::1
  ```

  ```bash Inverted Syntax theme={null}
  # Supports node-ID-first syntax
  np node dev-server attach-ip
  ```
</CodeGroup>

***

## Detach Public IP (`np node detach-ip`)

Detaches a public IP address from a compute node, reverting ingress to private VPC networking.

### Options

| Option | Short | Description | Default |
| - | - | - | - |
| `--ip` | | Specific public IP address to detach (auto-detected if omitted) | None |
| `--ipv6` | `-6` | Detach public IPv6 address | `false` |

### Examples

<CodeGroup>
  ```bash Auto Detach theme={null}
  # Automatically detaches the active public IP
  np node detach-ip dev-server
  ```

  ```bash Detach IPv6 theme={null}
  # Detach public IPv6 address
  np node detach-ip dev-server --ipv6
  ```

  ```bash Specific IP theme={null}
  # Detach a specific address when multiple IPs are assigned
  np node detach-ip dev-server --ip 184.105.163.137
  ```

  ```bash Inverted Syntax theme={null}
  # Supports node-ID-first syntax
  np node dev-server detach-ip
  ```
</CodeGroup>

## Related Commands

<CardGroup cols={2}>
  <Card title="Get Node Details" icon="server" href="/cli-reference/nodes/get">
    Inspect assigned IP addresses and SSH connection details.
  </Card>

  <Card title="List Nodes" icon="list" href="/cli-reference/nodes/list">
    View all active compute nodes and current networking states.
  </Card>
</CardGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.