Process Flow - VPC peering
Create VPC Network A
Request Peering from A to B
→Accept Peering in B
Peering Connection Established
Traffic Allowed Between A and B
This flow shows how two VPC networks request and accept peering to connect privately.
Jump into concepts and practice - no test required
gcloud compute networks peerings create peer-a-to-b \ --network=vpc-a --peer-network=vpc-b gcloud compute networks peerings create peer-b-to-a \ --network=vpc-b --peer-network=vpc-a
| Step | Action | Network A State | Network B State | Peering Status |
|---|---|---|---|---|
| 1 | Create VPC Network A | Exists, no peering | Not created | No peering |
| 2 | Create VPC Network B | Exists, no peering | Exists, no peering | No peering |
| 3 | Request peering from A to B | Peering request sent | No peering | Pending acceptance |
| 4 | Accept peering in B | Peering request sent | Peering accepted | Active |
| 5 | Create peering from B to A | Peering accepted | Peering request sent | Pending acceptance |
| 6 | Accept peering in A | Peering accepted | Peering accepted | Active |
| 7 | Peering connection established | Connected to B | Connected to A | Active |
| 8 | Traffic allowed between A and B | Can route to B | Can route to A | Active |
| Variable | Start | After Step 3 | After Step 4 | After Step 5 | After Step 6 | Final |
|---|---|---|---|---|---|---|
| Network A Peering State | None | Request sent | Request sent | Accepted | Accepted | Active |
| Network B Peering State | None | None | Accepted | Request sent | Accepted | Active |
| Peering Status | No peering | Pending acceptance | Active | Pending acceptance | Active | Active |
VPC Peering in GCP: - Create two VPC networks. - Request peering from one to the other. - Accept peering on the other side. - Repeat for mutual peering. - Once active, private traffic can flow between VPCs. - Routing and firewall rules must allow traffic.
What is the main purpose of VPC peering in Google Cloud?
Which of the following is the correct command to create a VPC peering connection from net-a to net-b in Google Cloud CLI?
gcloud compute networks peerings create PEERING_NAME --network=NETWORK --peer-network=PEER_NETWORK
Given two VPC networks net-a and net-b peered together, which of the following statements about routing is true?
1. Each network must create routes to the other's IP ranges.
2. Routes are automatically shared by default.
3. Peering allows communication only if firewall rules permit.
4. Peering replaces the need for VPN connections.
You created a VPC peering between net-a and net-b, but instances in net-a cannot reach instances in net-b. What is the most likely cause?
net-b block incoming traffic from net-a -> Option DYou have two VPC networks, net-a with CIDR 10.0.0.0/16 and net-b with CIDR 10.0.0.0/16. You want to peer them to share resources privately. What is the best approach?