CodexBloom - Programming Q&A Platform

OCI Networking: implementing VCN Peering and Route Table Configuration

👀 Views: 0 đŸ’Ŧ Answers: 1 📅 Created: 2025-08-06
OCI Networking Terraform hcl

I'm wondering if anyone has experience with I'm stuck trying to I'm currently working on setting up VCN peering between two Oracle Cloud Infrastructure (OCI) VCNs, but I'm running into issues where the peering connection seems to be established correctly, yet the instances in the peered VCNs need to communicate with each other..... I've followed the documentation closely, using version 3.18.0 of the OCI Terraform provider. I created the VCNs and the required subnets as follows: ```hcl resource "oci_core_virtual_network" "vcn1" { compartment_id = "${var.compartment_id}" cidr_block = "10.0.0.0/16" display_name = "vcn1" } resource "oci_core_virtual_network" "vcn2" { compartment_id = "${var.compartment_id}" cidr_block = "10.1.0.0/16" display_name = "vcn2" } ``` After that, I set up the peering connection: ```hcl resource "oci_core_virtual_circuit" "vcn_peering" { compartment_id = "${var.compartment_id}" vcn_id = "${oci_core_virtual_network.vcn1.id}" peer_vcn_id = "${oci_core_virtual_network.vcn2.id}" } ``` I ensured that the security lists for both VCNs allow ingress and egress traffic on the required ports. For instance, I have the following egress rule: ```hcl resource "oci_core_security_list" "vcn1_security_list" { #... other settings ... egress_security_rules { destination = "0.0.0.0/0" protocol = "all" } } ``` Despite this, when I try to ping an instance in `vcn2` from an instance in `vcn1`, I receive the behavior `Destination Host Unreachable`. I've checked the route tables as well and added routes to both VCNs pointing to the peering connection: ```hcl resource "oci_core_route_table" "vcn1_route_table" { # ... other settings ... route_rules { destination = "10.1.0.0/16" destination_type = "CIDR" network_entity_id = "${oci_core_virtual_circuit.vcn_peering.id}" } } ``` I've verified the peering connection is in an 'ACTIVE' state. Can anyone suggest what might be going wrong? Is there anything specific to the OCI environment that I might be overlooking, especially regarding route propagation or security rules? How would you solve this? I'm using Hcl 3.10 in this project. What would be the recommended way to handle this? The project is a application built with Hcl. I'd really appreciate any guidance on this. Thanks, I really appreciate it! Thanks for any help you can provide!