What is VPC peering & How to setup VPC peering step by step : by kk
vpc peering
---------------
multiple vpc's
by default in aws
multiple networks not allowed to talk each other
if you want to establish a connection between multiple networks to talk each other
we can make this with the help vpc peering concept.
is there any possibility to talk multiple networks each other ?
no, by default it is not possible
we can make this possible with the help of vpc peering concept
vpc peering creation steps steps:
--------------------------------------
1.create two networks in different regions in same aws account
---------------
multiple vpc's
by default in aws
multiple networks not allowed to talk each other
if you want to establish a connection between multiple networks to talk each other
we can make this with the help vpc peering concept.
is there any possibility to talk multiple networks each other ?
no, by default it is not possible
we can make this possible with the help of vpc peering concept
vpc peering creation steps steps:
--------------------------------------
1.create two networks in different regions in same aws account
part -1
-------
step1: create network -1 or vpc -1 in region -1 ----->i.e. Mumbai
step2: create network -2 or vpc -2 in region -2 ----->i.e. Singapore
part-2 (region-1 process- mumbai)
-----------------------------------------
step1: go to Mumbai region
step2: create network -1 or create vpc-1 network range = 172.50.1.0/16
step3: create internet gateway
step4: attach this internet gateway to the vpc
step5: create public subnet
step6: create private subnet
step7: create a NAT gateway
step8: create public routing table
step9: attach public routing table to the internet gateway
step10: make an association with public subnet with public routing table
step11: create private routing table
step12: attach private routing table to the NAT gateway
step13: make an association with private subnet with private routing table
launch 2 ec2-instances inside subnets
1.create instance-1 in public subnet
2.create instance-2 in private subnet
part-3 (region-2 process-Singapore)
-------------------------------------------
step1: go to singapore region
step2: create network -2 or create vpc-2 network range = 172.60.1.0/16
step3: create internet gateway
step4: attach this internet gateway to the vpc
step5: create public subnet
step6: create private subnet
step7: create a NAT gateway
step8: create public routing table
step9: attach public routing table to the internet gateway
step10: make an association with public subnet with public routing table
step11: create private routing table
step12: attach private routing table to the NAT gateway
step13: make an association with private subnet with private routing table
launch 2 ec2-instances inside subnets
1.create instance-1 inside public subnet
2.create instance-2 inside private subnet
part-4 ( created security group, public server, private server)
------------------------------------------------------------------------
step1:create a security group : --->my security name = SG1
click on create a security
click on edit inbound rules
add rule1
1st rule
--------
add type = ssh
add rule2
2nd rule
--------
add type = all traffic
source: myip/custom/anywhere
select anywhere
automatically it will be a 0.0.0.0/0
if you attach this security group to the server
that server can accept requests from any networks
that means this service accept any IP address
step2: create a ec2-instance/server inside public subnet under network- or vpc-1
(public subnet -public server)
go to ec2-dashboard
click on launch instance
provide a proper name to the server (as the project guidelines)
select ami (os): Amazon Linux /redhat/ ubuntu
instance type: t2.micro --1GB RAM,1CPU
create new keypair (newly)
go to network & click on edit
--->Select VPC or Select your own network --network-1 or vpc-1
--->Select Public Subnet
--->enable IP address
select your existing security group
so,add your SG1 security group
-->select storage --8GB
-->no.of servers :1
-->launch instance
step3: create a ec2-instance/server inside private subnet under network-1 or vpc-1
(private subnet -private server)
go to ec2-dashboard
click on launch instance
provide a proper name to the server (as the project guidelines)
select ami (os): Amazon Linux /redhat/ ubuntu
instance type: t2.micro --1GB RAM,1CPU
create new keypair (newly)
go to network & click on edit
--->Select VPC or Select your own network --network-1 or vpc-1
--->Select Public Subnet
--->disable IP address
select your existing security group
so,add your SG1 security group
-->select storage --8GB
-->no.of servers :1
-->launch instance
Part-5
------
so, repeat all the above steps inside Singapore region also
------------------------------------------------------------
vpc peering steps
-----------------
step1:go to vpc dashboard
step2:go to peering connections
step3:click on peering connections
step4:proivde a proper peering name
step5:go vpc requester option
just provide your vpc-1
step6: account
1.my account ----->select my account only
because ,region-1 and region-2 are available in
single account
2.another account---> some times we create vpc in another account
but now, I would like to create 2vpc inside
my single account only
so, this option is not required form
region = Singapore
accepter = just provide the VPC -ID of Singapore
Comments
Post a Comment