2

I have a VPC, inside there is a public subnet and two private subnets. I configured security groups as well as route tables and I can access ES2 instances in the two private subnets from the instance in the public subnet.

Now I want to know if I can directly connect to the instances in one private subnet from the instances in the other private subnets. If yes, how.

Thanks, Philip

Philip Shangguan
  • 449
  • 5
  • 19

1 Answers1

6

All subnets within a VPC can communicate with each other by default. In fact, the only way to prevent this is by defining Network ACLs that Deny traffic.

So, yes, an instance in one private subnet can connect to an instance in another private subnet (in the same VPC). Just use the Private IP address to connect.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • 2
    I have to use security groups to make this work. By default, i can not ssh from one private subnet to the next private subnet, the ssh session timed out. So what I did was to create a security group that allows ssh from the second private subnet and associated it with the instance in the first private subnet, that worked. I then created another security group did the opposite and associate it with the instances in the second private subnet and it worked as well. – Philip Shangguan May 22 '18 at 02:55