查看完整版本: BGP负载共享

谁是英雄 2007-11-10 09:50

BGP负载共享

[font=Times New Roman][b][size=14pt]1.
[/size][/b][b][size=14pt]BGP[/size][/b][/font][b][font=宋体][size=14pt]邻居之间使用[/size][/font][/b][b][size=14pt][font=Times New Roman]Loopback[/font][/size][/b][b][font=宋体][size=14pt]地址进行负载共享[/size][/font][/b][b][size=14pt][/size][/b]
[font=宋体][size=12pt]该场景展示如何在多条(最大可有[/size][/font][size=12pt][font=Times New Roman]6[/font][/size][font=宋体][size=12pt]条)等价链路上完成负载共享。该链路建立在本地[/size][/font][size=12pt][font=Times New Roman]AS[/font][/size][font=宋体][size=12pt]中一台路由器和远程[/size][/font][size=12pt][font=Times New Roman]AS[/font][/size][font=宋体][size=12pt]中另一台路由器之间是一个单宿主末端网络[/size][/font][size=12pt][font=Times New Roman] BGP[/font][/size][font=宋体][size=12pt]环境。[/size][/font][size=12pt][/size]
[size=12pt][font=Times New Roman]top[/font][/size][font=宋体][size=12pt]如下:

[img=539,164]http://www.one-tom.com/bbs/uploads/20070709_160302_image001.jpg[/img]




