Tuesday, August 22, 2017

How to create a Red Hat Linux instance in AWS custom VPC and connect to it

Objective:
Create an RHEL7.4 instance in a custom AWS VPC and connecting to it using the putty software from your desktop.

Software setup required:
  1. Have a working AWS account to launch RHEL instance
  2. Download putty software on your PC to connect to it
Challenges:

Launching RHEL instance in the default VPC can directly be pinged ot ssh'ed from your desktop using putty; however, connecting to an RHEL instance within your own custom VPC requires a few settings in place which essentially requires some idea about VPC concepts.

Steps:
  1. Create a custom VPC
    1. Create a custom VPC with a name (e.g. Demo_VPC) in a preferred region and give it a CIDR IP pool (e.g. 10.0.0.0/16)
    2. Create and attach an Internet Gateway to this Demo_VPC.
    3. Create a new route table in this VPC and make an entry that enables any outgoing traffic to be redirected to the Internet Gateway (e.g. Destination = 0.0.0.0/0  / Target = Internet Gateway)
    4. Create a subnet within the VPC and attach it to the route table thus making the subnet as a public subnet (this subnet has a route to reach to the Internet Gateway).
  2. Create a Red Hat Linux Instance and specify its VPC as the Demo_VPC and allow the instance to have a public IP be auto assigned to it.
  3. Create a new service group, assign it to the Linux instance and have the ICMP/ssh protocols enabled on this instance for the outside world (Security Groups are stateful so no need to explicitly define the outgoing traffic rules)
  4. Download or reuse the earlier downloaded ssh key (convert it to a ppk key to use it with putty) and connect to the linux instance using putty.
Note- Don't forget to shutdown (stop) the test instance when not in use.

No comments:

Post a Comment

Drooling Over Docker #4 — Installing Docker CE on Linux

Choosing the right product Docker engine comes in 2 avatars — Docker Community Edition (CE) and Docker Enterprise Edition (EE). While the...