十个网络优化改造案例(七):ASBR之间的MPLS VPN跨域互联改造

一、网络环境与需求

1.1、需求分析

         2017年上半年勒索病毒爆发,导致全球网络安全形势越来越严峻。从安全方面出发,企业准备为自建的骨干网络省地ASBR之间的链路上都加上透明模式的防火墙,省级骨干网方向为Untrust,地区级骨干网方向为Trust。如图所示: blob.png

       最先建立的省级骨干A网与地区网之间采用了MPLS VPN Option-B的跨域互联方式。但该种互联方式会使得ASBR之间链路上传递的数据包前面被封装MPLS标签,这会使得防火墙无法读取数据包的IP包头,从而防火墙无法发挥包过滤功能。

blob.png

所以,为了考虑使得省级骨干A网与地区网ASBR之间的防火墙发挥作用,就必须要想办法去掉ASBR之间链路上传输数据的MPLS头部。这里有两个方案:

方案一:将省级骨干A网与各个地区网之间的MPLS VPN跨域互联方式改成Option-A

方案二:让防火墙担任PE角色。

       方案一有个缺点,那就是省级骨干A网与地区网之间有8个私网业务,也就是存在8VRFvpn-instance)。如果要改成Option-A的方式互联,则需要重新规划8组互联地址,而且之前配置在BGP vpnv4地址族下的路由策略也需要重新规划,工作量是比较大的。

       方案二呢,让防火墙担任PE设备,这意味着将在防火墙上配置OSPFMPLSBGP等功能,考虑到防火墙的主要工作是包过滤,让其配置了那么多高级路由协议肯定会使防火墙的性能大大下降。而且如果防火墙的CPU、内存占用过高的话,影响了它的性能就会造成省地之间的网络通信瓶颈。

       所以,最终方案二被否决,方案一被采用。最后只能是执行在省级骨干A网与地区网之间把Option-B的跨域互联方式改成Option-A,使得ASBR之间链路传输的数据包就是纯IP包头,从而使防火墙发挥作用。

1.2、现网环境中私网VPN的规划

       由于省级骨干A网比B网建设时间早得多,所以省级骨干A网与B网的VPN规划不一样。省级骨干A网由7个私网业务VPN,见下表:

业务名称

扫描二维码关注公众号,回复: 29138 查看本文章

VRF名称

RD

入向RT

出向RT

数据中心

DataCenter

64810:3303

64810:3300

64810:303

64810:303

互联网

Internet

64810:1800

64810:1800

64810:1800

高清视频会议

Video-HD

64810:2000

64810:2000

64810:3100

64810:2000

压力监控

Monitor-Power

64810:1500

64810:1500

64810:1500

楼道监控

Monitor-Corridor

64810:2500

64810:2500

64810:2500

室内监控

Monitor-Indoor

64810:3200

64810:3200

64810:3200

卫星监控

Monitor-Satellite

64810:3000

64810:3000

64810:3001

64810:3101

64810:3008

 

       新建立的省级骨干B网对相似功能的VPN进行了整合,且省级骨干B网不负责访问Internet的业务,整合后的VPN如下表所示(在省级骨干B网中新建的VPN带有*号):

业务名称

VRF名称

RD

入向RT

出向RT

数据中心

IDC-VPN

64880:8001

64880:8001

64880:8001

高清视频会议

压力监控

Moni-VPN

64880:8002

64880:8002

64880:8002

楼道监控

室内监控

卫星监控

*异地灾备VPN

BACKUP-VPN

64880:8003

64880:8003

64880:8003

*IP电话等流配体

Stream-VPN

64880:8004

64880:8004

64880:8004

 

       从上面两张表格中我们可以发现,省级骨干A网中存在的VRFVPN-instance)与省级骨干B网中的存在的VRFVPN-instance)的RT值没有相同点,所以可以保证省级骨干AB网之间不会有路由“互蹿”的现象。但是在地区网中又怎么办?地区网可是同时要和AB两张省级骨干网通信的。

       在地区网上,省级骨干AB网的VRFVPN-instance)都是同时存在的,而且在地区网建立的VRFVPN-instance)中,相同功能的VRFVPN-instance)中的有两张省级骨干网的入向RT和出向RT,这里可以看一下地区1中的关于数据中心业务VRFVPN-instance)配置:

ip vpn-instance DataCenter

 route-distinguisher 64810:3303

 vpn-target 64810:3300 64810:3306 64810:303   export-extcommunity

 vpn-target 64810:303 64810:33600 64810:3300   64660:8001 import-extcommunity

省级骨干A网的DataCenter,在入向RT值有64660:8001,这样可以保证当它与省级骨干A网链路全部断开后,仍然可以从省级骨干B网学习到DataCenter的业务路由。

 

ip vpn-instance IDC-VPN

 route-distinguisher 64660:8001

 vpn-target 64660:8001   export-extcommunity

 vpn-target 64660:8001 64810:303   import-extcommunity

省级骨干B网的IDC-VPN,在入向RT值有64810:303,这样可以保证当它与省级骨干B网链路全部断开后,仍然可以从省级骨干A网学习到DataCenter的业务路由。

1.3、业务路由当前选路设置

       省级骨干网与地区网之间的选路顺序如下图所示

blob.png

       选路是按照如下方式进行调整的:

