A Virtual Private Cloud (VPC) is a private network interface for collections of DigitalOcean resources. VPC networks are inaccessible from the public internet and other VPC networks, and traffic on them doesn’t count against bandwidth usage. You can link VPC networks to each other using VPC peering connections (currently in early access).
VPC peering (currently in early availability) joins two VPC networks with a secure, private connection. This allows resources in those networks to connect to each other’s private IP addresses as if they were in the same network.
VPC peering is available across all regions, and can be used to route between any two VPC networks. Peering currently works with the following resources:
Droplets
Droplets created after 2 October 2024 on a peered VPC network are configured for peering automatically. If you add a peering to an existing Droplet’s VPC network, restart the Droplet’s networking stack to add the necessary peering route information. See How to Update Droplet Routes to Enable VPC Peering for instructions.
All MongoDB databases are configured for VPC peering.
All other managed databases
Other managed databases created after 9 September 2024 are configured for VPC peering.
Other managed databases created before 9 September 2024 need a maintenance update to be compatible with VPC peering. You can manually apply this maintenance update at any time, or let it run during your established maintenance window before 31 October 2024.
Managed Kubernetes (DOKS)
Worker nodes created after 2 October 2024 on a peered VPC network are configured for peering automatically. If you created the nodes before this date, or added your first peering connection after the nodes were created, recycle your worker nodes to add the new peering routes.
Create a VPC Peering Using the CLI
The VPC peering creation command requires you to provide two VPC network IDs for the --vpc-ids flag. Use doctl vpcs list command to retrieve a list of your VPC networks and their IDs.
How to Create a VPC Peering Using the DigitalOcean CLI
The VPC peering creation call requires you to provide two VPC network IDs for the vpc_ids field. Use the /v2/vpcs endpoint to retrieve a list of your VPC networks and their IDs.
How to Create a VPC Peering Using the DigitalOcean API
To create a VPC peering, click Networking in the main menu, then click the VPC tab. In the VPC tab, click Create a Peering Connection. The Create VPC Peering dialog pops up:
In the Create VPC Peering dialog, select a VPC network, and a second VPC network to peer it with. The VPC selection fields update to show matching VPCs as you type.
Create a name for the peering or use the default generated name, then click Create peering connection to finish.
View a VPC’s Peering Connections
To view a VPC network’s peering connections, click Networking in the main menu, then click the VPC tab. Peering connections are listed under the Connections column in the VPC Networks list.
You can also click on an individual VPC network to go to its details page, then click the Peering Connections tab. All active connections are listed, and you can click Create a Peering Connection to peer another network to this VPC.