Skip to content

AWS instance unusable after attaching Network Interface

0

I am following the Virtual Application Guide for PacketGen Dual Instance Loopback (https://github.com/aws/aws-fpga/blob/f2/sdk/apps/virtual-ethernet/doc/Virtual_Ethernet_Application_Guide.md) and have successfully replicated the results.

However I noticed that whenever I attach a network interface (which is a step in the guide), I can't reconnect to my instance once I restart it, as the hostname changes

Something from

"ubuntu@ ec2-3-12-212-22.compute-1.amazonaws.com" (initial hostname for the instance)

into

"ubuntu@ 172.21.11.10" (after restart with the additional attached network interface)

Wherein I get a connection timed out when I try to connect. Please advise on what steps to follow to avoid this issue, thanks.

2 Answers
1

The issue you're experiencing is likely related to the network configuration changes that occur when attaching a new network interface to your EC2 instance. When you attach a new network interface, it can alter the networking setup of your instance, potentially affecting how it's accessible over the network. Here are some steps you can take to address this issue:

  1. Before attaching the new network interface, make sure to configure your security group settings to allow inbound SSH (port 22) traffic from your IP address to both the primary and secondary network interfaces.

  2. When attaching the new network interface, pay attention to the device index. It's recommended to use a device index other than 0, as 0 is typically reserved for the primary network interface.

  3. After attaching the new network interface and restarting the instance, try connecting using the private IP address of the primary network interface rather than the public DNS name. You can find this in the EC2 console under the instance details.

  4. If you're still unable to connect, you may need to modify the instance's network configuration to ensure it's correctly using both network interfaces. This might involve editing network configuration files on the instance.

  5. As a precautionary measure, before making any network changes, it's advisable to create a snapshot or AMI of your instance. This way, if you encounter persistent connectivity issues, you can restore from the backup.

  6. If you continue to have problems, you might need to detach the newly added network interface, restart the instance, and then try to reconnect using the original public DNS name.

Remember, when working with network interfaces, it's crucial to carefully manage your instance's network configuration to maintain accessibility. If you're following a specific guide, ensure that you're also adapting the steps to your particular network setup and security requirements.
Sources
No Internet connection | AWS re:Post

answered a year ago

EXPERT

reviewed a year ago

0

Let's do the following validations:

  • Can you validate under the instance summary on the EC2 console -> Networking tab that the Public IPv4 DNS name still the same before adding the additional ethernet network card?

  • If so, can you validate your device can resolve the dnslookup for the Public IPv4 hostname to an IP matching the public IP of your primary eth0?

  • finally, review this KB on how to handle ubunto with multiple network interfaces. Some routing configuration needs to be handled within the instance: https://repost.aws/knowledge-center/ec2-ubuntu-secondary-network-interface

Let me know if that doesn't fix your problem.

AWS
EXPERT

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.