How to configure two Elastic Network Interfaces for an Ubuntu 20.04 EC2 instance?

453 views Asked by At

I have an Ubuntu 20.04 EC2 instance and I am facing a problem to configure two ENis for this instance.

I checked some resources on the net but if I’m right, they do not answer my point.

  1. How do I run my secondary network interface in my Ubuntu EC2 instance?
  2. Using the AWS EC2 Elastic Network Interface (ENI)
  3. Associate a public IP address with an EC2 instance with multiple network interfaces
  4. EC2 with two interfaces (one public and one private)

For network segregation issues, my instance has two network interfaces:

  1. The principal without a public IP address. This interface is located in a private subnet with a dedicated security group, a dedicated network ACL, a dedicated routing table.
  2. The secondary network interface is located in a public subnet. There are no restriction due to a security group or a network ACL and the routing table allows external communication via the Internet gateway. It has a private IP and an elasctic Internet IP associated with it.

The Linux command ip a displays the two interfaces each with its ip address, its CIDR, its broadcast address.

The linux command ip r shows the routes that seem correct: the gateway is well the second address of the subnet see.

These ip results are far different from those described in Internet resources where ip a does not display the properties of the second ENI.

On the instance, there is a Tomcat server configured without a link address so it listens on all network interfaces. If I try to contact my instance using the Elastic Internet IP, the request does not reach the EC2 instance.

I did a configuration test of the Elastic IP Internet on the primary network interface: it works.

Can someone help to set up on the secondary network interface?

0

There are 0 answers