VPC and subnet sizing
- When we create vpc in AWS , the allowed block size is between /16 and /28
- When we create a subnet we cannot use 2 ipaddres
- All 0’s is network id (x.x.x.0)
- All 1’s is broad cast ip (x.x.x.255)
- In the case of AWS VPC we cannot use 5 ipaddresses in every subnet
- All 0’s is network id (x.x.x.0)
- All 1’s is broad cast ip (x.x.x.255)
- x.x.x.1 (Reserverd by AWS for VPC Router)
- x.x.x.2 Reserved by AWS for IP address of the DNS Server
- x.x.x.3 Reserved for future usage.
- Exercise: Lets Create a VPC with 4 subnets and each subnet should be capable of having 500 devices each.
network cidr: 192.168.0.0/21
subnet1 cidr: 192.168.0.0/23
subnet2 cidr: 192.168.2.0/23
subnet3 cidr: 192.168.4.0/23
subnet4 cidr: 192.168.6.0/23

- Now we create vpc because we want to run our resources in this vpc.
- When we run our resources in VPC, we might need to access our resources (vm’s) from internet
- AWS VPC created by us is private in nature by default and cannot be accessed from internet.
- To enable access to our vpc from/to internet, we need to Create an internet gateway

- Create and attach internet gateway to VPC

- Select the default route table of the vpc

- Now we need to create a route which says, if the packet wants to travel to any ip address apart from vpc range forward to internet gateway
- Note:
i want you to forward the traffic to particular network,
cidr ranges
we can put restrictions on network id
192.168.0.0/16 => 192.168.x.x
192.168.0.0/24 => 192.168.0.x
192.168.0.10/32 => 192.168.0.10 Specific ip address
0.0.0.0/0 => x.x.x.x Any Ip Address
- Now add a route in default route table

- In AWS by default all the subnets will be forwarding traffic to route table with main as yes

- Now lets try to create an ubuntu ec2 instance in subnet 1

- Now lets try to login into ec2 instance
ssh -i <path to pem file> ubuntu@<puplicip>

- The stuff which we have done so far

Next Steps
- How to create public and private subnets
- What are security Groups and Network ACL’s
