~VPC basics~

Asonti Ginn
5 min readApr 17, 2023

Today’s Goals:

~ Learn how to make VPC’s, Subnets, Route Tables, and Internet Gateways.

Key Terms

~VPC: Virtual Private Cloud inside of AWS. Some features consist of: Subnets, Route tables, various Gateways, Elastic IPs, and more.

~Subnet: A range of IP Addresses, you can launch EC2 instances into subnets.

~Route Table: These are used for routing traffic with a specific set of rules.

~IPv4 CIDR block: Dotted decimal notation followed by a slash, this contains 32 bits and helps with routing data.

~Availability Zone: A location inside a region, you can launch instances into multiple availability zones in case one instance fails, you have another in a different zone.

~Internet Gateway: Enables communication between your VPC and the Internet.

Prerequisites

~An Amazon AWS account.

Create A VPC

In the AWS Console Home, go to the Search bar and type VPC.

In the VPC Dashboard select “Create VPC.”

We will create the VPC using the VPC only method.

Name the VPC something meaningful so you can know what you are using it for.

We will only be making an IPv4 CIDR block, using IPv4 10.0.0.0/16

The Tenancy will remain Default.

Now you can create the VPC.

Click “Select Actions” and “Edit VPC settings.”

We need to Enable DNS hostnames this allows our EC2 Instances (which we will connect to in another article) have DNS hostnames.

Create Subnet

Next is subnet creation, we will attach this subnet to our VPC. On the left side of your AWS console it lists the options for Virtual private cloud. Select Subnets.

Select “Create subnet”

You want to use the same VPC you created above because we are going to attach our new subnets to this VPC.

For our Availability Zone, we will use us-east-1a.

For our IPv4 CIDR block we will use 10.0.2.0/24.

If you need to attach multiple subnets at the bottom you can click “Add new subnet” and this will give you additional options.

Once you have completed your Subnet, you can go back to your VPC and check to make sure your subnet is attached.

Route Table

It is time to make a Route table, on the left side of your screen under Virtual private cloud, select “Route tables”.

On the right side click “Create route table”.

Route table creation is very simple all you need is a name and a VPC to attach it to.

Once it is created we need to add our subnet(s) to our table. Located at the bottom of the screen select “Subnet Associations” then select “Edit routes”.

Now you can add your newly created subnet(s) to the route table.

Internet Gateway

It is now Internet Gateways turn. Return back to the sidebar on the lefthand side and select “Internet Gateway”.

Select Create Internet Gateway.

This is even easier than before, this time all we have to do is type a name.

Now we need to attach a VPC. Select “Actions” then “Attach to VPC”.

Attach the proper VPC to the internet Gateway.

Make it all Connect!

Return back to Route Tables on the lefthand side bar.

Return back to your route table you made before and select “Edit routes”.

Lastly, select add route. Make the destination 0.0.0.0/0 (meaning from anywhere) and the target Internet Gateway.

Now everything is connected. You just learned how to utilize basic VPC Services, such as VPC’s, Subnets, Route Tables, and Internet Gateways.

For more, easy to follow articles, follow me on Medium!

--

--

Asonti Ginn

Hey! I am taking you on my Cloud engineering journey with easy to follow, how-to articles. All provided with an under 10-minute read and PLENTY of pictures!☁️