[/size][/font][size=12pt][font=宋体][size=12pt]配置如下:[/size][/font][size=12pt][/size]
[table][tr][td=1,1,552][align=center][size=14pt][font=Times New Roman]RouterA[/font][/size][/align]
[/td][/tr][tr][td=1,1,552][align=left][b][font=宋体][size=11pt][font=Times New Roman]RA(config)#int s1/1[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RA(config-if)#ip add 150.10.10.1 255.255.255.0 [/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RA(config-if)#no sh[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RA(config-if)#int s1/2[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RA(config-if)#ip add 160.20.20.1 255.255.255.0[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RA(config-if)#no sh[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RA(config-if)#int lo0[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RA(config-if)#ip add 1.1.1.1 255.255.255.0[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RA(config)#router bgp 11[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RA(config-router)#nei 2.2.2.2 remote-as 10[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RA(config-router)#nei 2.2.2.2 update-source lo0[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RA(config-router)#nei 2.2.2.2 ebgp-multihop [/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RA(config-router)#router eigrp 12[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RA(config-router)#net 1.0.0.0[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RA(config-router)#net 150.10.0.0[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RA(config-router)#net 160.20.0.0[/font][/size][/font][/b][/align]
[align=left][font=Times New Roman][b][font=宋体][size=11pt]RA(config-router)#no auto-summary [/size][/font][/b][b][font=宋体][size=12pt][/size][/font][/b][/font][/align]
[/td][/tr][tr][td=1,1,552][align=center][size=14pt][font=Times New Roman]RrouterB[/font][/size][/align]
[/td][/tr][tr][td=1,1,552][align=left][b][font=宋体][size=11pt][font=Times New Roman]RB(config)#int lo0[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RB(config-if)#ip add 2.2.2.2 255.255.255.0[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RB(config-if)#int s1/1 [/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RB(config-if)#no ip route-cache[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RB(config-if)#ip add 160.20.20.2 255.255.255.0[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RB(config-if)#no sh[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RB(config-if)#int s1/2[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RB(config-if)#no ip route-cache[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RB(config-if)#ip add 150.10.10.2 255.255.255.0[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RB(config-if)#no sh[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RB(config-if)#router bgp 10[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RB(config-router)#nei 1.1.1.1 remote-as 11[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RB(config-router)#nei 1.1.1.1 update-source lo0[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RB(config-router)#nei 1.1.1.1 ebgp-multihop [/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RB(config-router)#router eigrp 12[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RB(config-router)#net 2.0.0.0[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RB(config-router)#net 150.10.0.0[/font][/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt][font=Times New Roman]RB(config-router)#net 160.20.0.0[/font][/size][/font][/b][/align]
[align=left][font=Times New Roman][b][font=宋体][size=11pt]RB(config-router)#no auto-summary[/size][/font][/b][b][font=宋体][size=11pt][/size][/font][/b][/font][/align]
[/td][/tr][/table]
[b][font=宋体][size=12pt]验证基于数据包(过程交换)的负载均衡:[/size][/font][/b][b][size=12pt][/size][/b]
[size=12pt][font=Times New Roman]RA#sh ip ro[/font][/size]
[size=12pt][font=Times New Roman] [/font][/size]
[size=12pt][font=Times New Roman]Gateway of last resort is not set[/font][/size]
[size=12pt][font=Times New Roman] [/font][/size]
[size=12pt][font=Times New Roman]
1.0.0.0/24 is subnetted, 1 subnets[/font][/size]
[size=12pt][font=Times New Roman]C
1.1.1.0 is directly connected, Loopback0[/font][/size]
[size=12pt][font=Times New Roman]
2.0.0.0/24 is subnetted, 1 subnets[/font][/size]
[size=12pt][font=Times New Roman]D
2.2.2.0 [90/2297856] via 150.10.10.2, 00:18:47, Serial1/1[/font][/size]
[size=12pt][font=Times New Roman]
[90/2297856] via 160.20.20.2, 00:18:47, Serial1/2[/font][/size]
[size=12pt][font=Times New Roman]
160.20.0.0/24 is subnetted, 1 subnets[/font][/size]
[size=12pt][font=Times New Roman]C
160.20.20.0 is directly connected, Serial1/2[/font][/size]
[size=12pt][font=Times New Roman]
150.10.0.0/24 is subnetted, 1 subnets[/font][/size]
[size=12pt][font=Times New Roman]C
150.10.10.0 is directly connected, Serial1/1[/font][/size]
[b][size=14pt][font=Times New Roman]`````````````````````````````````````````````````````````````````````````````````````````[/font][/size][/b]
[size=12pt][font=Times New Roman]RA#traceroute 2.2.2.2[/font][/size]
[size=12pt][font=Times New Roman] [/font][/size]
[size=12pt][font=Times New Roman]Type escape sequence to abort.[/font][/size]
[size=12pt][font=Times New Roman]Tracing the route to 2.2.2.2[/font][/size]
[size=12pt][font=Times New Roman] [/font][/size]
[size=12pt][font=Times New Roman]

1 150.10.10.2 36 msec[/font][/size]
[size=12pt][font=Times New Roman]160.20.20.2 60 msec *[/font][/size]
[size=14pt][font=Times New Roman]````````````````````````````````````````````````````````````````````````````````````````[/font][/size]
[b][size=12pt][font=Times New Roman]2.
[/font][/size][/b][b][font=宋体][size=12pt]单台边界路由器多宿主末端网络连接到单一[/size][/font][/b][b][size=12pt][font=Times New Roman]ISP[/font][/size][/b][b][font=宋体][size=12pt]环境中的负载共享[/size][/font][/b][b][size=12pt][/size][/b]
[font=宋体][size=12pt]本场景展示了当在远程[/size][/font][size=12pt][font=Times New Roman]AS[/font][/size][font=宋体][size=12pt]和本地[/size][/font][size=12pt][font=Times New Roman]AS[/font][/size][font=宋体][size=12pt]之间存在多条链路时如何完成负载共享。链路建立在本地[/size][/font][size=12pt][font=Times New Roman]AS[/font][/size][font=宋体][size=12pt]中的一个路由器和远程[/size][/font][size=12pt][font=Times New Roman]AS[/font][/size][font=宋体][size=12pt]中的多个路由器之间。[/size][/font][size=12pt][/size]
[size=12pt][font=Times New Roman]top[/font][/size][font=宋体][size=12pt]图如下:[/size][/font][size=12pt][/size]
[img=553,246]http://www.one-tom.com/bbs/uploads/20070709_160523_image002.jpg[/img]
[font=宋体][size=12pt]默认情况下[/size][/font][size=12pt][font=Times New Roman]BGP[/font][/size][font=宋体][size=12pt]只从可能存在的等价路径中选择出一条最佳的路径,通过命令[/size][/font][size=12pt][font=Times New Roman]maximum-path[/font][/size][font=宋体][size=12pt]对可选择的等价路径数目([/size][/font][size=12pt][font=Times New Roman]1~6[/font][/size][font=宋体][size=12pt])进行修改。[/size][/font][size=12pt][/size]
[font=宋体][size=12pt]配置如下:[/size][/font][size=12pt][/size]
[table][tr][td=1,1,552][align=center][size=14pt][font=Times New Roman]RouterA[/font][/size][/align]
[/td][/tr][tr][td=1,1,552][align=left][b][font=宋体][size=12pt]RouterA (config)#int s1/0[/size][/font][/b][/align]
[align=left][b][font=宋体][size=12pt]RouterA (config-if)#ip add 160.20.20.1 255.255.255.0[/size][/font][/b][/align]
[align=left][b][font=宋体][size=12pt]RouterA (config-if)#no sh[/size][/font][/b][/align]
[align=left][b][font=宋体][size=12pt]RouterA (config)#int s1/2[/size][/font][/b][/align]
[align=left][b][font=宋体][size=12pt]RouterA (config-if)#ip add 150.10.10.1 255.255.255.0[/size][/font][/b][/align]
[align=left][b][font=宋体][size=12pt]RouterA (config-if)#no sh[/size][/font][/b][/align]
[align=left][b][font=宋体][size=12pt]RouterA (config-if)#int lo0[/size][/font][/b][/align]
[align=left][b][font=宋体][size=12pt]RouterA (config-if)#ip add 1.1.1.1 255.255.255.0[/size][/font][/b][/align]
[align=left][b][font=宋体][size=12pt]RouterA (config-if)#router bgp 11[/size][/font][/b][/align]
[align=left][b][font=宋体][size=12pt]RouterA (config-router)#network 1.0.0.0[/size][/font][/b][/align]
[align=left][b][font=宋体][size=12pt]RouterA (config-router)#neighbor 150.10.10.2 remote-as 10[/size][/font][/b][/align]
[align=left][b][font=宋体][size=12pt]RouterA (config-router)#neighbor 160.20.20.2 remote-as 10[/size][/font][/b][/align]
[align=left][b][font=宋体][size=12pt]RouterA (config-router)#maximum-paths 2[/size][/font][/b][/align]
[/td][/tr][tr][td=1,1,552][align=center][size=14pt][font=Times New Roman]RouterB[/font][/size][/align]
[/td][/tr][tr][td=1,1,552][align=left][b][font=宋体][size=11pt]RourterB(config)#int s1/2[/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt]RourterB(config-if)#ip add 160.20.20.2 255.255.255.0[/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt]RourterB(config-if)#no sh[/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt]RourterB(config-if)#int fa0/0[/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt]RourterB(config-if)#ip add 2.2.2.1 255.255.255.0[/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt]RourterB(config-if)#no sh[/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt]RourterB(config)#router bgp 10[/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt]RourterB(config-router)#network 2.0.0.0[/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt]RourterB(config-router)#neighbor 160.20.20.1 remote-as 11[/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt]RourterB(config-router)#auto-summary[/size][/font][/b][/align]
[/td][/tr][tr][td=1,1,552][align=center][size=14pt][font=Times New Roman]RouterC[/font][/size][/align]
[/td][/tr][tr][td=1,1,552][align=left][b][font=宋体][size=11pt]RourterB(config)#int s1/2[/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt]RourterB(config-if)#ip add 150.10.10.2 255.255.255.0[/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt]RourterB(config-if)#no sh[/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt]RourterB(config-if)#int fa0/0[/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt]RourterB(config-if)#ip add 2.2.2.2 255.255.255.0[/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt]RourterB(config-if)#no sh[/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt]RourterB(config)#router bgp 10[/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt]RourterB(config-router)#network 2.0.0.0[/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt]RourterB(config-router)#neighbor 150.10.10.1 remote-as 11[/size][/font][/b][/align]
[align=left][b][font=宋体][size=11pt]RourterB(config-router)#auto-summary[/size][/font][/b][font=宋体][size=14pt][/size][/font][/align]
[/td][/tr][/table][font=宋体][size=12pt]验证:[/size][/font][size=12pt][/size]
[size=12pt][font=Times New Roman]RouterA# sh ip bgp [/font][/size]
[size=12pt][font=Times New Roman]BGP table version is 5, local router ID is 1.1.1.1[/font][/size]
[size=12pt][font=Times New Roman]Status codes: s suppressed, d damped, h history, * valid, > best, i - internal[/font][/size]
[size=12pt][font=Times New Roman]Origin codes: i - IGP, e - EGP, ? - incomplete[/font][/size]
[size=12pt][font=Times New Roman] [/font][/size]
[size=12pt][font=Times New Roman]
Network
Next Hop
Metric LocPrf Weight Path[/font][/size]
[size=12pt][font=Times New Roman]*> 1.0.0.0
0.0.0.0
0
32768 i[/font][/size]
[size=12pt][font=Times New Roman]*> 2.0.0.0
160.20.20.2
0
0 10 i[/font][/size]
[size=12pt][font=Times New Roman]*
150.10.10.2

0
0 10 i[/font][/size]
[b][size=14pt][font=Times New Roman]`````````````````````````````````````````````````````````````````````````````````````````[/font][/size][/b]
[size=12pt][font=Times New Roman]RouterA#sh ip ro[/font][/size]
[size=12pt][font=Times New Roman]Gateway of last resort is not set[/font][/size]
[size=12pt][font=Times New Roman] [/font][/size]
[size=12pt][font=Times New Roman]
1.0.0.0/24 is subnetted, 1 subnets[/font][/size]
[size=12pt][font=Times New Roman]C
1.1.1.0 is directly connected, Loopback0[/font][/size]
[size=12pt][font=Times New Roman]B
2.0.0.0/8 [20/0] via 150.10.10.2, 00:16:32[/font][/size]
[size=12pt][font=Times New Roman]
[20/0] via 160.20.20.2, 00:15:47[/font][/size]
[size=12pt][font=Times New Roman]
160.20.0.0/24 is subnetted, 1 subnets[/font][/size]
[size=12pt][font=Times New Roman]C
160.20.20.0 is directly connected, Serial1/0[/font][/size]
[size=12pt][font=Times New Roman]
150.10.0.0/24 is subnetted, 1 subnets[/font][/size]
[size=12pt][font=Times New Roman]C
150.10.10.0 is directly connected, Serial1/2[/font][/size]
[b][size=14pt][font=Times New Roman]`````````````````````````````````````````````````````````````````````````````````````````[/font][/size][/b]
[size=12pt][font=Times New Roman]RouterA#[/font][/size]
[size=12pt][font=Times New Roman]RouterA#traceroute 2.2.2.2 [/font][/size]
[size=12pt][font=Times New Roman] [/font][/size]
[size=12pt][font=Times New Roman]Type escape sequence to abort.[/font][/size]
[size=12pt][font=Times New Roman]Tracing the route to 2.2.2.2[/font][/size]
[size=12pt][font=Times New Roman] [/font][/size]
[size=12pt][font=Times New Roman]
[color=red]1 150.10.10.2 64 msec[/color][/font][/size]
[size=12pt][font=Times New Roman]160.20.20.2 92 msec *[/font][/size]
[b][size=14pt][font=Times New Roman]
``````````````````````````````````````````````````````````````````````````````````
[b][size=12pt]3.
[/size][/b][font=宋体][color=#0000ff]多台边界路由器多宿主末端网络连接到单一ISP环境中的负载共享[/color][/font]

[color=#0000ff][font=宋体][size=3][color=#000000][/color][/size][/font][/color][font=宋体][size=3][font=宋体][size=12pt]这个场景展示了当通过多个本地路由器到达同一[/size][/font][size=12pt][font=Times New Roman]ISP[/font][/size][font=宋体][size=12pt]具有多条连接时如何完成负载共享。两个[/size][/font][size=12pt][font=Times New Roman]eBGP[/font][/size][font=宋体][size=12pt]对等体分别建立在两个独立的本地路由器上。在两条链路上负载均衡是不可能发生的因为[/size][/font][size=12pt][font=Times New Roman]BGP[/font][/size][font=宋体][size=12pt]会在从[/size][/font][size=12pt][font=Times New Roman]eBGP[/font][/size][font=宋体][size=12pt]和[/size][/font][size=12pt][font=Times New Roman]iBGP[/font][/size][font=宋体][size=12pt]学来的路由中挑选出一条最佳的路由。在去往[/size][/font][size=12pt][font=Times New Roman]AS10[/font][/size][font=宋体][size=12pt]的多条路径上进行负载共享是很好的选择,这种负载共享可以基于预先制定的路由策略让去往某一特定网络的流量在两条链路上通过。此外,当其中一条链路失效后另外一条链路能充当其备分链路。[/size][/font][size=12pt][/size]
[font=宋体][size=12pt]现在假定[/size][/font][size=12pt][font=Times New Roman]AS11[/font][/size][font=宋体][size=12pt]的[/size][/font][size=12pt][font=Times New Roman]BGP[/font][/size][font=宋体][size=12pt]路由策略如下:[/size][/font][size=12pt][/size]
[font=宋体][size=7.5pt]●
[/size][/font][size=12pt][font=Times New Roman]AS11[/font][/size][font=宋体][size=12pt]接收来自[/size][/font][size=12pt][font=Times New Roman]AS10[/font][/size][font=宋体][size=12pt]的本地路由,连同其余一些默认的[/size][/font][size=12pt][font=Times New Roman]Inetnet[/font][/size][font=宋体][size=12pt]路由。[/size][/font][size=12pt][/size]
[font=宋体][size=7.5pt]●
[/size][/font][font=宋体][size=12pt]外出流量策略是:[/size][/font][size=12pt][/size]
[font=宋体][size=12pt]①[/size][/font][font=宋体][size=12pt]从[/size][/font][size=12pt][font=Times New Roman]R101[/font][/size][font=宋体][size=12pt]去往[/size][/font][size=12pt][font=Times New Roman]Internet[/font][/size][font=宋体][size=12pt]的所有流量走[/size][/font][size=12pt][font=Times New Roman]R101-R103[/font][/size][font=宋体][size=12pt]这条链路。[/size][/font][size=12pt][/size]
[font=宋体][size=12pt]②[/size][/font][font=宋体][size=12pt]若[/size][/font][size=12pt][font=Times New Roman]R101-R103[/font][/size][font=宋体][size=12pt]链路失效则[/size][/font][size=12pt][font=Times New Roman]R101[/font][/size][font=宋体][size=12pt]去往[/size][/font][size=12pt][font=Times New Roman]Internet[/font][/size][font=宋体][size=12pt]的所有流量从[/size][/font][size=12pt][font=Times New Roman]R102[/font][/size][font=宋体][size=12pt]到达[/size][/font][size=12pt][font=Times New Roman]AS10[/font][/size][font=宋体][size=12pt]。[/size][/font][size=12pt][/size]
[font=宋体][size=12pt]③[/size][/font][font=宋体][size=12pt]从[/size][/font][size=12pt][font=Times New Roman]R102[/font][/size][font=宋体][size=12pt]去往[/size][/font][size=12pt][font=Times New Roman]Internet[/font][/size][font=宋体][size=12pt]的所有流量走[/size][/font][size=12pt][font=Times New Roman]R102-R104[/font][/size][font=宋体][size=12pt]这条链路。[/size][/font][size=12pt][/size]
[font=宋体][size=12pt]④[/size][/font][font=宋体][size=12pt]若[/size][/font][size=12pt][font=Times New Roman]R102-R104[/font][/size][font=宋体][size=12pt]链路失效则[/size][/font][size=12pt][font=Times New Roman]R102[/font][/size][font=宋体][size=12pt]去往[/size][/font][size=12pt][font=Times New Roman]Internet[/font][/size][font=宋体][size=12pt]的所有流量从[/size][/font][size=12pt][font=Times New Roman]R101[/font][/size][font=宋体][size=12pt]到达[/size][/font][size=12pt][font=Times New Roman]AS10[/font][/size][font=宋体][size=12pt]。[/size][/font][size=12pt][/size]
[font=宋体][size=7.5pt]●[/size][/font][font=宋体][size=12pt]进入流量的策略是:[/size][/font][size=12pt][/size]
[font=宋体][size=12pt]①[/size][/font][font=宋体][size=12pt]从[/size][/font][size=12pt][font=Times New Roman]Inetnet[/font][/size][font=宋体][size=12pt]到网络[/size][/font][size=12pt][font=Times New Roman]192.168.11.0/24[/font][/size][font=宋体][size=12pt]的流量走[/size][/font][size=12pt][font=Times New Roman]R103-R101[/font][/size][font=宋体][size=12pt]这条链路。[/size][/font][size=12pt][/size]
[font=宋体][size=12pt]②[/size][/font][font=宋体][size=12pt]从[/size][/font][size=12pt][font=Times New Roman]Inetnet[/font][/size][font=宋体][size=12pt]到网络[/size][/font][size=12pt][font=Times New Roman]192.168.12.0/24[/font][/size][font=宋体][size=12pt]的流量走[/size][/font][size=12pt][font=Times New Roman]R104-R102[/font][/size][font=宋体][size=12pt]这条链路。[/size][/font][size=12pt][/size]
[font=宋体][size=12pt]③[/size][/font][font=宋体][size=12pt]如果到[/size][/font][size=12pt][font=Times New Roman]AS10[/font][/size][font=宋体][size=12pt]的其中一条链路失效,那么另一条链路必须路由所有从[/size][/font][size=12pt][font=Times New Roman]Intnet[/font][/size][font=宋体][size=12pt]返回到[/size][/font][size=12pt][font=Times New Roman]AS11[/font][/size][font=宋体][size=12pt]的流量。[/size][/font][size=12pt][/size]
[font=宋体][size=12pt]要达成以上策略,就要使得经[/size][/font][size=12pt][font=Times New Roman]R101[/font][/size][font=宋体][size=12pt]到[/size][/font][size=12pt][font=Times New Roman]R103[/font][/size][font=宋体][size=12pt]所通告[/size][/font][size=12pt][font=Times New Roman]192.168.11.0[/font][/size][font=宋体][size=12pt]的[/size][/font][size=12pt][font=Times New Roman]As-Path[/font][/size][font=宋体][size=12pt]比经[/size][/font][size=12pt][font=Times New Roman]R102[/font][/size][font=宋体][size=12pt]到[/size][/font][size=12pt][font=Times New Roman]R104[/font][/size][font=宋体][size=12pt]的[/size][/font][size=12pt][font=Times New Roman]As-Path[/font][/size][font=宋体][size=12pt]短[/size][/font][size=12pt][font=Times New Roman],[/font][/size][font=宋体][size=12pt]则[/size][/font][size=12pt][font=Times New Roman]AS10[/font][/size][font=宋体][size=12pt]就会选择[/size][/font][size=12pt][font=Times New Roman]R103-R101[/font][/size][font=宋体][size=12pt]链路为最佳路径。同样的,经[/size][/font][size=12pt][font=Times New Roman]R102-R104[/font][/size][font=宋体][size=12pt]链路所通告的[/size][/font][size=12pt][font=Times New Roman]192.168.12.0[/font][/size][font=宋体][size=12pt]也要有较短的[/size][/font][size=12pt][font=Times New Roman]As-Path[/font][/size][font=宋体][size=12pt],那么[/size][/font][size=12pt][font=Times New Roman]AS10[/font][/size][font=宋体][size=12pt]就会为去往[/size][/font][size=12pt][font=Times New Roman]AS11[/font][/size]网络192.168.12.0[font=宋体][size=12pt]的流量优选链路[/size][/font][size=12pt]R104-R102[/size][font=宋体][size=12pt]。[/size][/font][size=12pt][/size]
[font=宋体][size=12pt]对于外出的流量,[/size][/font][size=12pt]BGP[/size][font=宋体][size=12pt]会根据通过[/size][/font][size=12pt]eBGP[/size][font=宋体][size=12pt]学得的路由来决定最佳路径,这些路由也可从[/size][/font][size=12pt]iBGP[/size][font=宋体][size=12pt]学到。所以[/size][/font][size=12pt]R101[/size][font=宋体][size=12pt]既可以通过[/size][/font][size=12pt]eBGP[/size][font=宋体][size=12pt]从[/size][/font][size=12pt]R103[/size][font=宋体][size=12pt]学到[/size][/font][size=12pt]10.10.34.0[/size][font=宋体][size=12pt]又可以通过[/size][/font][size=12pt]iBGP[/size][font=宋体][size=12pt]从[/size][/font][size=12pt]R102[/size][font=宋体][size=12pt]学到。但是外部路径优先于内部路径。所以[/size][/font][size=12pt]R101[/size][font=宋体][size=12pt]到[/size][/font][size=12pt]10.10.34.0[/size][font=宋体][size=12pt]的路由会走[/size][/font][size=12pt]R101-R103[/size][font=宋体][size=12pt]链路,下一跳为[/size][/font][size=12pt]10.10.13.3[/size][font=宋体][size=12pt]。[/size][/font][size=12pt]R102[/size][font=宋体][size=12pt]到[/size][/font][size=12pt]10.10.34.0[/size][font=宋体][size=12pt]的路由会走[/size][/font][size=12pt]R102-R104[/size][font=宋体][size=12pt]链路下一跳为[/size][/font][size=12pt]10.10.24.4[/size][font=宋体][size=12pt]。这样便在去往[/size][/font][size=12pt]10.10.34.0[/size]的流量上达到了负载共享的效果。
[font=宋体][size=12pt]top[/size][/font][font=宋体][size=12pt]如下:
[img=553,324]http://www.one-tom.com/bbs/uploads/20070709_163013_image003.jpg[/img]
[align=left][font=宋体][size=12pt] 配置如下:[/size][/font][size=12pt][/size][/align]
[table][tr][td=1,1,468][align=center][size=14pt][b][font=Times New Roman]R101[/font][/b][/size][/align]
[/td][/tr][tr][td=1,1,468][align=left][b][size=11pt][font=Times New Roman]R101(config)#int s1/1[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config-if)#ip add 10.10.13.1 255.255.255.0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config-if)#no sh[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config-if)#int fa0/0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config-if)#ip add 192.168.12.1 255.255.255.0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config-if)#ip add 192.168.11.1 255.255.255.0 sec[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config-if)#no sh[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config)#router bgp 11[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config-router)#no syn[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config-router)#net 192.168.11.0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config-router)#net 192.168.12.0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config-router)#nei 10.10.13.3 remote-as 10[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config-router)#nei 10.10.13.3 route-map R101-R103-MAP out[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config-router)#nei 192.168.12.2 remote-as 11[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config-router)#nei 192.168.12.2 next-hop-self[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config-router)#maximum-paths 2[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config-router)#no auto-summary [/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config-router)#access-list 1 permit 192.168.12.0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config)#access-list 2 per 192.168.11.0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config)#route-map R101-R103-MAP per 10[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config-route-map)#match ip add 1[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config-route-map)#set as-path prepend 11 11 11[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config-route-map)#route-map R101-R103-MAP per 20[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R101(config-route-map)#match ip add 2[/font][/size][/b][/align]
[/td][/tr][tr][td=1,1,468][align=center][b][size=14pt][font=Times New Roman]R102[/font][/size][/b][/align]
[/td][/tr][tr][td=1,1,468][align=left][b][size=11pt][font=Times New Roman]R102(config)#int s1/2[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R102(config-if)#ip add 10.10.24.2 255.255.255.0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R102(config-if)#no sh[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R102(config-if)#int fa0/0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R102(config-if)#ip add 192.168.12.2 255.255.255.0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R102(config-if)#ip add 192.168.11.2 255.255.255.0 sec[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R102(config-if)#no sh[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R102(config)#router bgp 11[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R102(config-router)#no syn[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R102(config-router)#net 192.168.11.0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R102(config-router)#net 192.168.12.0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R102(config-router)#nei 10.10.24.4 remote-as 10[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R102(config-router)#nei 10.10.24.4 route-map R102-R104-MAP out[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R102(config-router)#nei 192.168.12.1 remote-as 11[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R102(config-router)#nei 192.168.12.1 next-hop-self[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R102(config-router)#no auto-summary [/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R102(config-router)#access-list 1 permit 192.168.11.0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R102(config)#access-list 2 per 192.168.12.0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R102(config)#route-map R102-R104-MAP per 10[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R102(config-route-map)#match ip add 1[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R102(config-route-map)#set as-path prepend 11 11 11[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R102(config-route-map)#route-map R102-R104-MAP per 20[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R102(config-route-map)#match ip add 2[/font][/size][/b][/align]
[/td][/tr][tr][td=1,1,468][align=center][b][size=14pt][font=Times New Roman]R103[/font][/size][/b][/align]
[/td][/tr][tr][td=1,1,468][align=left][b][size=11pt][font=Times New Roman]R103(config)#int s1/0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R103(config-if)#ip add 10.10.13.3 255.255.255.0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R103(config-if)#no sh[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R103(config-if)#int fa0/0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R103(config-if)#ip add 10.10.34.3 255.255.255.0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R103(config-if)#no sh[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R103(config)#router bgp 10[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R103(config-router)#no syn[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R103(config-router)#net 10.10.34.0 mask 255.255.255.0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R103(config-router)#nei 10.10.13.1 remote-as 11[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R103(config-router)#nei 10.10.13.1 default-originate[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R103(config-router)#nei 10.10.34.4 remote-as 10[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R103(config-router)#nei 10.10.34.4 next-hop-self[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R103(config-router)#no auto-summary [/font][/size][/b][/align]
[/td][/tr][tr][td=1,1,468][align=center][b][size=14pt][font=Times New Roman]R104[/font][/size][/b][/align]
[/td][/tr][tr][td=1,1,468][align=left][b][size=11pt][font=Times New Roman]R104(config)#int s1/0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R104(config-if)#ip add 10.10.24.4 255.255.255.0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R104(config-if)#no sh[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R104(config-if)#int fa0/0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R104(config-if)#ip add 10.10.34.4 255.255.255.0[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R104(config-if)#no sh[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R104(config)#router bgp 10[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R104(config-router)#no syn[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R104(config-router)#nei 10.10.24.2 remote-as 11[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R104(config-router)#nei 10.10.24.2 default-originate[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R104(config-router)#nei 10.10.34.3 remote-as 10[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R104(config-router)#nei 10.10.34.3 next-hop-self[/font][/size][/b][/align]
[align=left][b][size=11pt][font=Times New Roman]R104(config-router)#no auto-summary [/font][/size][/b][/align]
[align=left][size=12pt][font=Times New Roman] [/font][/size][/align]
[/td][/tr][/table]
[font=Times New Roman]
R101[/font]的[font=Times New Roman]BGP[/font]表中显示所以去往[font=Times New Roman]Internet[/font]的流量都通过链[font=Times New Roman]R101-R103[/font]。
[align=left][size=12pt][font=Times New Roman]R101#sh ip bgp[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]BGP table version is 6, local router ID is 192.168.12.1[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]Status codes: s suppressed, d damped, h history, * valid, > best, i - internal[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]Origin codes: i - IGP, e - EGP, ? - incomplete[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman] [/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]
Network
Next Hop
Metric LocPrf Weight Path[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]* i0.0.0.0
192.168.12.2
100

0 10 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]*>
10.10.13.3
0 10 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]*> 10.10.34.0/24
10.10.13.3
0
0 10 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]* i
192.168.12.2
100
0 10 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]* i192.168.11.0
192.168.12.2
0

100
0 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]*>
0.0.0.0
0
32768 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]* i192.168.12.0
192.168.12.2
0
100
0 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]*>
0.0.0.0
0
32768 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]````````````````````````````````````````````````````````````````````````````````````````````````[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]R101#sh ip ro[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]Gateway of last resort is 10.10.13.3 to network 0.0.0.0[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman] [/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]C
192.168.12.0/24 is directly connected, FastEthernet0/0[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]C
192.168.11.0/24 is directly connected, FastEthernet0/0[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]
10.0.0.0/24 is subnetted, 2 subnets[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]C
10.10.13.0 is directly connected, Serial1/1[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]B
10.10.34.0 [20/0] via 10.10.13.3, 00:02:39[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]B*
0.0.0.0/0 [20/0] via 10.10.13.3, 00:13:01[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]```````````````````````````````````````````````````````````````````````````````````````````````````````[/font][/size][/align]
[align=left][font=Times New Roman]R102[/font]的[font=Times New Roman]BGP[/font]表中显示按照路由策略所以去往[font=Times New Roman]AS10[/font]的流量都通过[font=Times New Roman]R102-R104[/font]。[/align]
[align=left][size=12pt][font=Times New Roman]R102#sh ip bgp [/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]BGP table version is 5, local router ID is 192.168.12.2[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]Status codes: s suppressed, d damped, h history, * valid, > best, i - internal[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]Origin codes: i - IGP, e - EGP, ? - incomplete[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman] [/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]
Network

