多出口BGP网络流量割接案例

BGP路由的收敛速度是大家有目共睹的事实,但也不能怪它,毕竟算法流程复杂。

image

今天我要跟大家分享的是依靠IGP的快速收敛来弥补BGP路由收敛时间的问题,同时又保障在流量路径切换时达到零丢包,

很多前辈可能形象的将这一解决方案称为BGP的虚拟下一跳技术。

如图所示,网络中的IGP及BGP已经预先配置完毕。此时 10.1.1.1 与 1.2.3.4 之间的IP连通性已经部署完毕。

R6#ping 1.2.3.4 source 10.1.1.1

Type escape sequence to abort.

Sending 5, 100-byte ICMP Echos to 1.2.3.4, timeout is 2 seconds:

Packet sent with a source address of 10.1.1.1

!!!!!

Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms

OK,验证了连通性之后,我们来部署BGP的虚拟下一跳方案。

步骤一:

在AS 200 的ASBR上添加独立环回口通告进IGP,并在R6上验证效果;

R4#enable

R4#configure terminal

R4(config)#interface loopback 1

R4(config-if)#ip address 6.6.6.6 255.255.255.255

R4(config-if)#ip router isis

R4(config-if)#exit

R5#enable

R5#configure terminal

R5(config)#interface loopback 1

R5(config-if)#ip address 6.6.6.6 255.255.255.255

R5(config-if)#ip router isis

R5(config-if)#exit

R6#show ip route isis | begin Gateway

Gateway of last resort is not set

6.0.0.0/32 is subnetted, 1 subnets

i L1 6.6.6.6 [115/11] via 46.1.1.4, 00:02:02, Ethernet0/1

44.0.0.0/24 is subnetted, 1 subnets

i L1 44.1.1.0 [115/11] via 46.1.1.4, 00:05:27, Ethernet0/1

45.0.0.0/24 is subnetted, 1 subnets

i L1 45.1.1.0 [115/11] via 46.1.1.4, 00:05:27, Ethernet0/1

55.0.0.0/32 is subnetted, 1 subnets

i L1 55.1.1.1 [115/20] via 56.1.1.5, 00:05:27, Ethernet0/2

请注意,此处只看到了一条去往6.6.6.6的路由,那是因为我预先干涉了R6到R4和R5的1S1S链路度量值,使其优先选择了R4做为最优路径。

稍后我们会将R4提供的下一跳割接掉,然后观察零丢包实现割接。

步骤二:

定义路由策略,修改路由下一跳为 6.6.6.6,此步骤的目的是预备将来在ASBR上通告给R6的意图内路由被修改下一跳;

R4(config)#ip prefix-list 1 permit 1.2.3.4/32 # 定义前缀列表匹配目标路由

R5(config)#ip prefix-list 1 permit 1.2.3.4/32

R4(config)#route-map NH permit 10

R4(config-route-map)#match ip address prefix-list 1

R4(config-route-map)#set ip next-hop 6.6.6.6

R4(config-route-map)#route-map NH permit 10

R4(config-route-map)#route-map NH permit 20

R4(config-route-map)#exit

R5(config)#route-map NH permit 10

R5(config-route-map)#match ip address prefix-list 1

R5(config-route-map)#set ip next-hop 6.6.6.6

R5(config-route-map)#route-map NH permit 10

R5(config-route-map)#route-map NH permit 20

R5(config-route-map)#exit

步骤三:

在ASBR上针对R6部署策略并验证效果;

R4(config)#router bgp 200

R4(config-router)#neighbor 66.1.1.1 route-map NH out

R4(config-router)#end

R5(config)#router bgp 200

R5(config-router)#neighbor 66.1.1.1 route-map NH out

R5(config-router)#end

R6#show ip route bgp | begin Gateway # 验证BGP路由下一跳被修改了 #

Gateway of last resort is not set

1.0.0.0/32 is subnetted, 1 subnets

B 1.2.3.4 [200/0] via 6.6.6.6, 00:00:36

步骤四:

确定数据转发路径,实现割接,观察零丢包;

R6#show ip cef exact-route 10.1.1.1 1.2.3.4

10.1.1.1 -> 1.2.3.4 => IP adj out of Ethernet0/1, addr 46.1.1.4  # 当前数据转发路径为e0/1接口

R4(config)#interface loopback 1

R4(config-if)#no ip router isis #注意,暂时不执行此指令,在R6测试过程中突然执行指令来观察现象#

R6#ping 1.2.3.4 source 10.1.1.1 repeat 30000

Type escape sequence to abort.

Sending 30000, 100-byte ICMP Echos to 1.2.3.4, timeout is 2 seconds:

Packet sent with a source address of 10.1.1.1

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

<此处省略大量!!!!!!!!!!!!!!!!!>

Success rate is 100 percent (30000/30000), round-trip min/avg/max = 1/1/7 ms

R6# #零丢包#

R6#show ip cef exact-route 10.1.1.1 1.2.3.4  #再次验证路径#

10.1.1.1 -> 1.2.3.4 => IP adj out of Ethernet0/2, addr 56.1.1.5

总结,在实际环境中,当我们的ASBR需要割接,可以直接将IGP虚拟下一跳从IGP通告中移除,R6并不关心这一点,因为1S1S会立刻收敛并为其继续提供下一跳地址6.6.6.6的服务。

大家好,我是达叔,欢迎关注我,让我们一起分享更多。

猜你喜欢

转载自blog.51cto.com/dashu666/2531996