Types of VPC in AWS
There are two types of VPC:
Default VPC.
Custom VPC.
Default VPC:-
Created in each AWS region when an AWS account is created.
Has default CIDR, Security group, NACL and Route table settings.
Has an internet gateway by default.
Custom VPC:-
Custom vpc is created by AWS account owner.
Aws user creating the custom vpc decides the CIDR.
Has its own default security group, NACL and route table.
Does not have an internet gateway by default, One needs to be created if needed.
Types of subnets:
Public subnet.
Private subnet.
Public Subnet:
If a subnet's traffic is routed to an internet gateway, that subnet is known as a public subnet.
If you want your instance in a public subnet to communicate with the internet over IPV4, it must have a public IP address or Elastic IP address.
Private Subnet:
- If a subnet does not have a route to the internet gateway, that subnet is known as a Private subnet.
Note:
When you create a VPC, you must specify an IPV4 CIDR Block for the vpc.
The allowed CIDR block range is between 0.0.0.0/16 to 0.0.0.0/28 netmask.
The first four and last IP address cannot be assigned.
For example:
10.0.0.0 --> Network address.
10.0.0.1 --> Reserved by AWS for VPC Router.
10.0.0.2 --> Reserved by AWS for the IP address of DNS.
10.0.0.3 --> Reserved for future use.
And the last one as we all know, is the broadcast address of any IP address. which is 10.0.0.255 --> Broadcast Address.