Next Hop
Metric LocPrf Weight Path[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]*> 0.0.0.0
10.10.24.4
0 10 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]* i
192.168.12.1
100
0 10 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]* i10.10.34.0/24
192.168.12.1
0
100
0 10 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]*>

10.10.24.4
0 10 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]* i192.168.11.0
192.168.12.1
0
100
0 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]*>
0.0.0.0
0
32768 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]* i192.168.12.0
192.168.12.1
0
100
0 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]*>

0.0.0.0
0
32768 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]``````````````````````````````````````````````````````````````````````````````````````````````````[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]R102#sh ip ro[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]Gateway of last resort is 10.10.24.4 to network 0.0.0.0[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman] [/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]C
192.168.12.0/24 is directly connected, FastEthernet0/0[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]C
192.168.11.0/24 is directly connected, FastEthernet0/0[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]
10.0.0.0/24 is subnetted, 2 subnets[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]C
10.10.24.0 is directly connected, Serial1/2[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]B
10.10.34.0 [20/0] via 10.10.24.4, 00:04:12[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]B*
0.0.0.0/0 [20/0] via 10.10.24.4, 00:12:08[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]```````````````````````````````````````````````````````````````````````````````````````````````````````[color=red][/color][/font][/size][/align]
[align=left]验证从[font=Times New Roman]AS10[/font]进入[font=Times New Roman]AS11[/font]的流量。去往网络[font=Times New Roman]192.168.11.0[/font]的流量走链路[font=Times New Roman]R103-R101[/font],去往网络[font=Times New Roman]162.168.12.0[/font]的流量走链路[font=Times New Roman]R104-R102[/font]。[/align]
[align=left][size=12pt][font=Times New Roman]R103#
sh ip bgp[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]BGP table version is 5, local router ID is 10.10.34.3[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]Status codes: s suppressed, d damped, h history, * valid, > best, i - internal[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]Origin codes: i - IGP, e - EGP, ? - incomplete[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman] [/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]
Network
Next Hop
Metric LocPrf Weight Path[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]*> 10.10.34.0/24
0.0.0.0

0
32768 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]*> 192.168.11.0
10.10.13.1
0
0 11 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]*>i192.168.12.0
10.10.34.4
0
100
0 11 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]*
10.10.13.1
0
0 11 11 11 11 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]```````````````````````````````````````````````````````````````````````````````````````````````````````[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]R103#sh ip ro[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman] [/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]Gateway of last resort is not set[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman] [/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]B
192.168.12.0/24 [200/0] via 10.10.34.4, 00:49:14[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]B
192.168.11.0/24 [20/0] via 10.10.13.1, 00:52:36[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]
10.0.0.0/24 is subnetted, 2 subnets[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]C
10.10.13.0 is directly connected, Serial1/0[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]C
10.10.34.0 is directly connected, FastEthernet0/0[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman] [/font][/size][/align]
[align=left]在[font=Times New Roman]R104[/font]上情况相同。[/align]
[align=left][size=12pt][font=Times New Roman]```````````````````````````````````````````````````````````````````````````````````````````````````````[/font][/size][/align]
[align=left]当[font=Times New Roman]R101-R103[/font]的链路失效后,[font=Times New Roman]R102-R104[/font]成为其备分链路[/align]
[align=left][size=12pt][font=Times New Roman]R103(config)#int s1/0[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]R103(config-if)#sh[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]```````````````````````````````````````````````````````````````````````````````````````````````````````[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]R101#sh ip bgp[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]BGP table version is 8, local router ID is 192.168.12.1[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]Status codes: s suppressed, d damped, h history, * valid, > best, i - internal[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]Origin codes: i - IGP, e - EGP, ? - incomplete[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman] [/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]
Network

