How to Attach Reserved IPs to a Vultr Optimized Cloud Compute Instance
-
by Blog Admin
- 5
How to Attach Reserved IPs to a Vultr Optimized Cloud Compute Instance
A guide explaining how to assign and use dedicated IP addresses with your Vultr Optimized Cloud Compute instance.
Reserved IPs allow you to reserve a specific public IP address you can assign to a Vultr Optimized Cloud Compute instance. You can attach multiple reserved IPs to a single instance to enable advanced networking capabilities like routing and IP forwarding with distinct public IP addresses.
Follow this guide to attach reserved IPs on a Vultr Optimized Cloud Compute instance using the Vultr Customer Portal, API, CLI, or Terraform.
Vultr Customer Portal
- Navigate to Products, expand the Network group and click Reserved IPs.
- Click your target reserved IP to open its management page.
- Click the Attach to Server drop-down and select your target Vultr Optimized Cloud Compute instance.
- Click Attach to apply the reserved IP to the Vultr Optimized Cloud Compute instance.
Vultr API
- Send a
GET
request to the List Instances endpoint and note your target instance’s ID.console$ curl "https://api.vultr.com/v2/instances" \ -X GET \ -H "Authorization: Bearer ${VULTR_API_KEY}"
- Send a
GET
request to the List Reserved IPs endpoint and note the target reserved IP’s ID.console$ curl "https://api.vultr.com/v2/reserved-ips" \ -X GET \ -H "Authorization: Bearer ${VULTR_API_KEY}"
- Send a
POST
request to the Attach Reserved IP endpoint to attach the reserved IP to the instance.console$ curl "https://api.vultr.com/v2/reserved-ips/{reserved-ip}/attach" \ -X POST \ -H "Authorization: Bearer ${VULTR_API_KEY}" \ -H "Content-Type: application/json" \ --data '{ "instance_id" : "<instance-id>" }'
Vultr CLI
- List all reserved IPs in your Vultr account and note the target reserved IP’s ID.
console
$ vultr-cli reserved-ip list
- List all available instances and note your target instance’s ID.
console
$ vultr-cli instance list
- Attach the reserved IP to the instance.
console
$ vultr-cli reserved-ip attach <reserved-ip-id> --instance-id <instance-id>
Terraform
- Open your Terraform configuration for the existing Optimized Cloud Compute instance.
- Create (or import) a Reserved IP and reference it from the instance using
reserved_ip_id
.terraformresource "vultr_reserved_ip" "public_ip" { region = "del" ip_type = "v4" # or "v6" label = "occ-reserved-ip" } resource "vultr_instance" "occ" { # ...existing fields (region, plan, os_id, label, etc.) reserved_ip_id = vultr_reserved_ip.public_ip.id }
- Apply the configuration and observe the following output:
Apply complete! Resources: 1 added, 0 changed, 0 destroyed.
How to Attach Reserved IPs to a Vultr Optimized Cloud Compute Instance A guide explaining how to assign and use dedicated IP addresses with your Vultr Optimized Cloud Compute instance. Reserved IPs allow you to reserve a specific public IP address you can assign to a Vultr Optimized Cloud Compute…
How to Attach Reserved IPs to a Vultr Optimized Cloud Compute Instance A guide explaining how to assign and use dedicated IP addresses with your Vultr Optimized Cloud Compute instance. Reserved IPs allow you to reserve a specific public IP address you can assign to a Vultr Optimized Cloud Compute…