AWS · Advanced Networking Specialty

网络课程笔记

Lecture 134 · 20 张幻灯片

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

原文默认收起
lecture-134.md

Lecture 134: Private VIF routing policies and BGP communities

  • 课程:[NEW] AWS Certified Advanced Networking Specialty 2026
  • 视频时长:11:01
  • 来源:Udemy Lecture 27898710
  • Slide 数量:20
  • 画面切换:00:33、00:37、01:08、02:11、03:20、03:36、04:44、05:29、05:55、06:25、06:41、07:07、08:18、08:33、08:51、08:52、08:55、09:04、09:23

扫描说明

逐条检查了 Udemy 页面中的 247 条 Transcript cue,并扫描了全长约 11:01 的视频。首次扫描发现上一讲残留的 Up next 遮罩后,立即废弃全部受影响帧,关闭遮罩并从第一个 cue 完整重扫。依据 Private VIF 路由规则渐显、Home/Local Region、Longest Prefix、AS_PATH、Local Preference BGP Community 及 Active/Passive 动画,共划分为 20 个小节。20 张正式截图均在视频播放、播放器控件隐藏、Transcript 与课程侧栏关闭后按真实媒体边界截取,并逐张确认无黑边、无右侧或底部裁切、无播放按钮或覆盖层,统一输出为 1364×770。

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

1. Private VIF 路由策略与 BGP 社区

时间范围:00:00–00:33

Private VIF Routing Policies and BGP communities title slide

总结 / Summary

中文

本讲介绍私有虚拟接口(Private VIF)的路由选择规则,以及边界网关协议社区(BGP Communities)如何影响多接口路径。

English

This lecture introduces routing decisions for a Private VIF and how BGP communities influence path selection across multiple interfaces.

Transcript

00:00 Hello and welcome to this lecture.

00:02 Now, let's understand the Routing Policies

00:04 and BGP communities for the private VIFs.

00:07 So these policies and communities work differently,

00:10 when it comes to the private VIF.

00:11 Now in case of public VIF so that it influences

00:14 the routing decision,

00:16 and the scope of the route advertisement.

00:19 But in case of private VIF, both the routing policies

00:22 as well as BGP communities

00:23 are used to influence the routing decision.

00:26 So there is no scope advertisement

00:29 using the BGP communities.

00:31 So let's look into that.

2. Private VIF 路由策略概览

时间范围:00:33–00:37

Private VIF Routing Policies overview

总结 / Summary

中文

AWS 在多条可达路径之间按确定的路由策略(Routing Policy)选择最佳路径。

English

AWS applies a deterministic routing policy to select the best path among multiple reachable paths.

Transcript

00:33 So now let's look at the Private VIF Routing Policies.

00:36 Now, very first thing you need

3. 最长前缀匹配优先

时间范围:00:37–01:08

AWS evaluates longest prefix match first

总结 / Summary

中文

AWS 首先执行最长前缀匹配(Longest Prefix Match);更具体的网络前缀优先于较宽泛的前缀。

English

AWS evaluates longest prefix match first, so a more specific network prefix wins over a broader prefix.

Transcript

00:37 to understand is that in case of private VIF,

00:40 the longest prefix match is preferred.

00:43 Which means that if there are multiple private VIFs

00:46 and multiple Direct Connect connections

00:48 to reach to the target network,

00:50 depending on the routes on those VIF which are published

00:53 by the customer side of the network,

00:56 if the

00:57 target

00:58 IP matches the longest prefix,

01:00 that route is preferred over the other routes.

01:03 And we'll see that by example shortly.

01:05 Now, if this prefix is same,

4. 相同前缀按本地区域距离选择

时间范围:01:08–02:11

Equal prefixes use distance from local Region to Direct Connect location

总结 / Summary

中文

当前缀长度相同时,AWS 依据本地区域(Local Region)到 Direct Connect(DX)位置的距离选择虚拟接口(VIF)或传输虚拟接口(Transit VIF),通常优先本地路径。

English

When prefix lengths are equal, AWS uses the distance from the local Region to the Direct Connect location to choose the VIF or transit VIF, normally preferring the local path.

Transcript

01:08 then which route is chosen?

01:09 Now, let's take an example.

01:11 Suppose you have