Next Hop
Metric LocPrf Weight Path[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]*>i0.0.0.0
192.168.12.2
100
0 10 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]*>i10.10.34.0/24
192.168.12.2
100
0 10 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]* i192.168.11.0
192.168.12.2
0
100
0 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]*>

0.0.0.0
0
32768 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]* i192.168.12.0
192.168.12.2
0
100
0 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]*>
0.0.0.0
0
32768 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]R101#sh ip ro[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman] [/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]Gateway of last resort is 192.168.12.2 to network 0.0.0.0[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman] [/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]C
192.168.12.0/24 is directly connected, FastEthernet0/0[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]C
192.168.11.0/24 is directly connected, FastEthernet0/0[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]
10.0.0.0/24 is subnetted, 1 subnets[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]B
10.10.34.0 [200/0] via 192.168.12.2, 00:01:42[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]B*
0.0.0.0/0 [200/0] via 192.168.12.2, 00:01:42[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]```````````````````````````````````````````````````````````````````````````````````````````````````````[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]R103#sh ip bgp[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]BGP table version is 7, local router ID is 10.10.34.3[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]Status codes: s suppressed, d damped, h history, * valid, > best, i - internal[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]Origin codes: i - IGP, e - EGP, ? - incomplete[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman] [/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]
Network
Next Hop
Metric LocPrf Weight Path[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]*> 10.10.34.0/24
0.0.0.0
0
32768 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]*>i192.168.11.0
10.10.34.4
0
100
0 11 11 11 11 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]*>i192.168.12.0
10.10.34.4
0
100
0 11 i[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]R103#sh ip ro[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman] [/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]Gateway of last resort is not set[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman] [/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]B
192.168.12.0/24 [200/0] via 10.10.34.4, 01:09:47[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]B
192.168.11.0/24 [200/0] via 10.10.34.4, 00:14:08[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]
10.0.0.0/24 is subnetted, 1 subnets[/font][/size][/align]
[align=left][size=12pt][font=Times New Roman]C
10.10.34.0 is directly connected, FastEthernet0/0[/font][/size][/align]
[size=12pt]``````````````````````````````````````````````````````````````````````````````````````````````````````[/size]
[b][size=12pt][font=Times New Roman]4.
[/font][/size][/b][color=#0000ff]单台边界路由器多宿主末端网络连接到两个[font=Times New Roman]ISP[/font]环境中的负载共享[/color]
[font=宋体][size=12pt]在次场景中,只针对负载共享做相应的配置。由于[/size][/font][size=12pt][font=Times New Roman]BGP[/font][/size][font=宋体][size=12pt]只会从不同[/size][/font][size=12pt][font=Times New Roman]AS[/font][/size][font=宋体][size=12pt]学来的路由中选择一条最佳的到达目的地所以负载均衡无法完成。可以为从[/size][/font][size=12pt][font=Times New Roman]ISPA[/font][/size][font=宋体][size=12pt]学得的路由[/size][/font][size=12pt][font=Times New Roman]([/font][/size][font=宋体][size=12pt]范围[/size][/font][size=12pt][font=Times New Roman]1.0.0.0[/font][/size][font=宋体][size=12pt]到[/size][/font][size=12pt][font=Times New Roman]128.0.0.0)[/font][/size][font=宋体][size=12pt]以及从[/size][/font][size=12pt][font=Times New Roman]ISPB[/font][/size][font=宋体][size=12pt]学得的其余路由设置较好的[/size][/font][size=12pt][font=Times New Roman]metric[/font][/size][font=宋体][size=12pt]值。[/size][/font][size=12pt][/size]
[size=12pt][font=Times New Roman]top[/font][/size][font=宋体][size=12pt]如下:
[img=553,235]http://www.one-tom.com/bbs/uploads/20070709_163836_image004.jpg[/img][/size][/font][size=12pt][/size]
[/size][/font][/size][/font]


[/font][/size][/b]
[/size]

谁是英雄 2007-11-10 09:50

RouterA

RA(config)#int s1/0

RA(config-if)#ip add 160.20.20.1 255.255.255.0

RA(config-if)#no sh

RA(config-if)#no ip route-cache

RA(config-if)#int s1/2

RA(config-if)#ip add 150.10.10.1 255.255.255.0

RA(config-if)#no sh

RA(config-if)#no ip route-cache

RA(config-if)#router bgp 11

RA(config-router)#nei 160.20.20.2 remote-as 10

RA(config-router)#nei 160.20.20.2 route-map UPDATES0-1 in

RA(config-router)#nei 150.10.10.2 remote-as 12

RA(config-router)#nei 150.10.10.2 route-map UPDATES-2 in

RA(config-router)#auto-summary

RA(config)#route-map UPDATES-1 per 10   

RA(config-route-map)#match ip add 1

RA(config-route-map)#set weight 100

RA(config-route-map)#route-map UPDATES-1 per 20

RA(config-route-map)#match ip add 2

RA(config-route-map)#route-map UPDATES-2 per 10

RA(config-route-map)#match ip add 1

RA(config-route-map)#route-map UPDATES-2 per 20

RA(config-route-map)#match ip add 2

RA(config-route-map)#set weight 100

RA(config-route-map)#access-list 1 per 0.0.0.0 127.255.255.255

RA(config)#access-list 2 deny 0.0.0.0 127.255.255.255

RA(config)#access-list 2 per any         

RouterB

RB(config)#int lo0

RB(config-if)#ip add 2.2.2.2 255.255.255.0

RB(config-if)#int lo1

RB(config-if)#ip add 170.16.6.5 255.255.255.0

RB(config-if)#int s1/2

RB(config-if)#ip add 160.20.20.2 255.255.255.0

RB(config-if)#no ip route-cache

RB(config-if)#no sh

RB(config-if)#router bgp 10

RB(config-router)#nei 160.20.20.1 remote-as 11

RB(config-router)#net 2.0.0.0

RB(config-router)#net 170.16.0.0

RB(config-router)#auto-summary

RouterC

RC(config)#int lo0

RC(config-if)#ip add 170.16.6.6 255.255.255.0

RC(config-if)#int lo1

RC(config-if)#ip add 2.2.2.1 255.255.255.0

RC(config-if)#int s1/2

RC(config-if)#ip add 150.10.10.2 255.255.255.0

RC(config-if)#no ip route-cache

RC(config-if)#no sh

RC(config-if)#router bgp 12

RC(config-router)#nei 150.10.10.1 remote-as 11

RC(config-router)#net 2.0.0.0

RC(config-router)#net 170.16.0.0

RC(config-router)#auto-summary


RouterA从下一跳160.20.20.2(ISPA)学得任何低于128.0.0.0的网络。其余的网络从下一跳150.10.10.2(ISPB)学得。

RA#sh ip ro



Gateway of last resort is not set



B    170.16.0.0/16 [20/0] via 150.10.10.2, 00:26:46

B    2.0.0.0/8 [20/0] via 160.20.20.2, 00:00:12

     160.20.0.0/24 is subnetted, 1 subnets

C       160.20.20.0 is directly connected, Serial1/0

     150.10.0.0/24 is subnetted, 1 subnets

C       150.10.10.0 is directly connected, Serial1/2

```````````````````````````````````````````````````````````````````````````````````````````````````

