ec2 disconnects from the internet every month


I have an ec2 instance of type t2.micro and I have a web service that communicates with services outside the server so it needs internet and I have noticed that internet connectivity is lost at least 1 time a month and I have to restart so that back to normal and I would like to solve that problem. It is worth mentioning that I have a load balancer for that server and a security certificate for my domain.

  • When your instance disconnects from the internet, what errors are you seeing? How are you calling the external web service (port/protocol/address)?

1 Answer

I understand lost internet connection as 2 possibilities:

  1. your EC2 can not reach out to internet : suggest check VPC flow logs to see if traffic is sent out, to confirm if it is EC2 issue(most likely ), if you can not find logs in VPC flow logs, most probably EC2 is not sending out packets, you can try tcpdump on EC2 to see what is happening.
  2. Your EC2 can not receive traffic from internet, in your case, it is your load balancer receives traffic from internet and forward to your EC2, you can check the healthcheck result from your load balancer to see if your EC2 port is functioning. you can also try to ping private IP's gateway address from EC2 to see if IP path is OK or not.

For both case I suspect EC2 issue, suggest next time you can take a look at EC2 logs , check memory usage, disk usage, any suspicious logs, etc...

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.

Guidelines for Answering Questions