WOLF-LAB沃尔夫网络实验室中国网络精英的发源地!
24小时咨询热线:173-1636-2402

新闻资讯

News

您当前位置: 新闻资讯 > 华为技术 > 详情

汇总对于MPLS产生的影响-HCIE Datacom技术文档分享

发布日期:2022-05-06 浏览次数:1874 来源:崔志鹏

汇总对于MPLS产生的影响-HCIE Datacom实验技术文档分享

WOLFLAB HCIE培训讲师:崔志鹏 CCIE#64969 HCIE#15621

HCIE Datacom础课视频领取联系WOLFLAB网站客服

HCIE Datacom.png

环境说明:

@AR1/AR2/AR3/AR4/AR5跑rip;

@五台设备配置LDP;

@AR3上针对5.5.5.5做汇总;

@观察AR1以自己loop0接口地址作为源访问AR5的loop0接口的现象;

HCIE Datacom.png

[AR1]dis mpls lsp

-------------------------------------------------------------------------------

                 LSP Information: LDP LSP

-------------------------------------------------------------------------------

FEC                In/Out Label  In/Out IF                      Vrf Name      

2.2.2.2/32         NULL/3        -/GE0/0/0                                    

2.2.2.2/32         1024/3        -/GE0/0/0                                    

1.1.1.1/32         3/NULL        -/-                                           

3.3.3.3/32         NULL/1025     -/GE0/0/0                                    

3.3.3.3/32         1025/1025     -/GE0/0/0                                    

4.4.4.4/32         NULL/1026     -/GE0/0/0                                    

4.4.4.4/32         1026/1026     -/GE0/0/0                                    

5.5.5.5/32         NULL/1027     -/GE0/0/0                                    

5.5.5.5/32         1027/1027     -/GE0/0/0  

此时R1访问R5肯定是有标签可用的

 

R3上做汇总:

R3:

int g 0/0/1

rip summary-address 5.5.0.0 255.255.0.0

此时R2和R1就不会有5.5.5.5/32了,只能看到汇总路由了,R3只能看到明细看不到汇总,这条命令的意思是只将汇总路由通告出去给R2。

 

此时分析R1访问R5数据包:

@因为做了汇总,华为默认标签分配的方式还是有序的,默认的触发条件还是host,所以在R1和R2上就没有标签可用了;

[AR1]dis mpls lsp

-------------------------------------------------------------------------------

                 LSP Information: LDP LSP

-------------------------------------------------------------------------------

FEC                In/Out Label  In/Out IF                      Vrf Name      

2.2.2.2/32         NULL/3        -/GE0/0/0                                    

2.2.2.2/32         1024/3        -/GE0/0/0                                    

1.1.1.1/32         3/NULL        -/-                                          

3.3.3.3/32         NULL/1025     -/GE0/0/0                                    

3.3.3.3/32         1025/1025     -/GE0/0/0                                    

4.4.4.4/32         NULL/1026     -/GE0/0/0                                    

4.4.4.4/32         1026/1026     -/GE0/0/0 

@此时R1访问R5还是可以通的,但是R1到R3的流量走的是IP,R3到R5的流量走的是标签,回包都走标签;
 

怎么解决?

@R3上写一条指向null0的防环路由ip route-static 5.5.0.0 16 NULL 0

@然后再R3上将触发策略改成all;

@R1/R2/R3/R4/R5都要改成all,保证R1和R2收到IP的数据包可以走标签转发;

改之前:

[AR3]dis mpls lsp

-------------------------------------------------------------------------------

                 LSP Information: LDP LSP

-------------------------------------------------------------------------------

FEC                In/Out Label  In/Out IF                      Vrf Name      

1.1.1.1/32         NULL/1024     -/GE0/0/1                                    

1.1.1.1/32         1024/1024     -/GE0/0/1                                    

2.2.2.2/32         NULL/3        -/GE0/0/1                                    

2.2.2.2/32         1025/3        -/GE0/0/1                                    

3.3.3.3/32         3/NULL        -/-                                          

4.4.4.4/32         NULL/3        -/GE0/0/0                                    

4.4.4.4/32         1026/3        -/GE0/0/0                                    

5.5.5.5/32         NULL/1027     -/GE0/0/0                                     

5.5.5.5/32         1027/1027     -/GE0/0/0 

 

改之后:

[AR3]dis mpls lsp

-------------------------------------------------------------------------------

                 LSP Information: LDP LSP

-------------------------------------------------------------------------------

FEC                In/Out Label  In/Out IF                      Vrf Name      

1.1.1.1/32         NULL/1024     -/GE0/0/1                                    

1.1.1.1/32         1024/1024     -/GE0/0/1                                     

2.2.2.2/32         NULL/3        -/GE0/0/1                                    

2.2.2.2/32         1025/3        -/GE0/0/1                                    

3.3.3.3/32         3/NULL        -/-                                          

4.4.4.4/32         NULL/3        -/GE0/0/0                                    

