I have on my AWS 2 different VPCs which are attached both to VPC peering. I'd like to establish a connection between 2 Ubuntu's servers which are deployed in different VPCs.

In VPC1 = in subnet1 = there is VM1 =

One the other hand, in VPC2 = in subnet1 = there is VM1 =

I know with VPC peering there's a connection, and I am able to ping the second server. I'm looking for an alternative way where I can directly route my traffic from an instance to another using the main interface eth0. Might I somehow help me to have such configuration?

  • For clarification, are you looking for a non-VPC-peering solution to connect your EC2 instances? – Matt Houser Jun 27 '19 at 12:05
  • @MattHouser Yes, if that helps. I tried also VPC Transit GW basically the same thing as VPC Peering. – Tim Luka Jun 27 '19 at 12:22
  • Why is VPC peering not a good solution for you? – Matt Houser Jun 27 '19 at 12:41

A key to answering this question would be understanding why VPC peering isn't working for you.

VPC stands for Virtual Private Cloud. It's a completely isolated network, which by default has no connectivity to other networks or VPCs. There is no connectivity directly between your virtual machines ethernet ports.

Short answer: All in all, VPC peering is typically the cheapest, easiest option for connecting two VPCs.

To connect instances in two VPCs the options that occur to me are:

  • VPC peering. This is typically the fastest and cheapest option, as it goes over the AWS internal network

  • Transit Gateway. Connect multiple VPCs together, and to on-premise. More expensive and than VPC peering, it's really made for enterprise networking.

  • VPN - you could set up a VPN between your VPCs. You'd need a virtual appliance as I don't think you use the build in AWS networking to join two VPCs. This costs more than VPC peering and introduces. This goes over the internet, though in practice probably never leaves the AWS network.

  • I suspect there is an option that would route things over the internet using some other kind of tunnel. You would need to ensure this is encrypted.

Please update your question to tell us why VPC peering isn't working for you.

  • 1
    Thanks, @Tim! I totally understood! I will continue with VPC Peering then :) – Tim Luka Jun 28 '19 at 9:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.