Vultr DocsLatest Content


How to Attach a VPC 2.0 Network to a Vultr Instance

Updated on 12 September, 2025

A feature that allows you to connect additional resources like block storage volumes to your Vultr instances for expanded capabilities.


Attaching a VPC 2.0 network to an instance enables a new private networking interface that supports communication with other nodes on the same network. You can attach multiple VPC 2.0 networks to an instance to enable connections with other hosts on each subnet.

Follow this guide to attach a VPC 2.0 network to a Vultr instance using the Vultr API, CLI, or Terraform.

  • Vultr API
  • Vultr CLI
  • Terraform
  1. Send a GET request to the List VPC 2.0 networks endpoint and note the target VPC 2.0 network's ID in your output.

    console
    $ curl "https://api.vultr.com/v2/vpc2" \
        -X GET \
        -H "Authorization: Bearer ${VULTR_API_KEY}"
    
  2. Send a GET request to the List Instances endpoint and note the target instance's ID.

    console
    $ curl "https://api.vultr.com/v2/instances" \
      -X GET \
      -H "Authorization: Bearer ${VULTR_API_KEY}"
    
  3. Send a POST request to the Attach nodes to a VPC 2.0 network endpoint to attach the instance to the VPC 2.0 network.

    console
    $ curl "https://api.vultr.com/v2/vpc2/{vpc-id}/nodes/attach" \
        -X POST \
        -H "Authorization: Bearer ${VULTR_API_KEY}" \
        -H "Content-Type: application/json" \
        --data '{
            "nodes": [
                "<instance-id>"
            ]
        }'
    
  1. View the list of VPC 2.0 networks in your Vultr account and note the target network's ID.

    console
    $ vultr-cli vpc2 list
    
  2. View the all instances and note your target instance's ID.

    console
    $ vultr-cli instance list
    
  3. Attach the VPC 2.0 network to the instance.

    console
    $ vultr-cli vpc2 nodes attach <vpc2 id> \
        --nodes="<instance id>"
    
  1. Open your Terraform configuration for the existing instance.

  2. Add the VPC 2.0 network ID to the instance vpc2_ids list, then apply.

    terraform
    resource "vultr_instance" "server" {
        # ...existing fields (region, plan, os_id, label)
        vpc2_ids = [var.vpc2_id]
    }
    
  3. Apply the configuration and observe the following output:

    Apply complete! Resources: 0 added, 1 changed, 0 destroyed.

Comments

No comments yet.