Randomly unable to connect to ec2 instance from some networks


Randomly I am unable to connect to ec2 instance from office network and some others. When it happens I am unable to ping ec2 instance from this networks, but if I use a VPN it return to work correctly.

It works fine outside the office network and with 4G hotspot. Looks like something is getting blocked in specific networks.

Security groups seems configured well inbound/outbound rules (here https://i.stack.imgur.com/8GCaS.png)

Here StackOverflow thread for more info https://stackoverflow.com/questions/70891480/randomly-unable-to-connect-to-ec2-instance-from-some-networks

asked 2 years ago421 views
3 Answers

If you can consistently do that outside your office network, most likely it's the issue with your corp network that's blocking traffic. You should contact your network admin.

One way to try to troubleshoot is using tracert command and optionally enable and check VPC flowlogs.

If you were not able to see the traffic coming in in the VPC flowlog, it might suggest the packet is dropped before reaching AWS.

answered 2 years ago
  • But it's not only from my office network that problem occurs, also from other specific networks. I have enabled the flow log and this is the result (i.ibb.co/0rBTLDS/Cattur2.png). On 31-01-2022 from 3:14 to 3:20 GMT + 01: 00 approximately the problem occurred on a machine with ip highlighted in blue in the file; on the log everything looks ok. As soon as I am able to replicate the error I will run tracert for more info

  • The flowlog's record shows port 443 which generally is for HTTPS traffic, not SSH (22).


yes, the problem is on http/s connection, not ssh

answered 2 years ago

This is the tracert on machine connected to network with the error (while error occurs) https://i.ibb.co/QmwXQFj/err.png

answered 2 years 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