01:12 two Direct Connect location of Frankfurt and Ireland, right?

01:16 And then your VPC decides in the Frankfurt region.

01:19 Now, in order to reach to the destination

01:21 which is our customer data center,

01:24 both these Direct Connect locations

01:25 has a Direct Connect connectivity to our customer location.

01:28 Now, which route it would take to reach to the destination.

01:33 Both routes are there

01:34 and there are two private virtual interfaces.

01:37 Now, in this case AWS uses the minimum distance

01:41 from the AWS region and the Direct Connect location.

01:44 Now, in this case it would be Frankfurt, right?

01:47 Because you are sending the traffic from Frankfurt region

01:51 to the on-premise data center.

01:53 And again,

01:54 we will explain that through the architecture shortly.

01:57 Now, in the case where,

02:00 you want to steal route the traffic through Ireland,

02:03 Direct Connect connection,

02:04 then BGP communities are used.

02:07 Now you can see here that you can also use BGP communities,

5. 用 Local Preference 社区修改默认行为

时间范围:02:11–03:20

Local preference BGP communities modify routing behavior

总结 / Summary

中文

本地优先级边界网关协议社区(Local Preference BGP Communities)可覆盖默认距离行为;优先顺序为 7224:7300、7224:7200、7224:7100。

English

Local-preference BGP communities can override the default distance behavior, with 7224:7300 preferred over 7224:7200 and then 7224:7100.

Transcript

02:11 but in this case they're used to influence

02:15 which path AWS takes to send

02:17 the traffic to the on-premise network.

02:19 And there are three BGP communities that you can see here.

02:22 7224:7300

02:24 takes the highest precedence

02:26 or 7200

02:28 and 7100

02:30 and we'll see shortly how to implement that.

02:33 Now we have seen three cases here,

02:35 One, the longest prefix match

02:37 that route is taken as a first preference,

02:41 then if the longest prefix matches are same,

02:44 for multiple connections then the shortest distance

02:47 is chosen from the originating AWS region

02:49 to the Direct Connect location.

02:51 Now, if you want to change this equation,

02:54 then you can obviously use the BGP community tags.

02:58 But if you're not using the BGP community tags and

03:02 there is only one region

03:04 and one Direct Connect location,

03:06 so say you are using the Frankfurt region

03:09 and within the Frankfurt region,

03:11 you are using the multiple Direct Connect connections,

03:14 then other choice is made.

03:16 Now, in that case you can use again the AS_PATH attribute.

6. 同一区域多 VIF 使用 AS_PATH

时间范围:03:20–03:36

Multiple VIFs in one Region use AS PATH to prioritize traffic

总结 / Summary

中文

同一本地区域内存在多条虚拟接口(VIF)时,可通过自治系统路径属性(AS_PATH)预置来区分优先路径。

English

When multiple VIFs exist in the same local Region, AS_PATH prepending can distinguish the preferred path.

Transcript

03:20 So as you know the shortest AS_PATH is preferred

03:23 over the longer AS_PATH,

03:25 so you can again influence your routing decision

03:29 by setting up the appropriate AS_PATH.

03:32 And we will understand that now with the architecture.

7. Home/Local Region 示例拓扑

时间范围:03:36–04:44

Private VIF routing policies Home Local Region topology

总结 / Summary

中文

示例中三条 Private VIF 从 Direct Connect Gateway(DXGW)连接到 US-East 和 US-West,企业网络 172.31.0.0/16 从各接口被通告。

English

The example has three Private VIFs from a Direct Connect Gateway to US-East and US-West, each advertising the corporate prefix 172.31.0.0/16.

Transcript

03:36 So let's look at this architecture.

03:38 So on the left side you have AWS region US East

03:41 and you have DPC

03:43 and on the right side you have corporate data center.

03:45 Now for high availability you have multiple routers

03:48 and then you have chosen

03:49 to have multiple Direct Connect locations as well.

03:51 So that if one location fails for some reason,

03:54 then you can dock the traffic

03:56 through another AWS Direct Connect location.

03:59 Now again, for high availability within the same region

04:01 you have multiple private VIF connections

04:05 and in another region you just have one connection.

04:07 So overall, all these VIF terminate

04:10 on the Direct Connect Gateway

04:11 and this Direct Connect Gateway is connected

