Tuesday, January 7, 2014

VPC - Public and Private Subnet




Setting Up VPC ( Virtual Private Cloud ).


To take you through setup here we go.

1. Login with aws account in respective region.
2. Go into VPC tab and get started with “Create VPC” if you are  a new user you’ll get “Get started creating with VPC

3. The wizard starts and displays a page where you can select one of four options.

Select second option with “VPC with Public and Private Subnets”

Now to further take you as to why we selected this option.

We get two subnets with this option, one exposed to Internet if attached with EIP, known as Public  subnet and other in an isolated environment known as Private subnet. Now, to access the instances in Private we require an additional instance which is attached in Public and associated with EIP, for that amazon has provided us with VPC NAT AMI, it not only allows to access the Private subnet instances, but also routes outgoing traffic from Private subnet, thereby allowing Private subnet instances to get internet.

4. In continuation to third step, another wizard will get displayed, these wizard will describe your CIDR, Public Subnet Range, Private Subnet Range.

CIDR is Internet gateway for VPC, i.e. by default 10.0.0.0/16.The CIDR has two subnets private and public, that can be selected as per your convenience, by default Public Subnet and Public Subnet have 10.0.0.0/24 and 10.0.1.0/24 ranges respectively. Proceed further with Create button.

5. It will take time to create VPC.

6. Once, created you need to create Security group, though default is always available but it is wise to take to separate security groups one for Public and other for Private. Public can open Inbound traffic on 22, 80, 443 ports, Private you can manage according to your need.