How do I create a VPC with two subnets, one with access to the public network and one with internal communication?

Step 1: Create a VPC

create vpc

image.png

  • What is CIDR block?

CIDR stands for classless inter-domain routing, which is also known as slash notation. slash notation is a shorter way to create a subnet mask. A CIDR notation of /24 means that the subnet mask is not a subnet mask. notation of /24 means that the subnet mask is 25 bits in length.


A CIDR notation of /24 means that the subnet mask is 25 bits in length.

Step 2: Create a public subnet

image.png

2.1 What does the routing table mean in this?

image.png


anything in this subnet(destination) goes to local.

3.1 How to attach an internet connection to this subnet?

  1. Go to Step 4 to create an internet gateway

  2. edit

Step 3: Creating a private subnet

image.png

Step 4: Create an Internet gateway

Step 4.1 Create an Internet gateway

image.png

step 4.2: attach this internet gateway to vpc

image.png

Step 5: attach the route map to the public subnet and attach it to the route map

5.1 Add a new route rule to the route table specified by the public subnet

click public subnet, find its route table

image.png


image.png

5.2 Renaming the public route table

image.png

Step 6: Create another route table for private subnet and attach it to a private subnet

6.1 Create a new route table

image.png

6.2 Attach it to a new subnet

image.png

Step 7: Create an instance where it can access the internet

image.png

The first three numbers are not desirable (1, 2, 3)


Ref links:


https://www.youtube.com/watch?v=s_Ntt6eTn94&t=5s


https://www.youtube.com/watch?v=CP7yd7nOb5Q

Last updated: 2024-03-21 04:15:19AWS
Author:Chaolocation:https://www.baidu.com/article/23
Comments
Submit
Be the first one to write a comment ~