04:13 to your VPC in the US East region.

04:16 Now,

04:17 if this is architecture

04:19 and then you want to understand which path AWS will take

04:24 to send the traffic from AWS to corporate data center,

04:27 it will depend on a lot of factors.

04:30 Now that would depend on what kind of prefixes you advertise

04:35 or what this BGP session from your routers.

04:38 Now let's assume that you are sending the same prefixes

04:42 from both these routers and you can see here

04:44 the prefix is same VIFs last 16 CIDR.

8. 本地区域优先与距离决策

时间范围:04:44–05:29

Home Region routing rules callout

总结 / Summary

中文

所有 VIF 通告同一前缀时,源自 US-East 的流量使用本地 VIF A 或 B;若二者等价,则继续以网络成本(Network Cost)选择。

English

When all VIFs advertise the same prefix, US-East traffic uses local VIF A or B; if they remain equal, network cost breaks the tie.

Transcript

04:44 Now, in this case how AWS will decide

04:51 the traffic needs to be sent through which VIF.

04:55 Now, if you can see here AWS makes a choice

04:58 depending on the distance from AWS region

05:02 to the Direct Connect location.

05:04 Now, because VPC is in the US East region,

05:07 it will choose US East as a Direct Connect location

05:11 to send the traffic through.

05:12 And in that case,

05:14 it would be sent either through VIF A or VIF B.

05:18 Now, which one of that we can again control

05:21 either VIF A or VIF B

05:23 but understand that it uses the home

05:26 or a local region as the first choice

9. 较低网络成本成为决胜条件

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

Lower network cost takes precedence among equal local VIFs

总结 / Summary

中文

在前缀和区域距离相同后,较低的网络成本(Network Cost)优先,因此一条本地 VIF 会成为首选路径。

English

After prefix and Region distance are equal, lower network cost takes precedence and selects one local VIF as the preferred path.

Transcript

05:29 when the prefixes are advertised are the same length

05:33 from multiple connections.

05:35 So home region takes the precedence.

05:37 That's what I'm trying to show here.

05:40 Now let's try to understand what if you want

05:43 to influence this decision

05:45 and instead you want to send this traffic

05:48 through a US west region.

05:50 Now, with this architecture you can't

05:52 because prefixes are same but in that case,

10. Longest Prefix 示例

时间范围:05:55–06:25

Private VIF routing policies Longest Prefix topology

总结 / Summary

中文

将 US-West 通告改为 172.31.0.0/24 后,该更具体前缀(More Specific Prefix)优先于 US-East 的 172.31.0.0/16。

English

Changing the US-West advertisement to 172.31.0.0/24 makes it more specific than the US-East 172.31.0.0/16 route.

Transcript

05:55 you can have the longest prefix advertised

05:59 over the other Direct Connect location

06:01 and through that private VIF.

06:03 Now you can see here,

06:05 we are advertising class 24 as a prefix

06:07 and here it's last 16.

06:10 So if from your VPC you are sending traffic

06:13 to say IP address 172.31.0.50

06:19 now that falls within this range

06:21 and in that case VIF C will be selected as your

11. 最长前缀覆盖区域距离

时间范围:06:25–06:41

Longest prefix routing outcome callout

总结 / Summary

中文

目的地址属于 172.31.0.0/24 时使用 VIF C,即使它位于远端区域;其他 172.31.0.0/16 流量仍使用 VIF A 或 B。

English

Traffic for 172.31.0.0/24 uses VIF C even though it is remote, while the remaining 172.31.0.0/16 traffic continues to use VIF A or B.

Transcript

06:25 traffic route, right?

06:27 And that's what has been explained here. Okay.

06:29 Now, as I said,

06:31 if there is just one Direct Connect location,

06:35 so let's take that example and then decide

06:38 whether VIF A will be selected or VIF B will be selected.

12. AS_PATH 示例拓扑

时间范围:06:41–07:07

Private VIF routing policies AS PATH topology

总结 / Summary

中文

当三条 VIF 通告相同前缀时,可通过自治系统路径(AS_PATH)的长度控制同一区域内的选择。

English

When all three VIFs advertise the same prefix, AS_PATH length can control selection among paths in the same Region.

Transcript

06:41 So again, back to the first scenario