4.4.4.4/32         1026/3        -/GE0/0/0                                    

5.5.5.5/32         NULL/1027     -/GE0/0/0                                    

5.5.5.5/32         1027/1027     -/GE0/0/0                                    

1.1.23.0/24        3/NULL        -/-                                          

1.1.34.0/24        3/NULL        -/-                                          

5.5.0.0/16         1028/NULL     -/-   

 

问题:为什么R3给5.5.0.0/16这条路由分配的标签不是3,因为5.5.0.0/16是非直连路由,engress代理;

 

此时查看R1和R2的LSP:根据触发策略,因为R1和R2还是host,只会为非/32路由作为transit创建LSP,所以R1访问R5的时候,R1到R3这段还是没有标签可以用;

[AR1]dis mpls lsp

-------------------------------------------------------------------------------

                 LSP Information: LDP LSP

-------------------------------------------------------------------------------

FEC                In/Out Label  In/Out IF                      Vrf Name      

2.2.2.2/32         NULL/3        -/GE0/0/0                                    

2.2.2.2/32         1024/3        -/GE0/0/0                                    

1.1.1.1/32         3/NULL        -/-                                          

3.3.3.3/32         NULL/1025     -/GE0/0/0                                    

3.3.3.3/32         1025/1025     -/GE0/0/0                                     

4.4.4.4/32         NULL/1026     -/GE0/0/0                                    

4.4.4.4/32         1026/1026     -/GE0/0/0                                    

1.1.34.0/24        1028/1028     -/GE0/0/0                                     

5.5.0.0/16         1029/1029     -/GE0/0/0  

 

[AR2]dis mpls lsp

-------------------------------------------------------------------------------

                 LSP Information: LDP LSP

-------------------------------------------------------------------------------

FEC                In/Out Label  In/Out IF                      Vrf Name      

2.2.2.2/32         3/NULL        -/-                                          

1.1.1.1/32         NULL/3        -/GE0/0/0                                     

1.1.1.1/32         1024/3        -/GE0/0/0                                    

3.3.3.3/32         NULL/3        -/GE0/0/1                                    

3.3.3.3/32         1025/3        -/GE0/0/1                                    

4.4.4.4/32         NULL/1026     -/GE0/0/1                                    

4.4.4.4/32         1026/1026     -/GE0/0/1                                    

1.1.34.0/24        1028/3        -/GE0/0/1                                    

5.5.0.0/16         1029/1028     -/GE0/0/1 

 

所以需要将R1/R2/R3/R4/R5都要改成all,保证R1和R2收到IP的数据包可以走标签转发;

[AR1]dis mpls lsp

-------------------------------------------------------------------------------

                 LSP Information: LDP LSP

-------------------------------------------------------------------------------

FEC                In/Out Label  In/Out IF                      Vrf Name      

2.2.2.2/32         NULL/3        -/GE0/0/0                                     

2.2.2.2/32         1024/3        -/GE0/0/0                                    

1.1.1.1/32         3/NULL        -/-                                          

3.3.3.3/32         NULL/1025     -/GE0/0/0                                     

3.3.3.3/32         1025/1025     -/GE0/0/0                                    

4.4.4.4/32         NULL/1026     -/GE0/0/0                                    

4.4.4.4/32         1026/1026     -/GE0/0/0                                    

1.1.34.0/24        1028/1028     -/GE0/0/0                                    

5.5.0.0/16         1029/1029     -/GE0/0/0                                    

1.1.12.0/24        3/NULL        -/-                                          

1.1.34.0/24        NULL/1028     -/GE0/0/0                                    

5.5.0.0/16         NULL/1029     -/GE0/0/0                                    

1.1.23.0/24        NULL/3        -/GE0/0/0                                    

1.1.23.0/24        1030/3        -/GE0/0/0                                    

1.1.45.0/24        NULL/1030     -/GE0/0/0                                    

1.1.45.0/24        1031/1030     -/GE0/0/0                                    

[AR2]dis mpls lsp

-------------------------------------------------------------------------------

                 LSP Information: LDP LSP

-------------------------------------------------------------------------------

FEC                In/Out Label  In/Out IF                      Vrf Name      

2.2.2.2/32         3/NULL        -/-                                          

1.1.1.1/32         NULL/3        -/GE0/0/0                                    

1.1.1.1/32         1024/3        -/GE0/0/0                                     

3.3.3.3/32         NULL/3        -/GE0/0/1                                    

3.3.3.3/32         1025/3        -/GE0/0/1                                    

4.4.4.4/32         NULL/1026     -/GE0/0/1                                    

4.4.4.4/32         1026/1026     -/GE0/0/1                                    

1.1.34.0/24        1028/3        -/GE0/0/1                                    

5.5.0.0/16         1029/1028     -/GE0/0/1                                     

1.1.12.0/24        3/NULL        -/-                                          

1.1.23.0/24        3/NULL        -/-                                          

