Hello and welcome back in this video, we are going to cover B PC pairing followed by a quick demo
But if all DC two instances in different VPC S are not able to communicate with each other using their private IP addresses
A V P CPR in connection is a networking connection between two VPC S that enables you to route traffic between them using private I
PV four and I PV six addresses. VPC pairing connection can be established between your VPC S or with a VPC in
another AWS account in the same or different AWS region. VPC pairing allows instances in either VPC to communicate
with each other as if they were within the same network using AWS existing secure infrastructure with no single point
of failure or bandwidth bottleneck traffic always stays on the global AWS backbone and never traverses the public internet
which reduces threats such as common exploits and DDOS attacks. VPC pairing does not have any separate charges
However, there are data transfer charges, be sure to know some key
limitations and rules of A PC P VPC pairing does not support
overlapping cyr blocks. You must use private links or VPC interface and points
VPC pairing does not support transitive pairing relationships or edge to edge routing
Also VPC pairing connections are limited on the number of active and pending pairing connections that you can have per VPC
Remember VPC pairing is a one-to-one relationship between two VPC S and only one VPC pairing connection can be established between the
same two VPC S. At the same time. In this demo, we are
going to set up a VPC pairing connection to enable connectivity between two VPC S in the same account and region
However, it can be easily extended to VPC S in different account and regions
Let's navigate to our VPC dashboard. We already had a VPC A created from our previous demos
Let's visit the resource map here. The VPC A, it has two subnets in us
East, one a region. The public subnet is associated with the customer route table and has a network connection to internet gateway
and the private subnet is connected to the main route table without any network connections
Let's start by creating a new VPC. This time we are going to use the VPC and more option
Let's have a non overlapping sider block. We are going to choose 10.1 dot 0.0 slash 16
We don't need an I PV six sided block for this demo. The number of S is limited to one uh number of public subnets
and private subnet is one. Let's customize our subnet sider block. I'm going to use 10.1 dot 0.0 slash 24
10.1 dot 1.0 slash 24. This gives us a total of 2 56 IP addresses per subnet
We don't need any NAD gateways or VPC N points for this demo
And we're going to enable the DNS host names and DNS resolution
Let's turn off the auto generate. We're going to name the VPC VPC B two subnets
Let's name them B PC B public subnet and the US East one A region and B PC B private subnet in the
same us East one region. Let's associate our public subnet with a custom route table which has a connectivity
or a network connection to internet gateway. And let's associate our private subnet with a main route table which does not have any network connections
Let's go ahead. This looks good. Let's go ahead and create our VPC
Let's wait for the VPC and its components to be created, right
And yet our C is created. Let's navigate back to our VPC dashboard and we have our two VPC S VPC A and VPC
B with non overlapping CYR blocks. Let's navigate to the EC2 dashboard
We already have a bash and host and a private server created in VPC A and we're going to create a bash and host and
a private server in VPC B. Let's go ahead and launch two new instances
Let's name it VPC B bashing host. We're going to use the same Amazon Linux 64 bit architecture due to
micro instant type. Let's select the same demo key pair. Let's add the network settings
We are going to launch the instance in VPC B in the public subnet with the public IP assigned enabled
Let's create a new security group we have enabled. Let's add a new security rule
with IC MP and let's add source from anywhere for now. Yeah
we are good with the security group. Rest of the setting looks good
We don't need a I M role for this demo. Let's go ahead and launch our first instance as a bashing host is being created
Let's go ahead and launch our private instance as well. I'm going to name the private instance VPC B private server
Amazon Linux 64 bit architecture T two micro. Let's select the same demo key pair
Let's edit the network settings. Let's associate it with VPC B. This time we are going to use the private subnet
no public IP. And we're going to select the same existing security group which we just created
Rest of the settings. Look good. Let's go ahead and launch our private server
Let's wait for the servers to be available and status check passed
Let's go back to the security groups and let's enable IC MP on the VPC A security group
Let's add it the inbound rule. Let's add a rule for IC MP
Let's add source from anywhere for now. Only for the demo security group has been updated
Let's go back to the two instances. Let's check the status, still initializing and yes
the status check has passed. Let's now do a quick ping test
Let's navigate to our B PC A bash host. Let's SS to it
Let's copy our private IP for the private server from VPC A
let's S s into the private server from our host. I'm going to split the terminal
I'm going to log in into the passion host from B PC B. Let's copy the public IP of the passion host from B PC
B and let's log in into the private server from VPC B
Let's copy the private IP address and lets us a search into it
We're going to do a simple ping test. We're going to ping the private IP of the VPC B private server from the VPC
a private server and the ping does not work. Are we going to do the same in reverse
Trying to ping the private IP or VPC, a private server from the VPC B private server and
the ping does not work. So we are not able to ping the private IPs from different VPC
S as they are isolated network. Let's now go ahead and create our V P CPR in connection
I'm going to name the V P CPR in connection as VPC A hyphen B
Let's select the requester VPC S VPC A, it's in my account within the same US east one
region. So no changes in here for the accepter VPC ID. Let's go ahead and select VPC B no
tags required. Let's go ahead and create the PC P in connection
And yes, the V P CPA in connection is now pending acceptance
If you are creating a VPC pairing connection in a different account
you would need to go ahead log in into the account and accept the connection for this one
It's in the same account. So I'm going to go ahead and accept the request
You can go through the attributes, the requester VPC, the accepter VPC
the sider blocks the requester and the acceptor owner ID remains the same
Let's go ahead and accept the request and the VPC P in connection has been accepted and in the status is active now
that the VPC pairing connection has been set. We need to modify our route tables for the VPC pairing connection entry
Let's edit the route in VPC. A main route table. The
destination is 10 100 slash 16. That's the P PC B sided block
And the target connection is of A B P CPR in connection. Yeah
let's see if the changes and let's modify the main route table
for VPC B as well. Mhm And in the routes, let's add an entry
for 10.0 dot 0.0 slash 16. That's the VPC A side dot block
Let's add the target as the B PC P are in connection. Now, let's save the changes
Remember, without the routing table changes, the VPC pairing correction would not work and would not be able to route the traffic between the two
VPC s. Now that the routing table changes has been done, let's try to
let's try to ping the private I B addresses again. And yes
we are now able to reach the private IP of the private server in VPC B from VPC A
Let's try the reverse and it works as well. So we have now successfully created a VPC pairing connection
between VPC A and B I hope that you enjoyed this demo
Thank you. All. All right. That was it. Thank you for watching
You can check out my website and connect me on linkedin and Twitter. If you enjoyed this video
please give it a thumbs up for any feedback. Please leave a comment down below to see more videos like this in the future
Hit the subscribe button. Thank you