06:44 where the same prefixes are sent

06:46 and we already know that the traffic will be routed

06:49 through VIF A or VIF B because US is the local region.

06:53 In that case you can influence the decision

06:55 between VIF A and VIF B

06:57 using AS_PATH attributes of the BGP, right?

07:01 So the shorter AS_PATH that path will be preferred

07:05 over the longer AS_PATH.

13. AS_PATH 仅在同等位置层级内生效

时间范围:07:07–08:18

AS PATH routing policy result callout

总结 / Summary

中文

AWS 先考虑本地区域,再比较同区域路径的自治系统路径(AS_PATH)。因此即使 VIF C 的 AS_PATH 较短,US-East 仍优先本地 VIF;在 VIF A 与 B 之间则选择 AS_PATH 更短者。

English

AWS considers the local Region before comparing AS_PATH within that Region. Thus US-East still prefers a local VIF over remote VIF C, while the shorter AS_PATH wins between VIF A and B.

Transcript

07:07 So in this case if say VIF A is having

07:10 the AS_PATH attribute as 65001 three times

07:14 and VIF B has an AS_PATH of 65001 two times

07:18 and VIF C has same attribute,

07:21 but the AS_PATH is shortest

07:22 which is just once 65001.

07:26 Now, just looking at this,

07:28 you might think that private VIF C should be selected,

07:32 but understand that the same prefixes

07:34 are being advertised on all these three VIFs.

07:37 So first preference goes to the local region,

07:40 so that's where the US East will be selected,

07:43 but within US east one you have two VIFs

07:46 out of these the AS_PATH will take the preference.

07:50 So shorter AS_PATH will take the higher preference

07:52 in this case VIF B has just

07:56 two hops

07:57 VIF A has three hops.

07:58 So private VIF B will be taking the precedence here.

08:03 So that's interesting thing.

08:05 Now, in the case where you can't just control the prefixes

08:09 maybe all prefixes are same,

08:11 but still you want to route the traffic

08:13 through private VIF C then what do you do, right?

08:16 Otherwise it's not possible here.

14. Local Preference BGP Community 示例

时间范围:08:18–08:33

Private VIF Local Preference BGP Community topology

总结 / Summary

中文

客户可给不同 Private VIF 附加本地优先级边界网关协议社区(Local Preference BGP Communities),直接表达低、中、高偏好。

English

Customers can attach local-preference BGP communities to different Private VIFs to express low, medium, and high preference directly.

Transcript

08:18 So in that case, you can use BGP communities.

08:21 As I said, there are three BGP communities

08:23 7224, 7100,

08:26 7200

08:27 and 7300.

08:28 7300 takes the highest precedence and in this case,

15. Local Preference 在 AS_PATH 之前评估

时间范围:08:33–08:51

Local preference communities evaluated before AS PATH

总结 / Summary

中文

7224:7100、7224:7200、7224:7300 分别代表低、中、高本地优先级(Local Preference),并且其评估顺序早于 AS_PATH。

English

7224:7100, 7224:7200, and 7224:7300 represent low, medium, and high local preference, and are evaluated before AS_PATH.

Transcript

08:33 whatever the BGP community you set

08:36 as the 7300,

08:38 that particular VIF will be used for the connection

08:42 or the traffic from AWS to on-premise data center.

08:45 So in this case, obviously it would be private VIF C.

16. 第一优先:VIF C

时间范围:08:51–08:52

Local preference ranking stage one VIF C

总结 / Summary

中文

VIF C 携带 7224:7300,因此获得最高本地优先级(Local Preference)并排在第一。

English

VIF C carries 7224:7300, so it receives the highest local preference and ranks first.

Transcript

08:51 So this is first preference,

17. 第一路径向远端 VIF C

时间范围:08:52–08:55

Local preference path selection points to VIF C

总结 / Summary

中文

路径动画显示路由选择被高优先级社区(High-Preference Community)引向远端 VIF C,覆盖默认的本地区域偏好。

English

The path animation shows the high-preference community steering route selection to remote VIF C, overriding the default local-Region preference.

Transcript

08:52 then VIF A will get the second preference

18. 完整优先顺序:C、A、B

时间范围:08:55–09:04

Local preference complete ranking C A B

总结 / Summary

中文

