AWS · Advanced Networking Specialty

网络课程笔记

Lecture 019 · 5 张幻灯片

幻灯片、双语总结及 Transcript · 图片已内嵌,可离线阅读。

原文默认收起
lecture-019.md

Lecture 19: Hands On: Create NAT Gateway

  • 课程:[NEW] AWS Certified Advanced Networking Specialty 2026
  • 视频时长:03:34
  • 来源:Udemy Lecture 24112506
  • Slide / 操作阶段数量:5
  • 画面切换:约 01:05、01:29、01:41、03:26

扫描说明

按页面英文 transcript 的 79 个时间点逐一定位并检查视频画面。静态架构图、操作步骤页、终端验证以及 VPC 控制台中的关键配置阶段分别单列。

Transcript 来自 Udemy 页面自带的英文自动字幕,没有使用 ASR。下面保留页面原文,包括其中的语法或识别错误。

1. Demo Architecture and NAT Placement

时间范围:00:00–01:05

NAT Gateway demo architecture

总结 / Summary

中文

现有架构包含公有子网(Public Subnet)、私有子网(Private Subnet)和两台 EC2 实例。要让私有 EC2-B 获得出站互联网访问,需要在公有子网创建 NAT 网关(NAT Gateway),为其绑定弹性 IP(Elastic IP, EIP),再把私有子网路由表(Route Table)的默认路由指向该 NAT 网关。生产环境更适合为 NAT 使用专用子网(Dedicated Subnet)。

English

The existing design contains a public subnet, a private subnet, and two EC2 instances. To give private EC2-B outbound Internet access, create a NAT Gateway in the public subnet, associate an Elastic IP (EIP), and point the private subnet's default route to that gateway. A dedicated NAT subnet is preferable in production.

Transcript

00:00 Hello and welcome to this lecture.

00:02 In this lecture, we are going to see

00:05 how to set up NAT Gateway.

00:06 So, if you remember earlier,

00:08 what we had done was created

00:10 this Public Subnet, Private Subnet

00:13 and we launched two EC2 Instances.

00:14 Then we logged into EC2 instance A and from there,

00:17 we went to EC2 B and now from B we tried to reach

00:21 to google.com or amazon.com and we could not

00:24 because, of course,

00:25 there is no on-board internet connectivity.

00:27 So as you know, the solution is NAT Gateway.

00:30 So in this exercise,

00:31 we are going to create

00:32 this Nat Gateway in our existing Public Subnet.

00:34 Ideal would be to have a NAT Gateway

00:36 into its own dedicated Subnet

00:39 but for simplicity, let's create it

00:42 into existing Public Subnet.

00:44 And once we create the NAT,

00:45 we will modify the route table for this Private Subnet

00:49 and add a route. Something like this.

00:52 Now thing to remember is that a NAT Gateway

00:55 should also be having the Elastic IP.

00:57 So first we will locate an Elastic IP

01:00 and while launching NAT Gateway,

01:01 we need to then associate the same Elastic IP.

2. Exercise Plan

时间范围:01:05–01:29

NAT Gateway exercise steps

总结 / Summary

中文

实验分为三个核心步骤:为 NAT 网关(NAT Gateway)分配弹性 IP(Elastic IP)、在公有子网中创建 NAT 网关并等待其状态变为 Available,随后修改私有路由表(Private Route Table)。NAT 网关创建和就绪通常需要几分钟。

English

The exercise has three core steps: allocate an Elastic IP for the NAT Gateway, create the gateway in the public subnet and wait until it becomes Available, then update the private route table. Provisioning and readiness can take several minutes.

Transcript

01:05 So step I have listed here,

01:07 we'll be creating the NAT Gateway.

01:09 We'll get one Elastic IP for NAT Gateway.

01:11 Now it takes typically a four to five minutes

01:14 for NAT Gateway to be completely abandoning.

01:16 So will have to wait and once NAT is completely up,

01:21 we will modify the private route table, as I just said.

01:25 So just let's verify what setup.

3. Baseline – Private Instance Has No Internet

时间范围:01:29–01:41

Private EC2 instance ping failure before NAT

总结 / Summary

中文

配置前先建立基线:从私有 EC2 实例(Private EC2 Instance)执行对公网域名的 ping 失败。这验证了当前私有子网没有默认出站路径,后续成功结果才能明确归因于 NAT 网关和路由修改。

English