RA#sh ip bgp

BGP table version is 4, local router ID is 160.20.20.1

Status codes: s suppressed, d damped, h history, * valid, > best, i - internal

Origin codes: i - IGP, e - EGP, ? - incomplete



   Network          Next Hop            Metric LocPrf Weight Path

*> 2.0.0.0          160.20.20.2              0           100 10 i

*                   150.10.10.2              0             0 12 i

*  170.16.0.0       160.20.20.2              0             0 10 i

*>                  150.10.10.2              0           100 12 i

``````````````````````````````````````````````````````````````````````````````````````````````````

5.      多台边界路由器多宿主末端网络连接到两个ISP环境中的负载共享

负载均衡在连接到两个ISP的多宿主网络中是不可能发生的因为BGP只会从不同AS学来的路由中选择一条最佳的到达目的地。但在这种环境下进行负载共享是可以的。基于预先制定的路由策略流量可以被不同的BGP属性所控制。



假设AS100中BGP路由策略是:

●       AS100接收来自两个ISP的本地路由,连同其余一些默认的Inetnet路由。

●       外出流量策略是:

①去往AS300的流量走R1-ISP(A)链路

②去往AS400的流量走R2-ISP(B)链路

③所有其他的流量通过默认路由0.0.0.0走R1-ISP(A)链路

