How to Attach VPC Networks on a Vultr Bare Metal Instance

Updated on November 27, 2024

A Virtual Private Cloud (VPC) network enables a secure and isolated private networking interface on your instance for communication with other instances in the same network. You can attach multiple VPC networks to enable communication between an instance and other nodes attached to the same network.

Follow this guide to attach VPC networks on a Vultr Bare Metal instance using the Vultr Customer Portal, API, or CLI.

  • Vultr Customer Portal
  • Vultr API
  • Vultr CLI
  1. Navigate to Products and click Compute.

    Vultr Customer Portal

  2. Click your target instance to open its management page.

    View active instance subscriptions

  3. Navigate to the Settings tab.

    Navigate to the Settings Tab

  4. Click IPv4 on the left navigation menu.

    Select IPV4 from the menu options

  5. Click Enable VPC to attach a new VPC network to your instance.

    Enable VPC on Bare Metal

  6. Click Enable VPC in the confirmation prompt to apply changes.

    Select a VPC Network

  7. Click Attach VPC in the confirmation prompt to apply changes to your instance.

    Attach a VPC to an Instance

  1. Send a GET request to the List Bare Metal Instances endpoint and note the target instance's ID in your output.

    console
    $ curl "https://api.vultr.com/v2/bare-metals" \
      -X GET \
      -H "Authorization: Bearer ${VULTR_API_KEY}"
    
  2. Send a GET request to the List VPCs endpoint to list all VPCs in your Vultr account and note the target VPC network's ID.

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

    console
    $ curl "https://api.vultr.com/v2/instances/{instance-id}/vpcs/attach" \
      -X POST \
      -H "Authorization: Bearer ${VULTR_API_KEY}" \
      -H "Content-Type: application/json" \
      --data '{
        "vpc_id": "<vpc-id>"
      }'
    
  1. List all Bare Metal instances in your Vultr account and note the target instance's ID.

    console
    $ vultr-cli bare-metal list
    
  2. List all VPC networks in your Vultr account and note the target VPC network's ID.

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

    console
    $ vultr-cli instance vpc attach <instanceID> --vpc-id="<vpc-id>"