VPC、子网与路由表
设计并配置您在 AWS 中的隔离虚拟网络,定义子网并有效地路由流量。
VPC、子网与路由表 是 CoddyKit 上的免费 AWS for Backend Developers (EC2, S3, RDS, Lambda) 课时。 这是第 1 节课,共 4 节。 你可以在下方免费阅读本课时的完整内容 — 然后在浏览器中使用内置代码编辑器和全天候 AI 导师进行实践。 这是 AWS for Backend Developers (EC2, S3, RDS, Lambda) 学习路径的一部分,你的进度在网页和 CoddyKit 应用中同步。 AWS for Backend Developers (EC2, S3, RDS, Lambda) 课程共包含 4 节课。
本课时的部分内容尚未翻译,以英文显示。
Your Private Cloud Network
Welcome to AWS Networking! Just like your home or office network, applications in the cloud need a way to communicate securely.
AWS provides a service called Virtual Private Cloud (VPC). It's your own isolated network space in the AWS cloud where you can launch resources like EC2 instances.
Understanding Your Virtual Private Cloud
A VPC is a logically isolated section of the AWS Cloud. Think of it as your own private data center, but virtual!
- You define its IP address range (a CIDR block).
- It's completely isolated from other AWS customers' VPCs.
- You have full control over your virtual networking environment.
Setting Up Your VPC's Address Range
When you create a VPC, you assign it an IPv4 CIDR block. This is a range of private IP addresses that your resources within the VPC will use.
A common choice is a /16 CIDR block, like 10.0.0.0/16. This gives you over 65,000 private IP addresses to work with!
CIDR (Classless Inter-Domain Routing) is a standard for allocating IP addresses.
Default VPCs vs. Custom Ones
When you first create an AWS account, a Default VPC is automatically provisioned in each region. It's pre-configured to get you started quickly.
However, for most real-world applications, you'll want to create a Custom VPC. This gives you more control over your network topology, IP ranges, and security settings.
Dividing Your VPC with Subnets
A subnet is a range of IP addresses within your VPC. Think of them as smaller sections or segments of your private network.
You create subnets to organize your resources and enhance security. For example, you might have one subnet for web servers and another for databases.
Public and Private Subnets
Subnets can be either public or private:
- Public Subnet: Resources in a public subnet can access the internet directly via an Internet Gateway.
- Private Subnet: Resources in a private subnet cannot directly access the internet. They are typically used for databases or internal application servers that need more isolation.
Subnets Are AZ Specific
An important concept: each subnet you create must reside entirely within a single Availability Zone (AZ).
This means if you want your application to be highly available across multiple AZs, you'll need to create a separate subnet in each AZ you plan to use.
Guiding Traffic with Route Tables
A route table contains a set of rules, called routes, that determine where network traffic from your subnet or gateway is directed.
Each subnet in your VPC must be associated with a route table. This association dictates how traffic flows in and out of that subnet.
Understanding Routes & Gateways
Every route table has a 'local' route by default, allowing communication within the VPC.
To enable internet access for a public subnet, you add a route to an Internet Gateway (IGW). The IGW connects your VPC to the internet.
Private subnets often use a NAT Gateway or NAT instance to send outbound internet traffic while remaining unreachable from the internet.
Test Your Networking Knowledge
Let's check your understanding of VPCs and subnets.
VPC, Subnets, and Routes Recap
In this lesson, you learned about the core components of AWS networking:
- VPC: Your isolated virtual network.
- Subnets: Divisions within your VPC, residing in a single AZ, categorized as public or private.
- Route Tables: Rules that direct traffic from your subnets.
- Internet Gateway: Connects your public subnets to the internet.
Mastering these concepts is crucial for building robust and secure cloud architectures!
用 AI 导师学习 AWS for Backend Developers (EC2, S3, RDS, Lambda) — 免费
在浏览器中编写并运行真实代码,获得全天候 AI 导师的即时帮助,并在网页或应用中继续学习。
- 课程
- 12
- 课程
- 48
常见问题解答
「VPC、子网与路由表」课时是免费的吗?
是的 — 「VPC、子网与路由表」的完整文本可在网页上免费阅读。要进行交互式练习(内置代码编辑器和全天候 AI 导师)并解锁 AWS for Backend Developers (EC2, S3, RDS, Lambda) 课程的其余内容,请升级到 CoddyKit PRO。 AWS for Backend Developers (EC2, S3, RDS, Lambda) 课程共包含 4 节课。
「VPC、子网与路由表」这节课中我会学到什么?
设计并配置您在 AWS 中的隔离虚拟网络,定义子网并有效地路由流量。 你通过在浏览器中直接运行的动手代码来练习 AWS for Backend Developers (EC2, S3, RDS, Lambda),全天候 AI 导师会在你学习这节课的过程中回答你的问题。
学习 AWS for Backend Developers (EC2, S3, RDS, Lambda) 需要有经验吗?
无需任何先前经验。CoddyKit 上的 AWS for Backend Developers (EC2, S3, RDS, Lambda) 课程适合初学者到高级学习者,你可以从这里开始或从头开始,按照自己的节奏学习。 这是第 1 节课,共 4 节。
「VPC、子网与路由表」课时需要多长时间?
大多数 CoddyKit 课程大约需要 5–10 分钟。每节课都很精短且互动,所以你能稳步进步,并在网页和应用中从离开的地方继续。
我能在这节 AWS for Backend Developers (EC2, S3, RDS, Lambda) 课中编写并运行代码吗?
能。每节 AWS for Backend Developers (EC2, S3, RDS, Lambda) 课都包含内置代码编辑器,你可以在浏览器中直接编写并运行真实代码,并获得即时 AI 反馈 — 无需本地设置。
此课程中的所有课时
- VPC、子网与路由表
- 安全组与网络 ACL
- IAM 角色与策略
- VPC 端点与私有连接