④若R1-ISP(A)链路失效则所有流量走R2-ISP(B)链路

●进入流量的策略是:

①从Inetnet到网络10.10.10.0/24的流量走ISP(A)-R1这条链路。

②从Inetnet到网络10.10.20.0/24的流量走ISP(B)-R2这条链路。

③如果其中一个ISP失效,那么另一个ISP必须路由所有从Intnet返回到AS100的流量。

top如下:




R1和R2的主要配置如下:

R2

interface fa0/0

ip address 192.168.21.2 255.255.255.0

interface Serial0/1

ip address 192.168.42.2 255.255.255.0

router bgp 100

no synchronization

bgp log-neighbor-changes

network 10.10.10.0 mask 255.255.255.0

network 10.10.20.0 mask 255.255.255.0

neighbor 192.168.21.1 remote-as 100

neighbor 192.168.21.1 next-hop-self

neighbor 192.168.42.4 remote-as 400

neighbor 192.168.42.4 route-map AS-400-INCOMING in

neighbor 192.168.42.4 route-map AS-400-OUTGOING out

no auto-summary

ip as-path access-list 1 permit ^400$

access−list 10 permit 10.10.10.0 0.0.0.255

access−list 20 permit 10.10.20.0 0.0.0.255

route-map AS-400-INCOMING permit 10