完整排序为 VIF C(7224:7300)第一、VIF A(7224:7200)第二、VIF B(7224:7100)第三。

English

The complete ranking is VIF C with 7224:7300 first, VIF A with 7224:7200 second, and VIF B with 7224:7100 third.

Transcript

08:55 and B will get the third preference.

08:58 So this is how the routing works.

09:00 And with that you can also achieve

09:02 the Active/Passive kind of traffic,

19. Local Preference 用于 Active/Passive

时间范围:09:04–09:23

Local Preference BGP communities for Active Passive traffic topology

总结 / Summary

中文

本地优先级社区(Local Preference Communities)可构建主备(Active/Passive)流量模式,让一条 VIF 正常承载流量,另一条仅在故障时接管。

English

Local-preference communities can implement an active-passive pattern in which one VIF carries normal traffic and another takes over only on failure.

Transcript

09:04 because you can set the difference

09:06 BGP communities on these VIFs.

09:09 So here, if you are using A as a primary,

09:12 then set the 7300 as you are a BGP community here.

09:16 If VIF A connection is down for some reason,

09:19 then VIF B connection will be used in that case.

20. Active/Passive 配置结果

时间范围:09:23–11:01

Active Passive routing result using 7224 7300 and 7224 7100

总结 / Summary

中文

VIF A 使用 7224:7300 作为主路径,VIF B 使用 7224:7100 作为低优先级备用路径;当 VIF A 不可用时,流量自动切换到 VIF B。

English

VIF A uses 7224:7300 as the primary path and VIF B uses 7224:7100 as the lower-preference backup; traffic shifts to VIF B if VIF A fails.

Transcript

09:23 So this is how the BGP communities

09:26 will affect

09:27 the route

09:29 selection here.

09:31 So with that I think we just covered about

09:34 how the routing works in case of private VIF.

09:36 Now, this is a little simpler than the public VIF

09:39 as you can see,

09:41 obviously the very first option is to have

09:44 the longest prefix that path would take precedence,

09:47 but then if all the VIFs are advertising the same prefix,

09:51 then the shortest distance from the AWS region

09:54 to the Direct Connect location that will be selected

09:58 and in case there are multiple VIFs there,

10:00 in that case you can use the AS_PATH attribute

10:03 to make a choice of one VIF over the other

10:07 and if nothing else,

10:08 then you can use the BGP communities to,

10:11 you know, set your preferences.

10:13 So I think that's it about

10:14 the private VIF

10:16 and the routing policies.

10:19 Now I know that this is again, overwhelming thing

10:21 there are so many things we discussed,

10:23 there are so many permutations and combinations

10:26 and I don't think really that you need

10:29 to really get to know at that depth for your exam,

10:32 but as you go into the field and implement

10:35 and work on the Direct Connect,

10:36 then probably you can set your routing policies

10:39 with clear understanding what you are doing

10:41 and you know exactly how the traffic will flow

10:45 in case there are multiple Direct Connect connections.

10:48 So I hope that is helpful to you

10:50 and with that, now we will pivot toward

10:53 other section of the Direct Connect

10:55 and that's it about the routing

10:56 and the BGP communities as of now.

10:59 So thanks for watching.

整讲总结 / Overall Summary

中文

本讲总结 Private VIF 的路径选择顺序:首先执行最长前缀匹配(Longest Prefix Match);前缀相同时优先本地区域(Local Region)和更低网络成本(Network Cost);同一区域的多条 VIF 可通过自治系统路径(AS_PATH)区分。若需要显式覆盖默认行为,可使用本地优先级边界网关协议社区(Local Preference BGP Communities):7224:7300 为高、7224:7200 为中、7224:7100 为低,且在 AS_PATH 之前评估。该机制既能做流量工程(Traffic Engineering),也能实现主备(Active/Passive)切换。

English

This lecture summarizes Private VIF path selection: longest prefix match is evaluated first; equal prefixes favor the local Region and lower network cost; and AS_PATH can distinguish multiple VIFs within the same Region. To override the defaults explicitly, local-preference BGP communities use 7224:7300 for high, 7224:7200 for medium, and 7224:7100 for low preference, and are evaluated before AS_PATH. This mechanism supports both traffic engineering and active-passive failover.

返回顶部 ↑