Problem/Solution TIP: What to do in case AWS EC2 instance looses public IPv4 DNS with attached ElasticIP

Just a quick and very specific tip. Writing here, because “google did not help”, so maybe it will be useful for someone.

The problem: Our EC2 machine lost connectivity to external resources (there was no outgoing traffic) after reboot. It had associated ElasticIP, but public DNS for the instance could not have been resolved.

Image for post
Image for post
Just cant get even packages from AWS own repos
Image for post
Image for post
Part from the webpanel

Solution: The instance had 2 network interfaces associated

Image for post
Image for post
2 eth.

from different VPCs and the problem arose because during the reboot ElasticIP was associated WITH THE WRONG interface! So I had to re-associate it to another network interface and that’s it.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store