How to Create Peering connection between two VPC on Amazon Web Service(AWS).

Peering is a method that allows two networks to connect and exchange traffic directly without having to pay a third party to carry traffic across the Internet.

A VPC peering connection is a networking connection between two VPCs that enables you to route traffic between them using private IPv4 addresses or IPv6 addresses.You can establish peering relationships between VPCs across different AWS Regions (also called Inter-Region VPC Peering).

First we need two VPC on same or different account so click on link https://www.hackerxone.com/blog/how-create-vpc-subnets-amazon-web-serviceaws for how to create VPC.

  • Login to aws portal.
  • Click on Services.

 

Fig 1

 

  • Under Networking & Content Delivery select VPC.

 

Fig 2

 

  • Click on VPC Peering Connections.

 

Fig. 3

 

  • Click on Create Peering Connections.

 

Fig. 4

 

  • Provide Peering connection tag name.
  • Select VPC as a Requester in your account with which you want to create the VPC peering connection.
  • Select another VPC as a accepter in your account or another account & same or different region

 

Fig. 5

 

 

 

  • Click on Create Peering Connection.

 

Fig. 5

 

  • After sometime Peering Connection is created successfully.

 

Fig 6

  • Click on OK then go to VPC Peering Connection console page.
  • New Peering Connection is there with the tag name we provide.

 

Fig. 7

 

Create VPC Peering Connection using Shell

To create a VPC peering connection between your VPCs

aws ec2 create-vpc-peering-connection –vpc-id vpc-requester-id –peer-vpc-id vpc-accepter-id

To create a VPC peering connection with a VPC in another account

aws ec2 create-vpc-peering-connection –vpc-id vpc-requester-id –peer-vpc-id vpc-accespter-id –peer-owner-id account-id –peer-region us-west-2

To create a VPC peering connection with a VPC in a different region

aws ec2 create-vpc-peering-connection –vpc-id vpc-requester-id –peer-vpc-id vpc-accespter-id –peer-region us-east-1

 

Leave a Reply