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)?
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...
Do Elastic Beanstalk Web Server Environment Need A Public Elastic IPasked 6 days ago
Ec2 Not connecting to InternetAccepted Answerasked a month ago
502 Bad Gatewayasked 2 months ago
Placing a Bastion in a Private Isolated Subnetasked 3 months ago
ec2 disconnects from the internet every monthasked 2 months ago
I can't reach EC2 instance even if all trafic is allowedasked 2 months ago
SSH connection timeoutAccepted Answerasked 5 months ago
Transfer Data from EC2 to S3asked 2 months ago
EC2 instance in private subnet shows IPv4 address of NAT instanceasked 3 years ago
AWS Elastic Beanstalk Running in Private VPC without internet accessasked 2 months ago