match as-path 1

set local-preference 150

route-map AS-400-OUTGOING permit 10

match ip address 10

set as-path prepend 100



route-map AS-400-OUTGOING permit 20

match ip address 20

R1

interface Serial0/0

ip address 192.168.31.1 255.255.255.0

interface fa0/0

ip address 192.168.21.1 255.255.255.0

router bgp 100

no synchronization

bgp log−neighbor−changes

network 10.10.10.0 mask 255.255.255.0

network 10.10.20.0 mask 255.255.255.0

neighbor 192.168.21.2 remote−as 100

neighbor 192.168.21.2 next−hop−self

neighbor 192.168.31.3 remote−as 300

neighbor 192.168.31.3 route−map AS−300−INCOMING in

neighbor 192.168.31.3 route−map AS−300−OUTGOING out

no auto−summary

ip as−path access−list 1 permit ^300$

access−list 10 permit 10.10.20.0 0.0.0.255

access−list 20 permit 10.10.10.0 0.0.0.255

route−map AS−300−INCOMING permit 10

match as−path 1

set local−preference 200

route−map AS−300−OUTGOING permit 10

match ip address 10

set as−path prepend 100

route−map AS−300−OUTGOING permit 20

match ip address 20


查看R1的BGP表

R1# show ip bgp



