Virtual Cloud Network Local Peering in OCI !!

Hi Guys,

In today’s post will see VCN Local peering.

High-level overveiw diagram of VCN Local peering:

C:\Users\firozhussain4045\Downloads\network_local_peering_basic.png

My Environment details :

I have two compartments.

Compartment 1 as PRD_COMPARTMENT:

  1. In this compartment, I have created VCN with CIDR 10.0.0.0/16 and with Subnets 10.0.1.0/24, 10.0.2.0/24, 10.0.3.0/24
  2. Created a Internet Gateway.
  3. Provisioned an instance with name prd-instance01 and its private IP is 10.0.1.2 (Used Subnet 1 for this instance)

Compartment 2 as SIT_COMPARMENT:

  1. In this compartment I have created VCN with CIDR 20.0.0.0/16 AND WITH Subnets 20.0.1.0/24,20.0.2.0/24,20.0.3.0/24
  2. Create an Internet Gateway.
  3. Provisioned an instance with name sit-instance01 and its private IP is 20.0.2.2 (Used Subnet 2 for this instance)

Now, by default the two instance prd-instance01 and sit-instance01 will not have communication as they are in a different compartment, different VCN, different subnets.

So, with the help of VCN Local peering concept, we will able to achieve the communication b/w the two instances which are in different compartments.

Steps to follow are:

  1. Create Local Peering Gateway in SIT_VCN01 (which is in SIT_COMPARTMENT).
  2. Create Local Peering Gateway in PRD_VCN01 (which is in PRD_COMPARTMENT).
  3. Add Local peering Gateway rule in Route table of SIT_VCN01
  4. Add Local peering Gateway rule in Route table of PRD_VCN01
  5. Go to Local peering Gateway of PRD_VCN01 and do the peering with the Local peering Gateway of SIT_VCN01
  6. Add security rule to allow desired protocols in both security lists of SIT_VCN01 and PRD_VCN01
  7. Check from both instance, they are able to communicate each other or not.

Creating Local Peering Gateway in SIT_VCN01 in SIT_COMPARTMENT.

SIT_LPG01 Local peering gateway creates successfully.

Going to PRD_COMP_VCN01, create a Local peering Gateway.

PRD_LPG01 Local peering Gateway created successfully.

Add Local peering Gateway in the Route table of PRD_VCN01

Added successfully PRD_LPG01 in the route table, please save the information.

Adding SIT_LPG01 Local Peering Gateway to the Route table of SIT_VCN01.

Now, go to PRD_LPG01 Local peering gateway and peer with SIT_LPG01.

If you go and see the SIT_LPG01 it will also show status as PEERED, there is no activity to do at SIT_LPG01.

Add the below security rules in the security lists of SIT_VCN01 and PRD_VCN01.

In SIT_VCN01 security list add the below rule:

In PRD_VCN01 security list add the below rule:

Now check the connectivity from both the instances it should have to communicate successfully.

Hope this post find’s you well!!

Any queries please let me know in comment box.

Firoz Hussain K.

Comments
  1. Posted by Subra
    • Posted by hussaindba
  2. Posted by Muhammad Asif
    • Posted by hussaindba

Add Your Comment