Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS public subnet and private subnet traffic

I have created a vpc, and created two subnets one is public subnet(attached to internet gateway) and another is private subnet. I am able to access private subnet from public subnet. My question is how the traffic goes out from private subnet to public subnet? The private subnet is associated with main route table. And it has only route to local.

If possible can you please met me know how the traffic goes in route tables(in bound and out bound)? enter image description here

like image 220
user3094331 Avatar asked Oct 22 '25 10:10

user3094331


1 Answers

The public subnet can communicate with the private subnet because the CIDR of the private subnet falls within the local route of the route table associated with the public subnet. Likewise, the private subnet can communicate with the public one because the local route in its route table includes the CIDR of the public subnet.

You can run a little experiment with the VPC reachability analyzer to visualize this. Here's an example which illustrates TCP traffic going from one network interface in a public subnet (associated with the default route table), to a network interface in a private subnet (associated with a custom route table):

enter image description here

and here's what it looks like the other way around:

enter image description here

like image 55
Paolo Avatar answered Oct 24 '25 04:10

Paolo



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!