Create a VPC network and Attach 4 Subnet, 3 Private and 1 public subnet.

 In the aws dashboard search for virtual private cloud. then click on create VPC



Fill 10.0.0.0/16 in IPv4 CIDR



Click on create VPC




Once VPC is created, go to subnets and click on create subnet

Create four different subnets in different availability zones


Click on create subnet



So all the respective subnets were created

now create Internet gateway, for this we can use the existing gateway or create new





Attatch the gateway created to a VPC


the VPC attatched can be viewed


Now let's create the Route Tables




Now inside the route table, edit subnet associations





Create another route table for Public subnets




configure the public route table to route all requests to the ISP




Now all the subnets in vpc are ready. let's launch the EC2 instance of each public and private ec2.

Create a fresh EC2 instannce, chnage the VPC and subnet in network settings





similarly create a new instance in VPC again with public subnet



 
also setup security group rules


Now the public subnet can be accessed via public ip








Comments

Popular posts from this blog

Installing and attaching MYSQL database to EC2 instance