VPC – Subnet – IGW – Route table
In this blog, I will show you how to create a virtual private cloud (VPC), Subnet, Internet Gateway, and route tables in the AWS Management console.
VPC – Subnet – IGW – Route table
How to Create VPC
1- Login to your AWS account and go to the AWS Services tab and then select VPC under Networking & Content Delivery.
2- Select Your VPCs under virtual private cloud
3- Click on Create VPC.
4- Create VPC wizard,
Name tag – My-VPC.
IPv4 CIDR block – 192.168.0.0/16.
Tenancy – default
Click Create
5- Click close
6- Now you can see two VPC created.
How to Create Subnet in AWS
1- Select Subnets and then click on Create Subnet.
2- Name tag – My-Subnet.
VPC – Select the VPC that you created earlier (My-VPC)
Availability Zone – Select an Availability zone.
IPv4 CIDR block – Enter valid CIDR block. For example (192.168.0.0/24)
Click Create.
3- Click close
4- Subnet successfully created
Create Internet Gateway in VPC
1- Select Internet Gateways new and then click Create Internet Gateway
2- Enter a name in the Name tag text box and then click create internet gateway.
3- The internet gateway just created and it is detached state. Now we need to attach it to your VPC.
Click Attach to a VPC, or in the action menu select Attach to VPC.
4- Choose your VPC from the drop-down list and then click Attach internet gateway.
5- The internet gateway changes to attached state.
Create Route Table
1- Select Route Tables, and then click on create route table.
2- Name tag – Type a name (My-Route table).
VPC – Select you’re (My-VPC) and then select Create.
3- Click Close
4- Route Table successfully created.
Routing of public subnets
Now you need to configure the routing for our public subnets. Traffic Enable from your public subnets to Internet by using the IGW attached to the VPC.
1- Select My-Route table and then select Subnet Associations
2- Click on Edit Subnet associations.
3- Select subnet ID (My-Subnet) and then click Save.
4- Select Routes and then Click edit route
5- Traffic from instances in the public subnets destined to the Internet will be redirected to the IGW.
Then you are redirected to the Route Table in the Virtual Private Cloud.
Click Add rules for destinations enter 0.0.0.0/0 and then select Internet Gateway.
6- Select (My-IGW) and then click save routes.
7- Click close
Create EC2 Instance
1- Select service tab, click on EC2 under compute.
2- Click on Launch Instance button.
3- Select Microsoft Windows Server 2019.
4- Select – General purpose t2.micro
Click Next : Configure Instance details
5- Network – select VPC (My-VPC).
Subnets – select My-Subnet.
Auto Assign Public IP – select Enable.
Click on Next : Add Storage.
6- Click Next : Add Tags.
7- Here we have tagged the instance (vpc server)
Click on Next : Configure Security Groups
8- Create a new Security Group.
Security group name – VPC-Security Group
Select Protocols RDP, HTTP, HTTPS, Select Source Anywhere
Click on Review and Launch
9- Review instance details and parameters and then click launch.
10- I am using existing pair key
11- Click view instances.
12- Now Instance created
For more details how to create EC2 Instance