0
votes

Is it possible to connect an EC2 instance in AWS VPC to both a private and a public subnet using ENIs? I'm aware of the bastion host concept from public/provate subnet communication, but curious as anything that will prevent me from configuring an EC2 instance to reside in both public and private subnets.

2

2 Answers

2
votes

Yes you can do it. You simply have to attach two Network interfaces. Those two network interfaces needs to be placed in two subnets. Here is the official documentation for that https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html

0
votes

Yes you can have multiple ENI's in different subnets and the same can be associated with a single instance, however the instance will once have a single ENI associated with it(from the OS perspective it will have eth0 and eth1). In this case the instance will assume the role(subnet) of the ENI which the OS is associated with it(it is generally eth0).