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.
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...
Relevant questions
Do Elastic Beanstalk Web Server Environment Need A Public Elastic IP
asked 6 days agoEc2 Not connecting to Internet
Accepted Answerasked a month ago502 Bad Gateway
asked 2 months agoPlacing a Bastion in a Private Isolated Subnet
asked 3 months agoec2 disconnects from the internet every month
asked 2 months agoI can't reach EC2 instance even if all trafic is allowed
asked 2 months agoSSH connection timeout
Accepted Answerasked 5 months agoTransfer Data from EC2 to S3
asked 2 months agoEC2 instance in private subnet shows IPv4 address of NAT instance
asked 3 years agoAWS Elastic Beanstalk Running in Private VPC without internet access
asked 2 months ago
When your instance disconnects from the internet, what errors are you seeing? How are you calling the external web service (port/protocol/address)?