Attaching a DRG to a VCN

Create a VCN attachment on a Dynamic Routing Gateway (DRG) in Oracle Cloud Infrastructure.

To route traffic to a compute instance from an on-premises network or a DRG in another region, a DRG must be explicitly attached to a VCN. A VCN can be attached to only one DRG at a time, but a DRG can be attached to more than one VCN. The attachment is automatically created in the compartment that holds the VCN. An attached VCN doesn't need to be in the same compartment as the DRG.

You can choose to connect two or more VCNs in the same region by attaching them to a single DRG instead of with local peering gateways (for more information about that use case see Local VCN Peering Through an Upgraded DRG). If left unmodified, the default routing policies in a DRG allow traffic to be routed between all VCNs attached to it. If you're attaching a DRG to a VCN in another tenancy, you need to have IAM configurations in both tenancies as described in IAM Policies for Routing Between VCNs. Also, refer to Route Aggregation for more details on controlling the VCN routes advertised by BGP.

When you create a VCN attachment (the VCN can be in another tenancy in the same OCI region), attachments on both the DRG and VCN are created and connected in one step. If you create a remote peering connection (RPC) attachment, there are additional steps required to connect to the DRG on the other end. For more about using RPC attachments, see Remote VCN Peering through an Upgraded DRG.

You can't directly create other attachment types for a DRG (such as IPSEC TUNNEL, LOOPBACK, and VIRTUAL CIRCUIT attachments). When you create a FastConnect virtual circuit or IPSec tunnel for Site-to-Site VPN, a virtual circuit attachment or IPSec tunnel attachment is created for you. It's not necessary to explicitly create an attachment with those types.

Attaching a DRG to a VCN results in a DrgAttachment object with its own OCID. If you're setting up the advanced routing scenario called transit routing, you can optionally specify a route table for a DRG attachment.