Search code examples
amazon-web-servicesamazon-ec2aws-security-group

AWS EC2 Instance - Connection timed out BUT SG exists


I created an AWS EC2 instance where my EC2 instance is in the correct VPC and subnet.

Below are some evidences (Sec Group, Inbound, outbound, NACL, Route tables respectively)

N.B. NACLs have everything open for now. But I do accept that it needs to be cleaned up to have more aggressive control.

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

Question - What is it that I am doing wrong? Also, these are what AWS docs suggest too, so what's missing? Thanks for the answers in advance.


Solution

  • The issue is that the route in route table was for CIDR range 0.0.0.0/16 which actually resolves to any outbound routes between 0.0.0.0 and 0.0.255.255.

    The correct route is 0.0.0.0/0 which covers all IPv4 addresses, the route table can then route all outbound traffic to this route assuming there is not any more specific routes.

    For future reference a great tool to use is cidr.xyz.