How it works...

EC2 instances in a VPC can connect to each other via the local route in the Route Table provided the Security Group allows inbound connections. For SG (say SGPrivate) of the instance in private subnet, we added SG of instance in public subnet(say SGPublic).  This ensures that no other instance can connect to the new instance in the private subnet apart from EC2 instances associated with SGPublic. Now we have created a bastion server or jump server, which is our EC2 instance in the public subnet. To connect to the instance in the private subnet instances, someone has to go through it. Generally, the Security Group of a bastion server is configured to accept connections from a list of known IP addresses where administrators ...

Get AWS Networking Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.