Skip to main content

Posts

VPC Peering scenario

Requirement: Create 3 EC2 instances (Machine A, Machine B and Machine C)in 3 different VPCs(VPC A, VPC B, VPC C). We should be able to do SSH from Machine A to Machine B and from Machine B to Machine C. However, we should NOT be allowed to Machine B to Machine A as well as Machine C to Machine B Solution: 1.        Create two VPC with CIDR Range 10.0.1.0/24, 10.0.2.0/24 & 10.0.3.0/24 2.        Create Subnet in respective VPC with range same as VPC CIDR 3.        Create two Internet Gateway and attach to respective VPC. 4.        In default Route Table add the default Rule (0.0.0.0/0) and target to Internet Gateway. 5.        Create Peering connections (for VPC Peering) a.        Select the Source as VPC A and destination as VPC B b.        Accept the Peering request c.        Select the Source as VPC B and destination as VPC C d.        Accept the Peering request 6.        Edit Route table A and add the route to VPC B CIDR Range and target to VPC Pe

NAT Instance

NAT Instance Requirement: Create EC2 instance in private Subnet and provide Internet access using NAT Instance Solution: 1.        Create One VPC with CIDR Range 10.0.0.0/16 2.       Create a private Subnet with CIDR Range 10.0.1.0/24 3.       Create a public Subnet with CIDR Range 10.0.2.0/24 4.       Create One Internet Gateway and assign to VPC. 5.       Create one custom Route table and associate Public Subnet. a.        Create a global route (0.0.0.0/0) and target to IGW 6.       Associate private subnet to default Route table 7.       Launch the Nat instance using the template from Community AMIs in public Subnet with Public IP enabled. 8.       Select the Nat Instance created à Action à Networking à Change Source/Dest. Check à   Yes, Disable button. 9.       Launch another EC2 instance in private Subnet with only Private IP. 10.   Note the Instance ID of the NAT Instance and identify the Network Interface ID from Network Interfac

NAT Gateway

NAT Gateway Create a VPC with two subnets and allow public access to EC2 instances only on one subnet. Then enable the internet to EC2 instances in Private Subnet. Requirement: Create EC2 instance in private Subnet and provide Internet access using NAT Gateway. Solution: 1.        Create One VPC with CIDR Range 10.0.0.0/16 2.        Create a private Subnet with CIDR Range 10.0.1.0/24 3.        Create a public Subnet with CIDR Range 10.0.2.0/24 4.        Create One Internet Gateway and assign to VPC. 5.        Create one custom Route table and associate Public Subnet. a.        Create a global route (0.0.0.0/0) and target to IGW 6.        Associate private subnet to default Route table 7.        Launch one EC2 instance (VM1) in public Subnet with Public IP enabled. 8.        Launch another EC2 instance (VM2) in private Subnet with only Private IP. 9.        Navigate to VPC à Nat Gateways 10.    Click on Create NAT Gateway button 11

IP Sec Tunneling

Requirement: Establish connectivity between the on-premise data center and AWS data center using IPSec tunneling.  Solution: We are creating IPSec Tunneling between two VPC in a different account and the different region as we don’t have on-premise data center.  Steps to achieve this. 1.        Create VPC A with CIDR Range 10.100.0.0/16 in First account. 2.        Create Subnet A in VPC A with range 10.100.1.0/24 3.        Create Internet Gateway and attach to VPC A. 4.        Add the Route (0.0.0.0/0) in default Route Table and target to Internet Gateway. 5.        Create VPC B with CIDR Range 10.200.0.0/16 in Second account. 6.        Create Subnet B in VPC B with range 10.200.1.0/24 7.        Create Internet Gateway and attach to VPC B. 8.        Add the Route (0.0.0.0/0) in default Route Table and target to Internet Gateway. 9.        Below steps to be executed at VPC B a.        Launch the EC2 instance in VPC B with Public IP enabled.

Launch my first EC2 Instance

EC2 Instance Amazon Elastic Compute Cloud is a web service provided by Amazon to spin up desired type Virtual Machine in any available Region. Let’s see how to launch an EC2 instance or Virtual Machine. After we have successfully created an account in AWS and logged in, Select EC2 from the service  drop-down. We need to select the region from the top right corner drop down in which EC2 instance to be launched. I have selected Singapore as an example. Click on the Launch Instance button. In this step we need to select what operating is needed for the EC2 instance. There are multiple options available like Amazon Linux, RHEL, SUSE Linux, Ubuntu, etc.. Let’s select the checkbox beside Free tier only to be sure we are selecting the template that is free for practicing.           In this step, we need to choose the computing power needed for the EC2 instance. Lets select t2.micro type as highlighted in the screenshot below and click on Next: Configure Instances De