BGP table version is 6, local router ID is 192.168.31.1

Status codes: s suppressed, d damped, h history, * valid, > best, i − internal

Origin codes: i − IGP, e − EGP, ? − incomplete



BGP table version is 6, local router ID is 192.168.31.1

Status codes: s suppressed, d damped, h history, * valid, > best, i − internal

Origin codes: i − IGP, e − EGP, ? − incomplete



Network                 Next Hop                      Metric LocPrf Weight Path

*> 0.0.0.0                     192.168.31.3                                   200           0 300 i

* i10.10.10.0/24             192.168.21.2                          0       100           0 i

*>                                0.0.0.0                                   0                32768 i

* i10.10.20.0/24             192.168.21.2                          0       100           0 i

*>                                0.0.0.0                                   0                32768 i

*> 30.30.30.0/24            192.168.31.3                          0       200           0 300 i

*>i40.40.40.0/24            192.168.21.2                          0       150           0 400 i

`````````````````````````````````````````````````````````````````````````````````````````````````````````````````

    查看 R2:的BGP表

R2# show ip bgp



BGP table version is 8, local router ID is 192.168.42.2

Status codes: s suppressed, d damped, h history, * valid, > best, i − internal

Origin codes: i − IGP, e − EGP, ? − incomplete



Network                  Next Hop                      Metric LocPrf Weight Path

*    0.0.0.0                     192.168.42.4                                   150           0 400 i

*>i                                192.168.21.1                                   200           0 300 i

*> 10.10.10.0/24            0.0.0.0                                   0                32768 i

* i                                 192.168.21.1                          0       100           0 i

*> 10.10.20.0/24            0.0.0.0                                   0                32768 i

* i                                 192.168.21.1                          0       100           0 i

*>i30.30.30.0/24            192.168.21.1                          0       200           0 300 i

*> 40.40.40.0/24            192.168.42.4                          0       150           0 400 i



查看R6上的BGP表显示网络10.10.10.0/24和10.10.20.0/24的进入流量策略

````````````````````````````````````````````````````````````````````````````````````````````````````````````````

R6# show ip bgp



BGP table version is 15, local router ID is 192.168.64.6

Status codes: s suppressed, d damped, h history, * valid, > best, i − internal

Origin codes: i − IGP, e − EGP, ? − incomplete



Network                  Next Hop                      Metric LocPrf Weight Path

*> 10.10.10.0/24            192.168.63.3                                                   0 300 100 100 i

*                                  192.168.64.4                                                   0 400 100 100 100 i

*    10.10.20.0/24           192.168.63.3                                                   0 300 100 100 i

*>                                192.168.64.4                                                   0 400 100 i

*> 30.30.30.0/24            192.168.63.3                          0                        0 300 i

*> 40.40.40.0/24            192.168.64.4                          0                        0 400 i

`````````````````````````````````````````````````````````````````````````````````````````````````````````````````

关闭R1的s0/0

R1(config)# interface serial 0/0

R1(config−if)# shutdown

`````````````````````````````````````````````````````````````````````````````````````````````````````````````````

R1# show ip bgp



BGP table version is 12, local router ID is 192.168.31.1

Status codes: s suppressed, d damped, h history, * valid, > best, i − internal

Origin codes: i − IGP, e − EGP, ? − incomplete



Network                  Next Hop                      Metric LocPrf Weight Path

*>i0.0.0.0                      192.168.21.2                                   150           0 400 i

* i10.10.10.0/24             192.168.21.2                          0       100           0 i

*>                                0.0.0.0                                   0                32768 i

* i10.10.20.0/24             192.168.21.2                          0       100           0 i

*>                                0.0.0.0                                   0                32768 i

*>i40.40.40.0/24            192.168.21.2                          0       150           0 400 i

``````````````````````````````````````````````````````````````````````````````````````````````````````````````

R2# show ip bgp



BGP table version is 14, local router ID is 192.168.42.2

Status codes: s suppressed, d damped, h history, * valid, > best, i − internal

Origin codes: i − IGP, e − EGP, ? − incomplete



Network                  Next Hop                      Metric LocPrf Weight Path

*> 0.0.0.0                     192.168.42.4                                   150           0 400 i

* i10.10.10.0/24             192.168.21.1                          0       100           0 i

*>                                0.0.0.0                                   0                32768 i

* i10.10.20.0/24             192.168.21.1                          0       100           0 i

*>                                0.0.0.0                                   0                32768 i

*> 40.40.40.0/24            192.168.42.4                          0       150           0 400 i

````````````````````````````````````````````````````````````````````````````````````````````````````````````````

查看R6的10.10.10.0/24

R6# show ip bgp



BGP table version is 14, local router ID is 192.168.64.6

Status codes: s suppressed, d damped, h history, * valid, > best, i − internal

Origin codes: i − IGP, e − EGP, ? − incomplete



Network                  Next Hop                      Metric LocPrf Weight Path

*> 10.10.10.0/24            192.168.64.4                                                   0 400 100 100 i

*> 10.10.20.0/24            192.168.64.4                                                   0 400 100 i

*> 30.30.30.0/24            192.168.63.3                          0                        0 300 i

*> 40.40.40.0/24            192.168.64.4                          0                        0 400 i
页: [1]
查看完整版本: BGP负载共享