# \[Networking\] Bridged connection between two EC2 instances

**URL:** <https://awshq.com/t/networking-bridged-connection-between-two-ec2-instances/14533>\
**Category:** AWS Networking\
**Tags:** vpc, ec2\
**Created:** [March 3, 2022, 5:19pm UTC](https://awshq.com/t/networking-bridged-connection-between-two-ec2-instances/14533 "2022-03-03T17:19:53Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![that1guy15](https://awshq.com/letter_avatar_proxy/v4/letter/t/ed655f/32.png) [@that1guy15](https://awshq.com/u/that1guy15)\
**Post date:** [March 3, 2022, 5:19pm UTC](https://awshq.com/t/networking-bridged-connection-between-two-ec2-instances/14533/1 "2022-03-03T17:19:53Z")

</div>

Im looking for a way to provide a bridge connection between two EC2 instances in the same VPC.

I have one instance (m5d.metal) that host up a number of VMs via KVM and I need to directly connect select VMs on this instance to another instance in the same VPC. These connections must share the same subnet. Basically the connection needs to appear directly connected between them on a given interface.

 ![](https://awshq.com/uploads/default/original/2X/c/c448e6fb308a641e554b1c80c31d881374c7d049.png)

Is this possible?

[ENIs](https://aws.amazon.com/blogs/aws/new-elastic-network-interfaces-in-the-virtual-private-cloud/) seem to fit the requirements here but I’m not too familiar with it yet.

---

<div class="post-metadata">

**Author:** ![notauniqueusernom](https://awshq.com/letter_avatar_proxy/v4/letter/n/5fc32e/32.png) [@notauniqueusernom](https://awshq.com/u/notauniqueusernom)\
**Post date:** [March 3, 2022, 7:22pm UTC](https://awshq.com/t/networking-bridged-connection-between-two-ec2-instances/14533/2 "2022-03-03T19:22:20Z")

</div>

You need an overlay network using vxlan or similar.

---

<div class="post-metadata">

**Author:** ![notauniqueusernom](https://awshq.com/letter_avatar_proxy/v4/letter/n/5fc32e/32.png) [@notauniqueusernom](https://awshq.com/u/notauniqueusernom)\
**Post date:** [March 3, 2022, 7:23pm UTC](https://awshq.com/t/networking-bridged-connection-between-two-ec2-instances/14533/3 "2022-03-03T19:23:19Z")

</div>

It’s all in the same vpc based on the diagram so there’s nothing to peer

---

<div class="post-metadata">

**Author:** ![that1guy15](https://awshq.com/letter_avatar_proxy/v4/letter/t/ed655f/32.png) [@that1guy15](https://awshq.com/u/that1guy15)\
**Post date:** [March 3, 2022, 7:41pm UTC](https://awshq.com/t/networking-bridged-connection-between-two-ec2-instances/14533/4 "2022-03-03T19:41:22Z")

</div>

> [@notauniqueusernom](#):
>
> You need an overlay network using vxlan or similar.

That option is being scoped as we speak but I am looking for more direct and less complex options. Thanks!

---

<div class="post-metadata">

**Author:** ![that1guy15](https://awshq.com/letter_avatar_proxy/v4/letter/t/ed655f/32.png) [@that1guy15](https://awshq.com/u/that1guy15)\
**Post date:** [March 3, 2022, 7:58pm UTC](https://awshq.com/t/networking-bridged-connection-between-two-ec2-instances/14533/5 "2022-03-03T19:58:55Z")

</div>

> [@notauniqueusernom](#):
>
> It’s all in the same vpc based on the diagram so there’s nothing to peer

VPC peering is also a routed solution. I need these links directly connected. aka same L2 domain and LLDP neighbor adjacency.

---

<div class="post-metadata">

**Author:** ![skitzot](https://awshq.com/letter_avatar_proxy/v4/letter/s/43a26b/32.png) [@skitzot](https://awshq.com/u/skitzot)\
**Post date:** [March 3, 2022, 8:23pm UTC](https://awshq.com/t/networking-bridged-connection-between-two-ec2-instances/14533/6 "2022-03-03T20:23:34Z")

</div>

Depending on your needs, maybe this may help: [https://d1.awsstatic.com/whitepapers/aws-privatelink.pdf](https://d1.awsstatic.com/whitepapers/aws-privatelink.pdf)

---

<div class="post-metadata">

**Author:** ![m1m1n0](https://awshq.com/letter_avatar_proxy/v4/letter/m/e0b2c6/32.png) [@m1m1n0](https://awshq.com/u/m1m1n0)\
**Post date:** [March 3, 2022, 8:32pm UTC](https://awshq.com/t/networking-bridged-connection-between-two-ec2-instances/14533/7 "2022-03-03T20:32:47Z")

</div>

> [@that1guy15](#):
>
> That option is being scoped as we speak but I am looking for more direct and less complex options. Thanks!

It is the less complex solution. There is no way to send non-IP packets over AWS network, you have to encapsulate your L2 packets and transfer them over L3 network.

---

<div class="post-metadata">

**Author:** ![redvelvet92](https://awshq.com/letter_avatar_proxy/v4/letter/r/41988e/32.png) [@redvelvet92](https://awshq.com/u/redvelvet92)\
**Post date:** [March 4, 2022, 1:18am UTC](https://awshq.com/t/networking-bridged-connection-between-two-ec2-instances/14533/8 "2022-03-04T01:18:23Z")

</div>

> [@that1guy15](#):
>
> VPC peering is also a routed solution. I need these links directly connected. aka same L2 domain and LLDP neighbor adjacency.

Far as I am aware you don’t get L2 in AWS.

---

<div class="post-metadata">

**Author:** ![Dickie\_UK](https://awshq.com/letter_avatar_proxy/v4/letter/d/a8b319/32.png) [@Dickie\_UK](https://awshq.com/u/Dickie_UK)\
**Post date:** [March 4, 2022, 6:26am UTC](https://awshq.com/t/networking-bridged-connection-between-two-ec2-instances/14533/9 "2022-03-04T06:26:12Z")

</div>

This - there is no L2 in a VPC, nor can you attach an ENI to more than one instance or perform things like a virtual ARP or cluster IP. Each host has to have it own IP address.

If you don’t want to use the main VPC subnet to connect them, you can always create a dedicated cluster subnet and then attach a secondary ENI to each instance.
