VPC
Table of Content
What is VPC?
What is public IP?
What is Private IP?
How to Create AWS VPC
Creating EC2 Instance in Public Subnet
Testing VPC Access through Terminal
What is VPC?
A Virtual Private Cloud (VPC) is a hidden resource hosted within the public cloud. It is a secure resource available to the organizations and the users who are dealing with sensitive data or applications. VPC also allows the users to control who can access their systems and who can’t by setting security groups and network ACL.
VPC allows the users to access only the needed resources and make more resources available as needed at will. The ability to customize your network environment using AWS resources allows users to efficiently handle business without compromising security.
What is public IP?
Public IP address is a unique address that allows users to connect to the public internet. The public IP addresses can’t be shared by two devices or services. These addresses act as unique identifiers that allow devices over a public network to transmit the data between them.
What is Private IP?
Private IP addresses are used in the closed off or private network. The communication between devices and resources in the private network happens with the help of Private IP. You can have as many private IPs as possible on a single network. The ISP (Internet Service Provider) provides public IP to home, or office and the IP is set on the router or switch. The router or switch takes that IP and turns it into the Private IP which gets assigned to multiple devices in the network.
How to Create AWS VPC
In this blog we will learn to create a VPC on AWS Free Tier.
In the search box search for VPC.
Click on Create VPC.
For this Demo, we will be creating a VPC with 2 public and 2 private subnets.
We will create 1 VPC in 1 AZ(Availability zone)
VPC endpoints will be none.
Click Create VPC
VPC creation will take few minutes.
Creating EC2 Instance in Public Subnet
In the search box, look up the EC2
Click on Create instance and select the AMI (For Demo we will be using Ubuntu 20)
Select the instance type, “t2,micro”
Select the “Key Pair” or create a new “Key Pair”.
Click on Edit under Network settings
Select the Demo-VPC which we just created and the subnet should be selected as Public.
Click on Launch Instance.
Notice the EC2 Instance is created with the public subnet we defined.
We will create another EC2 Instance in a private subnet.
In the search box, look up the EC2
Click on Create instance and select the AMI (For Demo we will be using Ubuntu 20)
Select the instance type, “t2,micro”
Select the “Key Pair” or create a new “Key Pair”.
Click on Edit under Network settings
Select the Demo-VPC which we just created and the subnet should be selected as Private.
Click on Launch Instance.
Notice the EC2 Instance is created with the Private subnet we defined.
Testing VPC Access through Terminal
We will try connecting to the Private Subnet EC2 Instance from our mac Terminal.
Note: This should not work, because the EC2 instance is inside the private network.
We will try connecting to the Public Subnet EC2 Instance from our mac Terminal.
Note: This should work, because the EC2 instance is inside the public network.
We should be able to access the Private EC2 instance through our public EC2 instance.
Comments
Post a Comment