Creating VPC peering between Amazon AWS Accounts

Posted: March 5, 2018 in Amazon Web Services (AWS), AWS, Linux

A VPC Peering is a networking connection between two VPCs that enables routing traffic between them.Instances between VPC’s can communicate using private IP’s,instead of public.

In this example one AWS account is presented with Google Chrome (Requester-AWS account which requests VPC peering,and another with Mozilla Firefox-Accepter-AWS account which needs to accept peering request;)

Requester settings

I created VPC (for detailed steps take a look here).  Take especial care not to have same IP ranges in both VPCs, it wont work.

In this example i created a VPC with 10.1.0.0/16 range and 10.1.1.0/24 subnet

 

1

Creating VPC peering

Now we’ll create VPC peering between Custom VPC (10.1.1.0/24-Requester) and default VPC in another AWS account (172.31.0.0/16-Accepter)

From VPC dashboard:-Peering Connection-Create Peering Connection

1

 

Put a name-specify local VPC-Another account (specify AWS ID of remote account-Accepter)-Region and remote VPC ID and click Create Peering Connection

 

1

 

Remote VPC ID

1

 

 

 

1

Accepter settings:

Now, on Accepter AWS account (to which we want create VPC peer to) console Accept VPC peering connection

1.PNG

 

Modifying Route tables

One step remains-we now need to modify routing tables to allow remote networks:

On Requester:

Local network is 10.1.1.0/24 and remote is 172.31.0.0/16, so we need to associate that network with VPC peer we just created.From VPC dashboard-Route Tables-click on Routes tab-Edit-add another route

1

 

On Accepter AWS console,remote network is 10.1.1.0/24 so associate that network to VPC peer

1.PNG

Now create new EC2 instance and assign it to Custom VPC,machine on this VPC should communicate with EC2 on another AWS accounts using private IP addresses.

 

 

 

 

 

 

 

 

Advertisements
Comments
  1. Reblogged this on Programming Catalyst and commented:
    In case you are wondering about `VPC peering `

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s