How to Configure VPC Peering
VPC peering Is used to provide the communication between instance in different VPC . VPC peering can be done in same region and between different region and both can be in same AWS account or different AWS account.
- Create the VPC names DCLESSONS-VPC-2 with CIDR 0.0.0/16 and peer it with precious VPC DCLESSONS-VPC .
- Once peering is done , accept the VPC requestor.
Configure the VPC named DCLESSONS-VPC-2 with CIDR 18.104.22.168/16 in same way as we configured earlier.
In AWS VPC console. In the left menu option, choose Peering Connections under Virtual Private Cloud:
Click on Create Peering Connection. Provide the Peering connection name tag, VPC (Requester) and VPC (Accepter). Click on Create Peering Connection:
In AWS VPC console. In the left menu option, choose Peering Connections under Virtual Private Cloud. Select the peering connection and browse to Actions | Accept Request:
Browse to Actions | Edit DNS Settings. Allow the DNS resolution. Click on the Save button: If you get error then select each VPC and enable DNS hostnames .
Go to the VPC associated with the peering connection. Click on the Route Table of one VPC. Click on the Edit button and add the route for VPC peering mentioning the CIDR range of other VPCs as shown. Click on the Save button. Do the same for the other , like create the another route table and attache with another VPC target group.