Local VCN Peering Through an Upgraded DRG

This scenario describes using a mutual connection to an upgraded DRG to enable traffic between two or more VCNs.

Overview

Instead of using local peering connections, you can establish private network communications between two or more virtual cloud networks (VCNs) in the same region by attaching them to a common dynamic routing gateway  (DRG) and making appropriate adjustments to VCN and DRG route tables.

This scenario is only available to an upgraded DRG.

If you are using the legacy DRG, you can peer two VCNs in the same region using Local Peering Gateways (LPG) as described in the scenario Local VCN Peering using Local Peering Gateways. Peering two VCNs in the same region through a DRG gives you more flexibility in your routing and simplified management but comes at the cost of microseconds increase in latency due to routing traffic through a virtual router, the DRG.

This sample scenario peers two VCNs. Before you attempt to implement this scenario, be sure that:

  • VCN-A is not attached to a DRG
  • VCN-B is not attached to a DRG
  • VCN-A and VCN-B have non-overlapping CIDRs

Peering VCNs in different tenancies requires more IAM policies for cross-tenancy authorization. See IAM Policies for Routing Between VCNs for details on the permissions needed. When you attach a VCN in a different region to a DRG, use the steps in Attaching a DRG to a VCN in a Different Tenancy. Most of the steps in this scenario assume the DRG and both VCNs are in the same tenancy.

Steps

Here's the general process for setting up a peering between two VCNs in the same region using a DRG:

  1. Create the DRG: See Task A: Create a DRG.
  2. Attach VCN A to the DRG: See Task B: Attach VCN-A to the DRG.
  3. Attach VCN B to the DRG: See Task C: Attach VCN-B to the DRG.
  4. Configure route tables in VCN A to send traffic destined to VCN B's CIDR to the DRG: See Task D: Configure route tables in VCN-A to send traffic destined to VCN-B's CIDR to the DRG attachment.
  5. Configure route tables in VCN B to send traffic destined to VCN A's CIDR to the DRG: See Task E: Configure route tables in VCN-B to send traffic destined to VCN-A's CIDR to the DRG attachment.
  6. Update security rules: Update each VCN's security rules to enable traffic between the peered VCNs as intended. See Task F: Update security rules.

This page summarizes some access control, security, and performance implications for peered VCNs. You can control access and traffic between two peered VCNs by using IAM policies, route tables in each VCN, route tables in the DRG, and security lists in each VCN.

Summary of Networking components for peering through a DRG

At a high level, the Networking service components required for a local peering through a DRG include:

  • Two VCNs with non-overlapping CIDRs, in the same region
  • A single Dynamic Routing Gateway (DRG) attached to each peer VCN.
  • Supporting route rules to enable traffic to flow over the connection, and only to and from select subnets in the respective VCNs (if wanted).
  • Supporting security rules to control the types of traffic allowed to and from the instances in the subnets that need to communicate with the other VCN.

The following diagram illustrates the components.

This image shows the basic layout of two VCNs that are locally peered, each with a local peering gateway.
Note

A given VCN can reach these resources:

  • VNICs in the other VCN
  • An on-premises network attached to the other VCN, if an advanced routing scenario called transit routing has been set up for the VCNs

Two VCNs interconnected with a DRG cannot reach other cloud gateways (such as an internet Gateway or NAT Gateway) except for transit routing via an LPG. For example, if VCN-1 in the preceding diagram were to have an internet gateway, the instances in VCN-2 could not use it to send traffic to endpoints on the internet. However, VCN-2 could receive traffic from the internet by way of VCN-1. For more information, see Important Implications of VCN Peering.

Important Local Peering Concepts

The following concepts help you understand the basics of VCN peering using a DRG and how to establish a local peering.

PEERING
A peering is a relationship between two VCNs that both connect to the same DRG and can mutually route traffic. The local part of local peering indicates that the VCNs are in the same region. A given DRG can have a maximum of 300 local DRG attachments at a time.
Caution

Peer VCNs must not have overlapping CIDRs.
ADMINISTRATORS
In general, VCN peering can occur only if all involved VCN administrators and DRG administrators agree to it. Depending on the situation, a single administrator might be responsible for all involved DRGs, VCNs, and the related policies.
For more information about the required policies and VCN configuration, see IAM Policies for Routing Between VCNs.
ROUTING TO THE DRG
As part of configuring the VCNs, each administrator must update the VCN's routing to enable traffic to flow between the VCNs. In practice, this looks just like routing you set up for any gateway (such as an internet gateway or dynamic routing gateway). For each subnet that needs to communicate with the other VCN, you update the subnet's route table. The route rule specifies the destination traffic's CIDR and your DRG as the target. Your VCN routes traffic that matches that rule to the DRG, which in turn routes the traffic to the next hop in the other VCN.
In the following diagram, VCN-1 and VCN-2 are peered. Traffic from an instance in Subnet A (10.0.0.15) destined for an instance in VCN-2 (192.168.0.15) is routed to the DRG based on the rule in Subnet A's route table. From there the traffic is routed to VCN-2, and then from there, on to its destination in Subnet X. The DRG in this scenario uses the auto-generated route table.
This image shows the route tables and path of traffic routed from one VCN to the other.
Callout 1: Subnet A Route Table
Destination CIDR Route Target
172.16.0.0/12 DRG
192.168.0.0/16 DRG
0.0.0.0/0 Internet Gateway
Callout 2: Subnet X Route Table
Destination CIDR Route Target
172.16.0.0/12 DRG
10.0.0.0/16 DRG
SECURITY RULES
Each subnet in a VCN has one or more security lists that control traffic in and out of the subnet's VNICs at the packet level. You can use security lists to control the type of traffic allowed with the other VCN. As part of configuring the VCNs, each administrator must determine which subnets in their own VCN need to communicate with VNICs in the other VCN and update their subnet's security lists accordingly.
If you use network security groups (NSGs) to implement security rules, notice that you can write security rules for an NSG that specify another NSG as the source or destination of traffic. However, the two NSGs must belong to the same VCN.

Setting up this scenario in the console