省级骨干A网与传递给骨干网的路由,起源属性置为IGP;省级骨干B网传递给骨干网的路由,起源属性置为Incomplete。所以,地区网会优先经过省级骨干A网。

在每个AS内,ASBR-1设备对所有iBGP邻居,把从其他AS传递过来的路由本地优先级调高,使得AS内部都会选择ASBR-1作为优先出口。

传递给其他AS的路由,如果是ASBR-2之间的eBGP邻居互相传递,则加大其Cost值。

为了防止优选1链路断开以后,优选3链路优先级高于优选2链路。所以在同一个网络平面的ASBR上选路时,属性的控制力度不能高于Original属性,所以不能通过修改AS-PATH属性执行同一网络的ASBR之间的选路。

业务路由选路原始策略配置如下:

省级骨干A网连接地区网ASBR-1(优选1链路)

route-map VPNv4_To_DQ1 permit 10

 match as-path 102

 match ip address prefix-list   VPNv4_To_DQ1

 set origin igp

route-map VPNv4_From_DQ1 permit 10

 match ip address prefix-list   VPNv4_From_DQ1

 set local-preference 200

 

ip as-path access-list 102 deny _64680$

ip as-path access-list 102 permit .*

省级骨干A网连接地区网ASBR-2(优选2链路)

route-map VPNv4_To_DQ1 permit 10

 match ip address prefix-list   VPNv4_To_DQ1

 match as-path 102

 set origin igp

 set metric 400

 

route-map VPNv4_From_DQ1 permit 10

 match ip address prefix-list   VPNv4_From_DQ1

 

ip as-path access-list 102 deny _64680$

ip as-path access-list 102 permit .*

省级骨干B网连接地区网ASBR-1(优选3链路)

route-map VPNv4_To_DQ1 permit 10

 match as-path 102

 match ip address prefix-list   VPNv4_To_DQ1

 set origin incomplete

route-map VPNv4_From_DQ1 permit 10

 match ip address prefix-list   VPNv4_From_DQ1

 set local-preference 200

 

ip as-path access-list 102 deny _64610$

ip as-path access-list 102 permit .*

省级骨干B网连接地区网ASBR-2(优选4链路)

route-map VPNv4_To_DQ1 permit 10

 match as-path 102

 match ip address prefix-list   VPNv4_To_DQ1

 set origin incomplete

 set metric 400

 

route-map VPNv4_From_DQ1 permit 10

 match ip address prefix-list   VPNv4_From_DQ1

 

ip as-path access-list 102 deny _64610$

ip as-path access-list 102 permit .*

 

1.4、割接整体需求

本次网络割接,需要将地区网与省级骨干A网之间的跨域互联方式改为Option-A,并且使网络业务的选路仍然保持一致。在割接完成以后不能出现因为路由缺失导致的网络不通或者是来回路径不一致的情况。

二、案例前置知识点

2.1MPLS VPN跨域技术简介

随着MPLS VPN部署的扩大,在提供服务的骨干网络中,跨越不同服务提供商管理边界的跨域部署成为必然的要求。跨域VPN的建立过程经过近几年的实践和快速发展,业界提出了几种VPN跨域方法,即OPTION A/B/C三种。

 

MPLS VPN跨域技术突破单个服务提供商管理域的限制,扩展了MPLS VPN架构的灵活性,使得部署方式满足了不断扩展的网络部署要求,成为一种非常成熟的VPN业务部署架构。

 

MPLS L3VPN跨域方式包含三种可选方式:

l  Option A:背靠背(back-to-backVRF

l  Option B:单跳多协议MP-eBGP

l  Option C:多跳多协议MP-eBGP

 

OPTION A跨域也叫做背靠背跨域,即两个AS的边界路由器ASBR互相作为PECE。采用这种方式,在域内各自配置MPLS VPN网络,对于跨越自治域的VPN,需要ASBR充当VPNPE设备,在ASBR设备上要配置该VPN对应的VRF,并且为该VRF分配一个接口(可以是逻辑接口),两个ASBR之间属于同一VPN的接口互相连接,如图所示

blob.png

对于本端自治域的VPNASBR充当PE角色,导入该VPN的所有路由。对于对端自治域的VPNASBR充当CE角色,通过与对端ASBR之间的eBGP来学习对端VPN的路由,然后再分发到本端VPN的所有PE设备中去。当进行报文转发时,域内使用两层标签转发,到达ASBR后,作为普通IP报文发送给对端ASBR

 

优点:VPN隧道构建比较简单,ASBR之间不需要运行MPLS,所以ASBR之间的数据包是标准的IP数据包。

缺点:ASBR要维护所有VPN的路由,并且要为每一个跨域的VPN分配一个接口,因此存在可扩展性不强的问题。

 

OPTION B跨域也叫单跳MP-EBGP跨域,AS内通过正常的MPLS/BGP传递VPN信息和构建LSP隧道,AS之间通过单跳的MP-EBGP协议传递VPN信息并构建LSP隧道。如图所示:

blob.png

该方式需要在ASBR之间运行MP-eBGP,当ASBR学习到本端自治域PE所通告的VPN路由后,进行一个标签替换,将路由信息和新的标签通告给对端ASBR。在进行报文转发时,域内使用两层标签转发,ASBR之间采用一层标签转发,并且根据实现的细节可能需要在ASBR上完成对内层标签的替换。

 

优点:ASBR之间一条链路传递所有VPN信息。不需要ASBR为每个VPN配置VRF,不需要导入VPN路由,不需要为每个VPN分配接口。

 

缺点:ASBR仍需要维护所有的VPN路由,并且为每个标签分配新的标签,在本地安装新老标签转换的ILM表项,因此对于ASBR路由器的设备性能要求比较高。

 

       由于本案例不涉及Option-C,且Option-C使用较少,所以本文就不再介绍Option-C了。需要这方面知识的小伙伴可以自行百度查找资料。

2.2Option-A 跨域技术关键配置

       对于Option-A,实现思路比较简单,也就是ASBR之间创建多个互联地址,每个互联地址绑定在不同的VRF中,然后每个VRF创建一个BGP邻居。如果VRF的数量多,则需要分配的互联地址就会越多,创建BGP邻居的数量就越多。

blob.png

       如上图,在R1—R2之间,有REDBLUE两个VRFRED中的互联地址是100.12.1.0/30BLUE中的互联地址是100.21.1.0/30。所以,在R1R2之间需要创建两个互联地址,分别是RED VRFBLUE VRF的:

R1上配置互联地址

interface Ethernet0/0.2

 encapsulation dot1Q 21

 ip vrf forwarding RED

 ip address 100.21.1.1   255.255.255.252

!

interface Ethernet0/0.3

 encapsulation dot1Q 121

 ip vrf forwarding BLUE

 ip address 100.12.11.1   255.255.255.252

R2上配置互联地址

interface Ethernet0/0.2

 encapsulation dot1Q 21

 ip vrf forwarding RED

 ip address 100.21.1.2   255.255.255.252

!

interface Ethernet0/0.3

 encapsulation dot1Q 121

 ip vrf forwarding BLUE

 ip address 100.12.11.2   255.255.255.252

 

       然后,针对每一个VRF创建一个eBGP邻居:

R1上的配置:

router bgp 65230

 !

 address-family ipv4 vrf BLUE

  neighbor 100.12.11.2 remote-as   65231

  neighbor 100.12.11.2 activate

 exit-address-family

 !

 address-family ipv4 vrf RED

  neighbor 100.21.1.2 remote-as   65231

  neighbor 100.21.1.2 activate

 exit-address-family

R2上的配置:

router bgp 65231

 !

 address-family ipv4 vrf BLUE

  neighbor 100.12.11.1 remote-as   65230

  neighbor 100.12.11.1 activate

 exit-address-family

 !

 address-family ipv4 vrf RED

  neighbor 100.21.1.1 remote-as   65230

  neighbor 100.21.1.1 activate

 exit-address-family

 

2.3Option-B 跨域技术关键配置

       对于Option-BASBR之间只需要一对互联地址,然后ASBR之间分别创建IPv4地址族的BGP邻居(传递公网路由),vpnv4地址族的BGP邻居(传递私网路由)。但是,ASBR之间的互联链路需要支持MPLS标签。

blob.png

       如上图所示,R1R2两台ASBR之间只需要一组互联地址,而R1R2之间需要建立IPv4地址族下的eBGP邻居和vpnv4地址族下的eBGP邻居。且互联接口需要支持标签分发。

R1上的配置:

interface Ethernet0/0

 ip address 100.12.1.1   255.255.255.252

 mpls bgp forwarding

 

router bgp 65230

no bgp default route-label filter

 neighbor 100.12.1.2 remote-as   65231

 !

 address-family ipv4

  neighbor 100.12.1.2 activate

!

 address-family vpnv4

  neighbor 100.12.1.2 activate

  neighbor 100.12.1.2   send-community extended

R2上的配置:

interface Ethernet0/0

 ip address 100.12.1.2 255.255.255.252

 mpls bgp forwarding

 

router bgp 65231

no bgp default route-label filter

 neighbor 100.12.1.1 remote-as 65230

 !

 address-family ipv4

  neighbor 100.12.1.1 activate

!

 address-family vpnv4

  neighbor 100.12.1.1 activate

  neighbor 100.12.1.1   send-community extended

 

三、方案设计思路

3.1、测试网络业务的传输路径

       在本次网络割接之前,需要对网络业务进行一次测试。首先需要测试的方式是ping,就是在地区级骨干网下面找一个局域网内的办公电脑,持续ping位于省级数据中心的服务器,然后逐条断开ASBR之间的链路,让链路进行切换。在链路切换的时候,必须要保证业务是正常的。

blob.png

       断路顺序依次为优选1-优选2-优选3,最后只留下优选4的链路。

       在确认3条链路断开后,业务正常,然后再逐步恢复断开的链路。不管是链路断开还是恢复,网络业务必须能够正常切换链路。确认业务正常以后,才能开始割接操作。

       下面,我们以地区1为例,讲一下该方案的设计思路和配置脚本。

3.2、互联IP地址规划

       ASBR-1之间互联IP地址规划如下表所示(互联地址段10.51.210.x):

业务名称

省网设备

地网设备

省网地址

地网地址

互联VLAN

DataCenter

7609A

12708A

93

94

101

Internet

7609A

12708A

49

50

102

Monitor-Power

7609A

12708A

97

98

103

Monitor-Indoor

7609A

12708A

101

102

104

Monitor-Corridor

7609A

12708A

105

106

105

Video-HD

7609A

12708A

109

110

106

公网互联

7609A

12708A

81

82

44

Monitor-Satellite

7609A

12708A

113

114

107

 

       ASBR-2之间互联IP地址规划如下表所示(互联地址段10.51.210.x):

blob.png

3.3.1、在省级骨干AASBR上配置互联地址3.3、配置互联IP地址

Pro.A-DQ1-ASBR-1

interface gi3/1.1

encapsulation dot1Q 101

ip vrf for DataCenter

ip address 10.51.210.93 255.255.255.252

 

interface gi3/1.2

encapsulation dot1Q 102

ip vrf for Internet

ip address 10.51.210.49 255.255.255.252

 

interface gi3/1.3

encapsulation dot1Q 103

ip vrf for Monitor-Power

ip address 10.51.210.97 255.255.255.252

 

interface gi3/1.4

encapsulation dot1Q 104

ip vrf for Monitor-Indoor

ip address 10.51.210.101 255.255.255.252

 

interface gi3/1.5

encapsulation dot1Q 105

ip vrf for Monitor-Corridor

ip address 10.51.210.105 255.255.255.252

 

interface gi3/1.6

encapsulation dot1Q 106

ip vrf for Video-HD

ip address 10.51.210.109 255.255.255.252

 

interface gi 3/1.7

encapsulation dot1Q 100

ip address 10.51.210.81 255.255.255.252

 

interface gi 3/1.8

encapsulation dot1Q 107

ip vrf for Monitor-Satellite

ip address 10.51.210.113 255.255.255.252

Pro.A-DQ1-ASBR-2

interface gi3/2.1

encapsulation dot1Q 111

ip vrf for DataCenter

ip address 10.51.210.121 255.255.255.252

 

interface gi3/2.2

encapsulation dot1Q 112

ip vrf for Internet

ip address 10.51.210.125 255.255.255.252

 

interface gi3/2.3

encapsulation dot1Q 113

ip vrf for Monitor-Power

ip address 10.51.210.129 255.255.255.252

 

interface gi3/2.4

encapsulation dot1Q 114

ip vrf for Monitor-Indoor

ip address 10.51.210.133 255.255.255.252

 

interface gi3/2.5

encapsulation dot1Q 115

ip vrf for Monitor-Corridor

ip address 10.51.210.137 255.255.255.252

 

interface gi3/2.6

encapsulation dot1Q 116

ip vrf for Video-HD

ip address 10.51.210.141 255.255.255.252

 

interface gi 3/2.7

encapsulation dot1Q 102

ip address 10.51.201.89 255.255.255.252

 

interface gi 3/2.8

encapsulation dot1Q 117

ip vrf for Monitor-Satellite

ip address 10.51.210.145 255.255.255.252

 

3.3.2、在地区1 ASBR上配置互联地址

DQ1-ASBR-12708-1

interface vlan 101

ip bind vpn-instance DataCenter

ip address 10.51.210.94 255.255.255.252

 

interface vlan 102

ip bind vpn-instance Internet

ip address 10.51.210.50 255.255.255.252

 

interface vlan 103

ip bind vpn-instance Monitor-Power

ip address 10.51.210.98 255.255.255.252

 

interface vlan 104

ip bind vpn-instance Monitor-Indoor

ip address 10.51.210.102 255.255.255.252

 

interface vlan 105

ip bind vpn-instance Monitor-Conrridor

ip address 10.51.210.106 255.255.255.252

 

interface vlan 106

ip bind vpn-instance Video-HD

ip address 10.51.210.110 255.255.255.252

 

interface vlan 102

ip address 10.51.210.82 255.255.255.252

 

interface vlan 107

ip bind vpn-instance Monitor-Satellite

ip address 10.51.210.114 255.255.255.252

DQ1-ASBR-12708-2

interface vlan 111

ip bind vpn-instance DataCenter

ip address 10.51.210.122 255.255.255.252

 

interface vlan 112

ip bind vpn-instance Internet

ip address 10.51.210.126 255.255.255.252

 

interface vlan 113

ip bind vpn-instance Monitor-Power

ip address 10.51.210.130 255.255.255.252

 

interface vlan 114

ip bind vpn-instance Monitor-Indoor

ip address 10.51.210.134 255.255.255.252

 

interface vlan 115

ip bind vpn-instance Monitor-Conrridor

ip address 10.51.210.138 255.255.255.252

 

interface vlan 116

ip bind vpn-instance Video-HD

ip address 10.51.210.142 255.255.255.252

 

interface vlan 102

ip address 10.51.210.90 255.255.255.252

 

interface vlan 117

ip bind vpn-instance Monitor-Satellite

ip address 10.51.210.146 255.255.255.252

 

3.4、配置eBGP邻居

3.4.1、省级骨干A网侧配置eBGP邻居

Pro.A-DQ1-ASBR-1

删掉Option-B的相关配置,包括接口和BGP配置。

注意到in方向和out方向的route-map,这分别是从地区1骨干网收取路由和发送路由的策略配置。

 

interface GigabitEthernet 3/1

 default ip address

 no mpls bgp forwar

 

router bgp 64810

 address-family vpnv4

  no neighbor 10.51.201.82 activate

  no neighbor 10.51.201.82 next-hop-self

  no neighbor 10.51.201.82 send-community   both

  no neighbor 10.51.201.82 route-map VPNv4_From_DQ1   in

  no neighbor 10.51.201.82 route-map   VPNv4_To_DQ1 out

为每个VRF创建一个eBGP邻居

router bgp 64810

 

address-family ipv4 vrf   DataCenter

 neighbor 10.51.210.94 remote-as 64611

 neighbor 10.51.210.94 activ

 neighbor 10.51.210.94 send-commun both

 redistribute connected

 redistribute static

 

 address-family ipv4 vrf Internet

 neighbor 10.51.210.50 remote-as 64611

 neighbor 10.51.210.50 activ

 redistribute connected

 redistribute static

 

 address-family ipv4 vrf Monitor-Power

 neighbor 10.51.210.98 remote-as 64611

 neighbor 10.51.210.98 activ

 redistribute connected

 redistribute static

 

 address-family ipv4 vrf Monitor-Indoor

 neighbor 10.51.210.102 remote-as 64611

 neighbor 10.51.210.102 activ

 redistribute connected

 redistribute static

 

 address-family ipv4 vrf Monitor-Corridor

 neighbor 10.51.210.106 remote-as 64611

 neighbor 10.51.210.106 activ

 redistribute connected

 redistribute static

 

 address-family ipv4 vrf Video-HD

 neighbor 10.51.210.110 remote-as 64611

 neighbor 10.51.210.110 activ

 redistribute connected

 redistribute static

 

 address-family ipv4 vrf Monitor-Satellite

 neighbor 10.51.210.114 remote-as 64611

 neighbor 10.51.210.114 activ

 redistribute connected

 redistribute static

Pro.A-DQ1-ASBR-2

删掉Option-B的相关配置,包括接口和BGP配置。

注意到in方向和out方向的route-map,这分别是从地区1骨干网收取路由和发送路由的策略配置。

 

interface GigabitEthernet 3/1

 default ip address

 no mpls bgp forwar

 

router bgp 64810

 address-family vpnv4

  no neighbor 10.51.201.90 activate

  no neighbor 10.51.201.90 next-hop-self

  no neighbor 10.51.201.90 send-community   both

  no neighbor 10.51.201.90 route-map VPNv4_From_DQ1   in

  no neighbor 10.51.201.90 route-map   VPNv4_To_DQ1 out

为每个VRF创建一个eBGP邻居

address-family ipv4 vrf DataCenter

 neighbor 10.51.210.122 remote-as   64611

 neighbor 10.51.210.122 activ

 neighbor 10.51.210.122 send-commun   both

 redistribute connected

 redistribute static

 

 address-family ipv4 vrf Internet

 neighbor 10.51.210.126 remote-as   64611

 neighbor 10.51.210.126 activ

 redistribute connected

 redistribute static

 

 address-family ipv4 vrf   Monitor-Power

 neighbor 10.51.210.130 remote-as   64611

 neighbor 10.51.210.130 activ

 redistribute connected

 redistribute static

 

 address-family ipv4 vrf   Monitor-Indoor

 neighbor 10.51.210.134 remote-as   64611

 neighbor 10.51.210.134 activ

 redistribute connected

 redistribute static

 

 address-family ipv4 vrf   Monitor-Corridor

 neighbor 10.51.210.138 remote-as   64611

 neighbor 10.51.210.138 activ

 redistribute connected

 redistribute static

 

 address-family ipv4 vrf Video-HD

 neighbor 10.51.210.142 remote-as   64611

 neighbor 10.51.210.142 activ

 redistribute connected

 redistribute static

 

 address-family ipv4 vrf   Monitor-Satellite

 neighbor 10.51.210.146 remote-as   64611

 neighbor 10.51.210.146 activ

 redistribute connected

 redistribute static

 

3.4.2、在地区网侧配置eBGP邻居

Pro.A-DQ1-ASBR-1

删掉Option-B的相关配置,包括接口和BGP配置。

bgp 64811

ipv4-family vpnv4

  reflector cluster-id 64811

  undo peer 10.51.210.81 enable

为每个VRF创建一个eBGP邻居

bgp 64811

 

ipv4-family vpn-instance DataCenter

 peer 10.51.210.93 as-number 64810

 peer 10.51.210.93 enable

 import direct

 import static

 

 ipv4-family vpn-instance Internet

 peer 10.51.210.49 as-number 64810

 peer 10.51.210.49 enable

 import direct

 import static

 

 ipv4-family vpn-instance   Monitor-Power

 peer 10.51.210.97 as-number 64810

 peer 10.51.210.97 enable

 import direct

 import static

 

 ipv4-family vpn-instance   Monitor-Indoor

 peer 10.51.210.101 as-number 64810

 peer 10.51.210.101 enable

 import direct

 import static

 

 ipv4-family vpn-instance   Monitor-Corridor

 peer 10.51.210.105 as-number 64810

 peer 10.51.210.105 enable

 import direct

 import static

 

 ipv4-family vpn-instance Video-HD

 peer 10.51.210.109 as-number 64810

 peer 10.51.210.109 enable

 import direct

 import static

 

 ipv4-family vpn-instance   Monitor-Satellite

 peer 10.51.210.113 as-number 64810

 peer 10.51.210.113 enable

 import direct

 import static

Pro.A-DQ1-ASBR-2

删掉Option-B的相关配置,包括接口和BGP配置。

bgp 64811

ipv4-family vpnv4

  reflector cluster-id 64811

  undo peer 10.51.210.89 enable

为每个VRF创建一个eBGP邻居

bgp 64811

 

ipv4-family vpn-instance DataCenter

 peer 10.51.210.121 as-number 64810

 peer 10.51.210.121 enable

 import direct

 import static

 

 ipv4-family vpn-instance Internet

 peer 10.51.210.125 as-number 64810

 peer 10.51.210.125 enable

 import direct

 import static

 

 ipv4-family vpn-instance   Monitor-Power

 peer 10.51.210.129 as-number 64810

 peer 10.51.210.129 enable

 import direct

 import static

 

 ipv4-family vpn-instance   Monitor-Indoor

 peer 10.51.210.133 as-number 64810

 peer 10.51.210.133 enable

 import direct

 import static

 

 ipv4-family vpn-instance   Monitor-Corridor

 peer 10.51.210.137 as-number 64810

 peer 10.51.210.137 enable

 import direct

 import static

 

 ipv4-family vpn-instance Video-HD

 peer 10.51.210.141 as-number 64810

 peer 10.51.210.141 enable

 import direct

 import static

 

 ipv4-family vpn-instance   Monitor-Satellite

 peer 10.51.210.145 as-number 64810

 peer 10.51.210.145 enable

 import direct

 import static

 

3.5、为每个eBGP邻居挂载路由策略

3.5.1、在省级骨干AASBR上配置

Pro.A-DQ1-ASBR-1

删掉Option-B的相关配置,包括接口和BGP配置。

注意到in方向和out方向的route-map,这分别是从地区1骨干网收取路由和发送路由的策略配置。

 

interface GigabitEthernet   3/1

 default ip address

 no mpls bgp forwar

 

router bgp 64810

 address-family vpnv4

  no neighbor 10.51.210.82 activate

  no neighbor 10.51.201.82 next-hop-self

  no neighbor 10.51.201.82 send-community   both

  no neighbor 10.51.201.82 route-map VPNv4_From_DQ1   in

  no neighbor 10.51.201.82 route-map   VPNv4_To_DQ1 out

为每个VRF创建一个挂载路由策略

router bgp 64810

 

  address-family ipv4 vrf DataCenter

 neighbor 10.51.210.94 route-map   VPNv4_From_DQ1 in

 neighbor 10.51.210.94 route-map VPNv4_To_DQ1   out

 

 address-family ipv4 vrf Internet

 neighbor 10.51.210.50 route-map   VPNv4_From_DQ1 in

 neighbor 10.51.210.50 route-map VPNv4_To_DQ1   out

 

 address-family ipv4 vrf Monitor-Power

 neighbor 10.51.210.98 route-map   VPNv4_From_DQ1 in

 neighbor 10.51.210.98 route-map VPNv4_To_DQ1   out

 

 address-family ipv4 vrf Monitor-Indoor

 neighbor 10.51.210.102 route-map   VPNv4_From_DQ1 in

 neighbor 10.51.210.102 route-map   VPNv4_To_DQ1 out

 

 address-family ipv4 vrf Monitor-Corridor

 neighbor 10.51.210.106 route-map   VPNv4_From_DQ1 in

 neighbor 10.51.210.106 route-map   VPNv4_To_DQ1 out

 

 address-family ipv4 vrf Video-HD

 neighbor 10.51.210.110 route-map   VPNv4_From_DQ1 in

 neighbor 10.51.210.110 route-map   VPNv4_To_DQ1 out

 

 address-family ipv4 vrf Monitor-Satellite

 neighbor 10.51.210.114 route-map   VPNv4_From_DQ1 in

 neighbor 10.51.210.114 route-map   VPNv4_To_DQ1 out

Pro.A-DQ1-ASBR-2

删掉Option-B的相关配置,包括接口和BGP配置。

注意到in方向和out方向的route-map,这分别是从地区1骨干网收取路由和发送路由的策略配置。

 

interface   GigabitEthernet 3/1

 default ip address

 no mpls bgp forwar

 

router bgp 64810

 address-family vpnv4

  no neighbor 10.51.201.90 activ

  no neighbor 10.51.201.90 next-hop-self

  no neighbor 10.51.201.90 send-community   both

  no neighbor 10.51.201.90 route-map VPNv4_From_DQ1   in

  no neighbor 10.51.201.90 route-map   VPNv4_To_DQ1 out

为每个VRF挂载一个路由策略

router bgp 64810

address-family ipv4 vrf   DataCenter

 neighbor 10.51.210.122 route-map   VPNv4_From_DQ1 in

 neighbor 10.51.210.122 route-map   VPNv4_To_DQ1 out

 

 address-family ipv4 vrf Internet

 neighbor 10.51.210.126 route-map   VPNv4_From_DQ1 in

 neighbor 10.51.210.126 route-map   VPNv4_To_DQ1 out

 

 address-family ipv4 vrf Monitor-Power

 neighbor 10.51.210.130 route-map   VPNv4_From_DQ1 in

 neighbor 10.51.210.130 route-map   VPNv4_To_DQ1 out

 

 address-family ipv4 vrf Monitor-Indoor

 neighbor 10.51.210.134 route-map   VPNv4_From_DQ1 in

 neighbor 10.51.210.134 route-map   VPNv4_To_DQ1 out

 

 address-family ipv4 vrf Monitor-Corridor

 neighbor 10.51.210.138 route-map   VPNv4_From_DQ1 in

 neighbor 10.51.210.138 route-map   VPNv4_To_DQ1 out

 

 address-family ipv4 vrf Video-HD

 neighbor 10.51.210.142 route-map   VPNv4_From_DQ1 in

 neighbor 10.51.210.142 route-map   VPNv4_To_DQ1 out

 

 address-family ipv4 vrf Monitor-Satellite

 neighbor 10.51.210.146 route-map VPNv4_From_DQ1   in

 neighbor 10.51.210.146 route-map   VPNv4_To_DQ1 out

 

3.6.1、在地区1 ASBR上配置

地网一侧的BGP选路由已经由省网侧ASBR控制了,所以地网一侧不针对ASBRBGP选路控制。

 

四、风险分析与回退措施

4.1、风险分析

此次割接更改的内容是ASBR之间的eBGP连接,包括路由策略的调整,改动量比较大,所以必须考虑风险问题。此次割接容易出现的风险有一下几点:

1.        Option-B改为Option-A以后,最容易出现的问题就是路由选路问题。在割接以后容易出现数据包来回路径不一致的情况;

2.        割接过程中涉及到的路由条目多,且不易排查。在割接以后容易出现部分路由条目收发不正常,导致路由条目缺失;

3.        因为设备硬件原因产生的其他问题;

4.        其他潜在的风险问题。

 

对于在割接过程中存在的各种风险问题,必须做好以下几点:

1.        在割接之前对业务流进行一次测试,如果发现业务有不正常的现象,需要将故障排除以后才可以进行割接的实施。对于硬件问题引发的网络故障必须确认不影响本次割接的实施。

2.        对于业务的测试一定要以成功打开应用为标准,不能单纯以Ping通或者tracer作为测试结果。

3.        严禁调试与本次割接无关的设备。

 

4.2、回退措施

       如果发现割接出现问题需要回退,则本次割接只需要将原本Option-B的配置重新写回来即可。

 

省网侧回退命令如下:

Pro.A-DQ1-ASBR-1


interface GigabitEthernet 3/1

  ip address 10.51.201.81

  mpls bgp forwar

 

router bgp 64810

 address-family vpnv4

  neighbor 10.51.201.82 activate

  neighbor 10.51.201.82   next-hop-self

  neighbor 10.51.201.82   send-community both

  neighbor 10.51.201.82 route-map VPNv4_From_DQ1   in

  neighbor 10.51.201.82 route-map   VPNv4_To_DQ1 out

Pro.A-DQ1-ASBR-2


interface GigabitEthernet 3/1

 ip address 10.51.210.89   255.255.255.252

 mpls bgp forwar

 

router bgp 64810

 address-family vpnv4

  neighbor 10.51.210.90 activ

  neighbor 10.51.210.90   next-hop-self

  neighbor 10.51.210.90   send-community both

  neighbor 10.51.210.90 route-map VPNv4_From_DQ1   in

  neighbor 10.51.210.90 route-map   VPNv4_To_DQ1 out

 

       地网侧的回退方式与省网侧类似

       然后,在每台ASBR进程中把带VRFaddress-family删掉就完成了回退。

       最后需要提醒读者一句:在开始割接之前,必须对即将操作的设备的配置命令进行一次备份,在回退以后要对照着原始的配置命令进行检查。

 

五、本案例实验室验证

5.1、实验拓扑图

       本案例要在实验中验证以下功能:

1.        Option-B改为Option-A的配置脚本;

2.        验证跨域互联方式更改了以后,还需要验证每个业务VRF内能否收到私网路由,并测试业务访问的路径是否正常,链路能否正常切换。

 

所以,本案例需要模拟出被测试的目标:DataCenter设备,还有省级骨干A网和B网的各个ASBR。最终拓扑图设计如下:

blob.png

 

5.2、关键配置说明

       Pro.A-DCPro.A-ASBR-1Pro.A-ASBR-2三个设备划入AS 64810,模拟省级骨干网A网;Pro.B-DCPro.B-ASBR-1Pro.B-ASBR-2三个设备划入AS 64880,模拟省级骨干网B网;DQ1-ASBR-1DQ1-ASBR-2MCE划入AS 64811,模拟地区1的骨干网;最后的DataCenter设备模拟数据中心的设备。

       由于实验环境规模的限制,只能针对一个VRF的业务进行模拟,所以将Pro.A-DCPro.B-DCE0/2接口划入DataCenter这个VRF中。如果需要模拟其他的VRF,则重新更改Pro.A-DCPro.B-DCE0/2VRF

 

对于每个AS内部,互联IP地址可以随意规划。但是ASBR之间的互联地址一定要使用现网中规划的地址。另外,在AS内部,iBGP的配置可以使用全互联的iBGP

 

       可以根据1.3小节中展示的路由策略,在模拟的省级骨干AB网上对地区级骨干网的ASBR上挂载路由策略。1.3小节中没有展示前缀列表中包含的路由条目,可以根据实验环境中的数据中心路由及地区网的路由来配置前缀列表。

       实验环境中的前缀列表:

ip prefix-list VPNv4_From_DQ1 seq 5 permit 112.112.112.112/32

ip prefix-list VPNv4_To_DQ1 seq 5 permit 10.114.144.1/32

ip prefix-list VPNv4_To_DQ1 seq 10 permit 10.51.201.0/24 le 32

 

       在模拟割接之前,可以先进行一次测试,测试的方式就是逐步断开链路(顺序为优选1、优选2、优选3),查看从地区网到数据中心的网络流量是否畅通,来回路径是否一致,是否走预期的链路。

未断开链路的Tracert现象

预期下一跳为10.51.201.81

DQ1-PE#traceroute vrf DataCenter   10.114.144.1 so lo 112 numeric

Type escape sequence to abort.

Tracing the route to 10.114.144.1

VRF info: (vrf in name/id, vrf out name/id)

  1 10.33.0.5 [MPLS: Label 27 Exp   0] 1 msec 1 msec 1 msec

  2 10.51.201.81 [MPLS: Label 26 Exp 0] 0 msec 1 msec 0 msec

  3 10.51.201.2 [MPLS: Label 23 Exp   0] 0 msec 0 msec 0 msec

  4 10.51.201.1 1 msec *  1 msec

断开链路“优选1”的现象

预期下一跳是10.51.201.89,注意等待一段时间等BGP路由稳定后再测试

DQ1-ASBR-1(config)#int   e1/1

DQ1-ASBR-1(config-if)#sh

 

DQ1-PE#traceroute vrf DataCenter 10.114.144.1 so lo 112 numeric

Type escape sequence to abort.

Tracing the route to 10.114.144.1

VRF info: (vrf in name/id, vrf out name/id)

  1 10.33.0.9 [MPLS: Label 27 Exp   0] 2 msec 1 msec 1 msec

  2 10.51.201.89 [MPLS: Label 26 Exp 0] 1   msec 1 msec 1 msec

  3 10.51.201.2 [MPLS: Label 23 Exp   0] 1 msec 2 msec 1 msec

  4 10.51.201.1 1 msec *  2 mse

断开链路“优选2”的现象

预期下一跳是10.51.222.81,注意等待一段时间等BGP路由稳定后再测试

DQ1-ASBR-2(config)#int   e1/2      

DQ1-ASBR-2(config-if)#sh

 

DQ1-PE#traceroute vrf DataCenter   10.114.144.1 so lo 112 numeric

Type escape sequence to abort.

Tracing the route to 10.114.144.1

VRF info: (vrf in name/id, vrf out name/id)

  1 10.51.222.82 [MPLS: Label 20   Exp 0] 0 msec 0 msec 1 msec

  2 10.51.222.81 1 msec 1 msec 0 msec

  3 10.51.201.6 [MPLS: Label 17 Exp   0] 2 msec 1 msec 0 msec

  4 10.51.201.5 3 msec *  1 msec

断开链路“优选3”的现象

预期下一跳是10.51.222.101,注意等待一段时间等BGP路由稳定后再测试

DQ1-ASBR-1(config)#int   e1/3

DQ1-ASBR-1(config-if)#sh

 

DQ1-PE#traceroute vrf DataCenter   10.114.144.1 so lo 112 numeric

Type escape sequence to abort.

Tracing the route to 10.114.144.1

VRF info: (vrf in name/id, vrf out name/id)

  1 10.51.222.102 [MPLS: Label 20   Exp 0] 0 msec 0 msec 1 msec

  2 10.51.222.101 1 msec 1 msec 0 msec

  3 10.51.201.6 [MPLS: Label 17 Exp   0] 2 msec 1 msec 0 msec

  4 10.51.201.5 3 msec *  1 msec

      

       在逐步断开链路测试发现业务正常以后,再逐步把链路进行恢复,查看网络业务流量是否是按照预期进行流量走向的恢复。

不管是在做模拟实验,还是在现网环境,在割接前和割接后,都需要按照上述列表中的方式给测试一遍。割接前测试,是为了测试网络业务走向是否正常;割接后测试,是为了验证割接是否成功,有没有造成业务中断。

 

六、经验总结

       想要完成本案例的割接工作,首先需要对MPLS VPN跨域互联中的Option-AOption-B的数据流特点比较熟悉。要知道Option-AOption-B在数据层面的本质区别就是:在ASBR之间的数据包头上,Option-A封装的就是纯IP包头,Option-B还封装了MPLS标签。所以在ASBR之间的链路有防火墙的情况下,除非防火墙能够识别MPLS包头,否则只能使用Option-A

       不过通过这次案例,相信大家也能看出来,Option-A在配置上要比Option-B复杂一些,可扩展性上,Option-A也要差一些。但是性能上Option-AOption-B要灵活一些。

       本案例仍然有在四条链路上进行选路的操作,在选路的时候,如何规划合适的路径属性进行调整,这一直是骨干网割接的重点知识,希望大家熟练掌握。

 

 

 

 

 


猜你喜欢

转载自blog.51cto.com/wzjxzht/2104803