I have created a vpc. Within that I have 2 subnets, one is private and other is public on two different az's. Within these subnets, I have one ec2 instance in private subnet nd other in public subnet. Now what I want is to ssh into the private ec2 instance. Till now what I have done is:
- On the Public instance, I have added a Security Group (public-SG) that permits Inbound connections on port 22 (SSH) from anywhere.
- On the Private instance, I have added a Security Group (Private-SG) that permits Inbound connections on port 22 from public-SG.
I am able to ssh into public EC2 instance but from that instance I am unable to ping the private EC2.
I have create public and private subnets and each subnet has route table associated with them. I am attaching the route table information.
Public route table: