A Virtual Private Cloud (VPC) 2.0 network creates a secure and isolated private networking interface to enable connections to other instances attached to the same network. You can attach multiple VPC 2.0 networks to enable secure connections between a Vultr Cloud Compute instance and other instances attached to the same VPC 2.0 network.
Follow this guide to attach a VPC 2.0 network to a Vultr Cloud Compute instance using the Vultr Customer Portal, API, or CLI.
Navigate to Products and click Compute.
Click your target Vultr Cloud Compute instance to open its management page.
Navigate to the Settings tab.
Click VPC 2.0 on the left navigation menu.
Click Enable VPC 2.0 to activate a new VPC 2.0 network interface.
Click Enable VPC 2.0 in the confirmation prompt to apply the changes.
Click the VPC 2.0 drop-down to select a specific network and click Attach to apply the changes on your instance.
Send a GET
request to the List Instances endpoint and note your target instance's ID.
$ curl "https://api.vultr.com/v2/instances" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a GET
request to the List Instance VPC 2.0 Networks endpoint to list all VPC 2.0 networks in your Vultr account and note the target VPC 2.0 network's ID.
$ curl "https://api.vultr.com/v2/vpc2" \
-X GET \
-H "Authorization: Bearer ${VULTR_API_KEY}"
Send a POST
request to the Attach VPC 2.0 to Instance endpoint to attach a VPC 2.0 network to the instance.
$ curl "https://api.vultr.com/v2/instances/{instance-id}/vpc2/attach" \
-X POST \
-H "Authorization: Bearer ${VULTR_API_KEY}" \
-H "Content-Type: application/json" \
--data '{
"vpc_id": "<vpc2-id>"
}'
List all available instances and note your target instance's ID.
$ vultr-cli instance list
List all available VPC 2.0 networks and note the target VPC 2.0 network ID.
$ vultr-cli vpc2 list
Attach the VPC 2.0 network to the instance.
$ vultr-cli vpc2 nodes attach <vpc2-id> \
--nodes="<instance-id>"