1.1.34.0/24        NULL/3        -/GE0/0/1                                     

5.5.0.0/16         NULL/1028     -/GE0/0/1                                    

1.1.45.0/24        NULL/1030     -/GE0/0/1                                    

1.1.45.0/24        1030/1030     -/GE0/0/1 

[AR3]dis mpls lsp

-------------------------------------------------------------------------------

                 LSP Information: LDP LSP

-------------------------------------------------------------------------------

FEC                In/Out Label  In/Out IF                      Vrf Name      

1.1.1.1/32         NULL/1024     -/GE0/0/1                                    

1.1.1.1/32         1024/1024     -/GE0/0/1                                    

2.2.2.2/32         NULL/3        -/GE0/0/1                                    

2.2.2.2/32         1025/3        -/GE0/0/1                                    

3.3.3.3/32         3/NULL        -/-                                          

4.4.4.4/32         NULL/3        -/GE0/0/0                                    

4.4.4.4/32         1026/3        -/GE0/0/0                                    

5.5.5.5/32         NULL/1027     -/GE0/0/0                                    

5.5.5.5/32         1027/1027     -/GE0/0/0                                    

1.1.23.0/24        3/NULL        -/-                                          

1.1.34.0/24        3/NULL        -/-                                          

5.5.0.0/16         1028/NULL     -/-                                          

1.1.12.0/24        NULL/3        -/GE0/0/1                                     

1.1.12.0/24        1029/3        -/GE0/0/1                                    

1.1.45.0/24        NULL/3        -/GE0/0/0                                    

1.1.45.0/24        1030/3        -/GE0/0/0 

 

此时R1访问R5就都有标签可以用了,只不过在R1和R3用的是5.5.0.0/16这条LSP的标签,到了R3替换成了5.5.5.5/32这条路由的标签,在R3上抓到的包,从R2收到1028,发给R4 1027;

 

 

路由汇总对MPLS VPN的影响:
场景一:

HCIE Datacom.png

环境说明:

@AR1/AR2/AR3/AR4/AR5跑rip;

@五台设备配置LDP;

@AR3上针对5.5.5.5做汇总;

@R3上写一条指向null0的防环路由ip route-static 5.5.0.0 16 NULL 0

@五台设备触发策略都是all;

@AR1和AR6建立IPV4的EBGP邻居,AR5和AR7建立IPV4的EBGP邻居;

@AR1和AR5建立IPV4的IBGP邻居;

@AR1和AR5配置route recursive-lookup tunnel

此时R6能否访问R7?

不行,因为数据包到了AR3上会将LDP分配的公网标签弹掉,AR3就会看到一个SIP:6.6.6.6 DIP:7.7.7.7的纯IP报文,但是AR3并没有私网路由;

 

场景二:

1651820626650233.png

@其他条件都跟上面的一样;

@AR1和AR5建立MP-IBGP邻居;

此时R6能否访问R7?

不行,因为AR1收到7.7.7.7的路由是无效的路由,LSP不完整;

AR5收到6.6.6.6路由是有效的,因为AR5去往6.6.6.6下一跳的公网标签是完整的;

 

为什么LSP不完整传递的路由就是无效的路由?

跟上面场景一道理一样,因为数据包到了AR3,AR3是没有能力处理私网标签或者是IP报文的

[AR1]

 VPN-Instance A, Router ID 1.1.1.1:

 

 Total Number of Routes: 2

      Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

 

 *>   6.6.6.6/32         1.1.16.6        0                     0      600i

   i  7.7.7.7/32         5.5.5.5         0          100        0      700i

 

 VPN-Instance B, Router ID 5.5.5.5:

 

[AR5]

 Total Number of Routes: 2

      Network            NextHop        MED        LocPrf    PrefVal Path/Ogn

 

 *>i  6.6.6.6/32         1.1.1.1         0          100        0      600i

 *>   7.7.7.7/32         1.1.57.7        0                     0      700i

 

如果将R3的汇总拿掉,此时AR1上就可以看到7.7.7.7/32的路由就是有效的了

 

总结:

1、执行汇总的路由器没有给汇总路由产生LSP,因为华为设备默认产生LSP的触发条件不会给非32位的主机路由产生LSP。

所以从R1-R3访问5.5.5.5/32是通过汇总路由执行IP转发,在R3上在进入LSP执行标签转发。

 

2、R3上执行汇总,并且LSP的触发策略也给汇总路由产生,则从R1-R3根据汇总路由的LSP执行标签转发,报文到达R3后,在根据明细路由的LSP执行标签转发。

 

对于MPLS VPN业务,如果MPLS domain中对PE设备的loop0接口的路由执行汇总,则会导致VPN业务中断,因为汇总的路由器会提前将公网标签剥离,而汇总的路由无法正确处理私网标签。


HCIE Datacom基础课循环开班,联系WOLFLAB领取免费学习资料

返回目录
在线咨询