I’m new to networking,
but I was wondering what happens in the following scenario: I have a VPC with an Internet Gateway IGW. Inside the IGW I have a private subnet, meaning that that subnet have a route table that is not connected to the IGW.
Inside this subnet I have an EC2 with a public IP, and security group that allows all inbound and outbound traffic.
From my understanding, a route table defines how traffic FROM subnet is directed (not TO subnet).
So, if from outside the VPC I send a request to the public IP of the EC2, the request will reach the IGW and enter the VPC, being now inside the VPC it will ‘locally’ (using the main root table) reach the subnet and the public IP of the EC2; then, since there isn’t a route to the IGW, the information will not be able to reach the IGW and the original client that lives in the outside internet. But the original request reached the EC2 thought.
Am I right? Or for some reason that I don’t understand, the signal will not even reach the EC2? In that case, why?
See image below for a visualization (consider the bottom left subnet)