Sunday, July 28, 2019

VPC







VPC:
----
VPC is region dependent.
So, if created in North-Virginia, it is limited to there only.
But it can span to all availability zones in a region.
IP range of VPC should be between /16 and /28.
VPC is logical boundary.
Default only 5 vpcs per region.1 is created by default already.this limit can be increased by support ticket.

Needs of VPS:
---
1. security issue as serves can reach to each other on a data center with different accounts(customers).
2. IP Address overlapping, as different accounts(customers) may use same ip range.
3. Traffic segmentation and security between environments.

This virtual boundaries, only the machines inside them will get connected.Other machines, outside/different VPC, if need to connect, we should use VPC peering.



Steps to create VPC:
--------------------------
1. Decide on VPC name,say AWS-001 and IP range we are going to use 10.10.0.0/16(which can be divided in subnets), 65000 IPs.Enable DNS Hostnames.

VPC Dashboard -- your vpcs-- create VPC.In the dashboards, we have one more link of Create VPC, don't use that wizard as it less customization as very less options.For Tenancy, keep deafult,dedicated will keep a separate server for us and more costly.And also select no for IPV6.
In VPC, region is selected, not availabliliy zones.

2. Create 3 subnets in the VPC.Here, we can select the availability zones.If no preference is given then randomly selected in the region.
AWS-001-01 - us-east-1a -- 10.10.1.0/24
AWS-001-02 - us-east-1b -- 10.10.2.0/24
AWS-001-03 - us-east-1c -- 10.10.3.0/24

in vpc dashboard, select subnets and click create subnet.And provide, availability zone,VPC,ipv4 cidr bblock(different for different subnets) for subnet.
3 subnets in a VPC in 3 different zones.

After creation, right click on the subnet,modify auto-assign and select auto-assign public IP so that EC2 instances get an public IP directly so that we can connect to the instance.

if we didn't assign auto-ip and create instance and later when we enabled it, then again we need to redeploy the instance, won't get directly.Or we need to use the Elastic IPs to assign IP.




No comments:

Post a Comment