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.
VPC peering 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 enables routing between any two VPC networks. The one exception is that peering between datacenters is not available in BLR1.
Peering works with the following resources:
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.
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.
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.
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.