Configuring VCN Route Tables to Use an LPG

Update a virtual cloud network (VCN) route table to include a new rule that directs traffic destined for the other VCN's CIDR to flow through your local peering gateway (LPG).


Without the required routing, traffic doesn't flow between the peered LPGs. If a situation occurs in which you need to temporarily stop the peering, you can simply remove the route rules that enable traffic, you don't need to delete the LPGs.

Each administrator can perform this task before or after the connection is established.

Prerequisite: Each administrator must have the CIDR block or specific subnets for the other VCN. If the connection is already established, look at the Peer VCN CIDR Block value for your LPG in the Console. Otherwise, get the information from the other administrator by email or other method.

Determine which subnets in your VCN need to communicate with the other VCN. You need to update the route table for each of those subnets to include a new rule that directs traffic destined for the other VCN's CIDR to your LPG.


Route tables with route rules that use an LPG as the next hop can be associated with subnets in the VCN, or a DRG, but not to internet gateways, NAT gateways or service gateways. For more about VCN routing, refer to Overview of Routing for Your VCN or the Learn Routing in OCI Networking with Examples (PDF) technical brief.
    1. Open the navigation menu, click Networking, and then click Virtual cloud networks.
    2. Click the VCN that you're interested in.
    3. Under Resources, click Route Tables.
    4. Click the route table that you're interested in.
    5. Click Add Route Rules and enter the following values:
      • Protocol Version: Choose IPv4 or IPv6.
      • Target Type: Local Peering Gateway.
      • Destination CIDR Block: The other VCN's CIDR block. If you want, you can specify a subnet or particular subset of the peered VCN's CIDR.
      • Target Local Peering Gateway in <compartment>: The compartment where the other LPG is located, if not the current compartment.
      • Description: An optional description of the rule.
    6. Click Add Route Rules.

    Any subnet traffic with a destination that matches the rule is routed to your LPG. For general information about setting up route rules, see VCN Route Tables.

    If you no longer need the peering and want to delete your LPG, you must first delete all the route rules in your VCN that specify the LPG as the target.

  • Use the network route-table update command and required parameters to update the specified route table's route rules:

    oci network route-table update --rt-id ocid ... [OPTIONS]

    For a complete list of parameters and values for CLI commands, see the CLI Command Reference.

  • Run the UpdateRouteTable operation to update the specified route table's route rules.