Thursday, February 25, 2021

how to configure cross region vpc peering


Task 1- Select Region-1 Ex:- US-east (Ohio)

Step 1) Create new VPC 

Your VPC >> Create vpc >> write vpc name "my-pc-1" >> write IPv4 CIDR "10.0.0.0/16" >> create VPC

Step 2) Create subnet

subnet >> create subnet >> select vpc >> write subnet name "my-subnet-1" >> select Availability Zone >> write IPv4 CIDR "10.0.0.0/24" >> create subnet

Step 3) Create Internet gateway and associate with vpc.

Internet gateway >> create Internet gateway >> write Internet gateway name "my-internet-gateway-1" >> create Internet gateway

Internet gateway >> select Internet gateway >> Action >> attach vpc >> select vpc >> Attach Internet gateway

Step 4) Create route table

route table >> create route table >> write route table name "route-table-1" >> select vpc >> create

route table >> select route-table-1 >> subnet association >> edit subnet association >> select private subnet >> save

route table >> select route-table-1 >> Routes >> edit routes >> add route >> write "0.0.0.0/0" in destination section >> select internet gateway in target section >> save routes

Step 5) Create Ec2 instance in US-east (Ohio) Region.

Note:- While creating ec2 select vpc-1
Note:- allow ssh and icmp protocol

 

Task 2 - Select Region-2 Ex:- Asia Pacific (Mumbai)

Step 1) Create new VPC 

Your VPC >> Create vpc >> write vpc name "my-pc-2" >> write IPv4 CIDR "192.168.0.0/16" >> create VPC

Step 2) Create subnet

subnet >> create subnet >> select vpc >> write subnet name "my-subnet-2" >> select Availability Zone >> write IPv4 CIDR "192.168.0.0/24" >> create subnet

Step 3) Create Internet gateway and associate with vpc.

Internet gateway >> create Internet gateway >> write Internet gateway name "my-internet-gateway-2" >> create Internet gateway

 

Internet gateway >> select Internet gateway >> Action >> attach vpc >> select vpc >> Attach Internet gateway


Step 4) Create route table

route table >> create route table >> write route table name "route-table-2" >> select vpc >> create

 

route table >> select route-table-2 >> subnet association >> edit subnet association >> select private subnet >> save 


route table >> select route-table-2 >> Routes >> edit routes >> add route >> write "0.0.0.0/0" in destination section >> select internet gateway in target section >> save routes


Step 5) Create Ec2 instance in Asia Pacific (Mumbai) Region.

Note:- While creating ec2 select vpc-2
Note:- allow ssh and icmp protocol

 

Task 3 - Create Peering Connection for establish a connect between cross region.

Peering Connection >> create Peering Connection

write peering connection name "peering-between-Ohio-and-mumbai" >> select vpc


 

select my account >> select another region >> write vpc id of (Ohio region) copy and paste >> create Peering Connection


 

Task 4 - Go to peering connection of (Ohio) region.

Peering Connection >> select Peering Connection >> action >> accept request


 route table >> select route table >> routes >> edit routes


 add route >> write (Mumbai region subnet) "192.168.0.0/24" >> select peering connection >> save route 

 


Task 5 - Go to peering connection of (Mumbai) region.

route table >> select route table >> routes >> edit routes

add route >> write (Ohio region subnet) "10.0.0.0/24" >> select peering connection >> save route

 

Task 6 - Now Connect ssh of both region ec2 and ping both ec2 private IP address 


No comments:

Post a Comment

testing