• Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • Categories
    Category
    {{ postCtrl.tags }}
    • {{ category.tag_type }}

      • {{tag.tag_name}}
      • View more
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial News Comments FAQ Related Articles

How to configure VPC with Public and Private Subnet on AWS

{{postValue.id}}

VPC configuration with Public and Private Subnet on AWS

Introduction:

The VPC is an acronym of Virtual Private Cloud. In the Amazon Web Service (AWS) environment, we can manage the Network Infrastructure in a secure way using the VPC (Virtual Private Cloud). This tutorial will cover VPC configuration with public and Private subnet on AWS.

Internet Gateway:

Allow Communication between two instances (or) communication between VPC to the Internet is known as IGW (Internet Gateway)

Subnet:

It is used to divide a single network into multiple networks using the different IP addresses is called subnetting.

Route Table:

In VPC infrastructure we can define how the traffic will flow in terms of using routing policy is called Route Table.

NAT Gateway:

Providing Internet to your private instance is called NAT Gateway.

The procedure of the VPC Creation:

Now we will see VPC configuration with Public and Private Subnet on AWS for that first we have to log in to your AWS console. snap1 Now I need to create VPC for that click services and search VPC and click your VPC and create VPC and enter the VPC name enter the IP Range and click create. snap2 snap3 Then I need to create subnets for Public1, Public2 and Private1 and Private2 for that click subnets then create a subnet and enter the name of the subnets then select VPC select region and enter then IP range then click create snap4 snap5 Then the same way I will follow to create remaining subnets, finally the subnets are created snap6 Then I have to route table for that click route table window click create route table enter the name of the routing table select the VPC and click create snap7 The same way I follow to create another Route Table, finally, the routing table is created snap8 Next, I will create an internet gateway for that click the internet gateway window then click create a gateway and enter the name of the gateway and click create. Finally, the gateway is created snap9 Now we have attached the gateway to the VPC for that click actions and click attach VPC and select VPC and click attach then gateways are attached to our VPC. snap10 Now I will create the Instance using a public subnet and access the instance via the Git Bash. For that, go to ec2 and click launch Instance and select the AMI and choose the tier than the configuration instance window select then network tab on you VPC and select the subnet and enable the auto-assign IP. snap11 Now leave the default the specifications of the storage and enter the Instance name snap12 Now go to the configure security group and enter the security group name and give all traffics and change the source to anywhere snap13 Click the launch and create your keypair and for access your instance using SSH snap14 Now I will define the routing policy of the public instance for that go to the route table window and select the Public route table and click routes and edit routes enter all traffic and put internet gateway ID to the target and click save snap15 Now I will associate the subnets for that click associate subnets and edit then select the public subnets and click save. snap16 Now I will take access to the public Instance for that go to download location of your local machine and right-click open Git bash and run the following command to take ssh after that I will check if the internet is connected or not snap17 snap18 Now we will see how to create NAT instance and Private Instance and how to access Private instance through NAT instance Go to AWS console and click launch instance and click community AMIs and search NAT and select any AMI for your NAT instance and do then same steps what you have done for the instance creation Then create the Instance for the private as follow the same way of the public instance creation Finally than instance is created snap19 Now I will defines the routing policy for the private for that click route table and select private and click edit and click add route destination is all traffics and put a target for NAT instance ID then click save and associate the private 1 and 2 subnets. snap20 snap21 Now I will access the NAT instance via the Git Bash. For that open Git Bash and take SSH on NAT instance and check then internet connectivity snap22 snap23 Now I will access the Private Instance through the Private instance for that go to the AWS console and choose NAT instance click Connect tab then click SSH client and there you can see what are then steps to follow to connect then instance to then NAT instance snap24

First I am given the permission of the private key snap25 Then I have to take control of the Private instance through the NAT instance. Finally, I take access to the private instance through NAT instance snap26 Now I will check the internet connection but the internet is not working snap27 **If you want the internet connection you have to do some steps on NAT instance on AWS console for that open AWS console choose NAT instance click actions and click networking tab then click change source to destination check then enable stop and save. Now check the connection on a private instance ** snap28 Now the internet connection is working on the private Instance snap29 With this method, VPC configuration with Public and Private Subnet on AWS.

Tags:
sebastian
Author: 

Comments ( 0 )

No comments available

Add a comment
{{postCtrl.cmtErrMsg}}

Frequently asked questions ( 5 )

Q

What is mean by VPC?

A

The VPS defines Virtual Private Cloud. It means In AWS Environment if you want to manage your Network Infrastructure in a secure way is called VPC (Virtual Private Cloud).

Q

What is Internet Gateway?

A

Allow Communication between two instances (or) communication between VPC to the Internet is known as IGW (Internet Gateway)

Q

What is subnetting?

A

It is used to divide a single network into multiple networks using the different IP addresses is called subnetting.

Q

What is Route Table?

A

In VPC infrastructure we can define how the traffic will flow in terms of using routing policy is called Route Table.

Q

What is mean EC2?

A

Amazon Elastic Compute Cloud (AmazonEC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers. It provides you with complete control of your computing resources and lets you run on Amazon's proven computing environment.

Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Luk Van De Looverbosch ?
How to create a root ?

Hello,
How to create root@linuxhelp in Linux Mint 20.1 64-bit ?
Thanks in advance for your reply.
Best regards.

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.