How to Create VPC with Public and Private Subnet in AWS


We will learn about How to Create Public and Private Subnet in AWS.

Go to VPC

Star wizad.


VPC with a single public subnet :--

(vpc name, subnet with cidr with example) below.



Create Private Subnet :--



Private details below :--






Then next Step is create Internet Gateways which is require for Public subnet or internet :--




Attach the Internet Gateways which is your Own VPC :--



Than Create Route Table :--

Go to Routing Table which is created and attach the internet gateways :--

Go to left tab of Subnet, check mark and add the route table of you created :--


if you want to give the public ip address in creating the instance than :--





Go to EC2 and Create the instance :--





Below Image show the Public ip address and can access the server from out side
like :- putty and other :--

Go to Putty and Access :--

We create the instance with Own Vpc and Public subnet which is access from putty
and ping the google.com from instance. it is working fine :-
Now We create the Private subnet instance and what happen the instance step below :--




You can access to you private subnet instance from public instance step below :--

[root@ip-10-0-0-111 ~]# vi key.pem

Past the pem key in this file

[root@ip-10-0-0-111 ~]# chmod 4000  key.pem

[root@ip-10-0-0-111 ~]# ssh ec2-user@10.0.1.53 -i key.pem

       __|  __|_  )
       _|  (     /   Amazon Linux AMI
      ___|\___|___|

https://aws.amazon.com/amazon-linux-ami/2017.03-release-notes/
[ec2-user@ip-10-0-1-53 ~]$

Now ping the google.com from Private instacnce.



If you want the ping the google.com and install the packages from Global  Repo.
Create Nat Gateways the public subnet and ip :--



Create Private  Route Table and add the nat gateways :--


Go to Private instance and update,install packages as for requirement :--










How to Create VPC with Public and Private Subnet in AWS How to Create VPC with Public and Private Subnet in AWS Reviewed by Unknown on October 31, 2017 Rating: 5

No comments:

Scribe

http://feeds.feedburner.com/LinuxAndAws
Powered by Blogger.
X

Get Updates On

Linux Tutorial

AWS Tutorial

Devops Tutorial

We are going to send you our resources for free. To collect your copy at first, join our mailing list. So don't miss any updates, stay connected!