Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 990
ha9u63ar Avatar asked Jan 28 '26 02:01

ha9u63ar


1 Answers

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.

like image 193
Chris Williams Avatar answered Jan 30 '26 11:01

Chris Williams



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!