The demo first establishes a baseline by pinging a public domain from the private EC2 instance. The failure confirms that the private subnet currently has no default outbound path, making the later success attributable to the NAT and routing changes.

Transcript

01:28 So this is my private EC2 Instance

01:31 and from here, if I do ping google.com or amazon.com,

01:35 I cannot do because there is no NAT.

01:38 So let's go back to our console

4. Create the NAT Gateway and Update the Private Route

时间范围:01:41–03:26

NAT Gateway available after route table configuration

总结 / Summary

中文

在 VPC 控制台(VPC Console)创建 NAT 网关(NAT Gateway),选择现有公有子网并现场分配弹性 IP(Elastic IP)。随后编辑私有路由表(Private Route Table),把互联网目标 0.0.0.0/0 的下一跳设为 NAT 网关。NAT 网关本身不关联安全组(Security Group);配置完成后只需等待状态从 Pending 变为 Available。

English

In the VPC Console, the instructor creates a NAT Gateway in the existing public subnet and allocates an Elastic IP. The private route table is then edited so 0.0.0.0/0 targets the NAT Gateway. NAT Gateways do not have Security Groups; after configuration, the remaining step is to wait for the state to change from Pending to Available.

Transcript

01:41 and let's go to our VPC console.

01:44 That's where the NAT Gateway decides.

01:48 And, now let's try to create an NAT Gateway.

01:53 We will give it names, say my VPC,

01:57 NAT Gateway.

01:59 The Subnet, we want to have it in a Public Subnet,

02:02 and we don't have Elastic IP as of now.

02:04 So you can allocate one Elastic IP for this NAT Gateway.

02:08 So that has been done and create a NAT Gateway.

02:11 So it's very simple to create a NAT Gateway, just the steps

02:15 and it will get created.

02:19 As soon as you create a NAT Gateway,

02:22 you would have to modify the route tables, right?

02:25 So let's do that.

02:27 Let's go to the route table and as you know,

02:30 we need to modify our private route table.

02:33 So I'm just going here and editing this route

02:36 and seeing if the traffic from this needs to go

02:40 to the internet, use NAT Gateway.

02:43 So it populates this NAT Gateway ID

02:47 and that's it.

02:48 You save the routes.

02:51 So, logically speaking at this moment,

02:54 we are done with the NAT Gateway settings

02:56 and the route table modifications.

02:59 There are no security groups to the NAT Gateway

03:01 as I explained in the last lecture.

03:03 So there are no more settings to be done.

03:06 So let's give it a minute or so for NAT Gateway

03:09 to be completely abandoning.

03:10 We can verify the status here as well.

03:13 The status is still pending.

03:15 So I'm pausing this video for maybe a couple of minutes.

03:19 Okay.

03:20 My NAT Gateway is available now

03:22 that means if I go to my EC2 Instances and try to ping,

5. Verification – Outbound Connectivity Works

时间范围:03:26–03:34

Private EC2 instance ping success through NAT

总结 / Summary

中文

NAT 网关状态变为 Available 后,私有 EC2-B 对公网域名的 ping 成功。这验证了完整出站链路:私有实例 → 私有路由表(Private Route Table)→ NAT 网关(NAT Gateway)→ 互联网网关(Internet Gateway, IGW)→ 互联网。

English

After the NAT Gateway becomes Available, the private EC2-B instance successfully pings a public domain. This validates the complete outbound path: private instance → private route table → NAT Gateway → Internet Gateway (IGW) → Internet.

Transcript

03:25 I should be able to and that's what is happening.

03:28 So that means our NAT is working perfectly fine

03:30 and that's it for this lecture.

整讲总结 / Overall Summary

中文

本讲完成了 NAT 网关(NAT Gateway)的实际部署:先确认私有 EC2 无法访问互联网,再在公有子网中创建带弹性 IP(Elastic IP)的 NAT 网关,把私有路由表(Private Route Table)的 0.0.0.0/0 指向它,并等待资源可用。最终 ping 成功证明私有实例能够通过 NAT 和互联网网关(Internet Gateway)发起出站通信,同时仍不需要公有 IP。

English

This lecture completes the practical NAT Gateway deployment: first confirming that the private EC2 instance cannot reach the Internet, then creating a NAT Gateway with an Elastic IP in the public subnet, pointing the private route table's 0.0.0.0/0 route to it, and waiting for the resource to become available. The successful ping proves that the private instance can initiate outbound communication through NAT and the Internet Gateway without requiring a public IP.

返回顶部 ↑