VPC and Subnet

Soumya Pallebothula
3 min readJan 7, 2021

--

VPC

VPC can be defined as Virtual Private Cloud.. it is a virtual network dedicated to the AWS account and most commonly used in the context of Infrastructure as a service. VPC is a private sub section of AWS that you control, in which you can place AWS resources(such as EC2 instances and databases).You have FULL control over who has access to the AWS resources that you place inside your VPC.

Virtual Private Cloud

Key concepts For VPCs:

  • Virtual private cloud (VPC) — A virtual network dedicated to your AWS account.
  • Subnet — A range of IP addresses in your VPC.
  • Route table — A set of rules, called routes, that are used to determine where network traffic is directed.
  • Internet gateway — A gateway that you attach to your VPC to enable communication between resources in your VPC and the internet.
  • VPC endpoint — Enables you to privately connect your VPC to supported AWS services and VPC endpoint services powered by Private Link without requiring an internet gateway, NAT device, VPN connection, or AWS Direct Connect connection. Instances in your VPC do not require public IP addresses to communicate with resources in the service. Traffic between your VPC and the other service does not leave the Amazon network.
  • CIDR block — Classless Inter-Domain Routing. An internet protocol address allocation and route aggregation methodology.

Configuring a VPC in AWS

  1. Allocate an Elastic IP Address
  2. Create a VPC

i)Search for the VPC in the search box of your Ec2 console management.

ii)And then find Your VPCs in the VPC management Console and you can find the Create VPC there.

iii)Click on the Create VPC. And then next page gets open and add the name of the VPC and then click on the Create VPC you can find it on the bottom of the page..

iv)Therefore, your VPC is created.

When you delete a VPC using the VPC console, we also delete the following VPC components for you:

  • Subnets
  • Security groups
  • Network ACLs
  • Route tables
  • Gateway endpoints
  • Internet gateways
  • Egress-only internet gateways
  • DHCP options

Subnet

A subnet, or subnetwork, is a network inside a network. Subnets make networks more efficient. Through subnetting, network traffic can travel a shorter distance without passing through unnecessary routers to reach its destination.

A subnet mask is used to divide an IP address into two parts. One part identifies the host (computer), the other part identifies the network to which it belongs. To better understand how IP addresses and subnet masks work, look at an IP address and see how it’s organized.

Creating a Subnet in AWS

  1. Open the Amazon VPC console.
  2. In the navigation pane, choose Subnets, Create subnet.
  3. Specify the subnet details as necessary and choose Create. Name tag: Optionally provide a name for your subnet. …

Availability Zone: Optionally choose a Zone in which your subnet will reside, or leave the default No Preference to let AWS choose an Availability Zone for you.

  • IPv4 CIDR block: Specify an IPv4 CIDR block for your subnet, for example, 10.0.1.0/24.
  • IPv6 CIDR block: (Optional) If you’ve associated an IPv6 CIDR block with your VPC, choose Specify a custom IPv6 CIDR. Specify the hexadecimal pair value for the subnet, or leave the default value.

4. (Optional) If required, repeat the steps above to create more subnets in your VPC.

Creating Security Groups in AWS

  1. Open the Amazon VPC console.
  2. In the navigation pane, choose Security Groups.
  3. Choose Create security group.
  4. Enter a name for the security group (for example, my-security-group ), and then provide a description.
  5. From VPC, select the ID of your VPC.
  6. (Optional) Add or remove a tag.

[Add a tag] Choose Add new tag and do the following:

  • For Key, enter the key name.
  • For Value, enter the key value.

[Remove a tag] Choose Remove to the right of the tag’s Key and Value

7. Choose Create

Introduction to AWS CLI

The AWS Command Line Interface (CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts.

Thank you!

--

--

No responses yet