An API token is required, along with a project ID and region ID.
To find the values for each variable:
INSTANCE_ID: UUID of the Virtual Machine whose port to configure.PORT_ID: the port ID of the VM’s private network interface. Only private (non-external) ports support allowed address pairs.
Find the port ID
Each VM network interface has aport_id. Allowed address pairs are applied per port, and only ports on private (non-external) networks support this feature.
- Python
- Go
- curl
port_id of the private interface (the one with a private IP range — 10.x.x.x or 192.168.x.x) as PORT_ID. The external interface does not support allowed address pairs. The same endpoint also returns allowed_address_pairs per interface, so the current state is visible after applying changes.
Set allowed address pairs
ThePUT request replaces the entire list of allowed address pairs for the port. To add one pair without losing existing ones, include all current pairs in the request body alongside the new entry.
| Parameter | Required | Description |
|---|---|---|
ip_address | Yes | IP address or CIDR range to allow (e.g. 192.168.1.10 or 10.0.0.0/24) |
mac_address | No | MAC address to associate; defaults to the port’s own MAC when omitted |
- Python
- Go
- curl
mac_address is omitted, the API assigns the port’s default MAC address to that entry automatically.
Remove allowed address pairs
To remove all allowed address pairs from a port, send the samePUT request with an empty allowed_address_pairs array. The operation is asynchronous — poll the returned task until state is FINISHED.
- Python
- Go
- curl