[56cto网友原创]14.BGP中的负载均衡
来源: 作者: 发布时间:2008-12-28 阅读次数

 

BGP对其BGP表中的路由是必须选出一条最优的,但可以对最终放到路由表中的路由做负载均衡。

R1配置:

r1#show running-config | b r b

router bgp 1

 no synchronization

 bgp log-neighbor-changes

 network 1.1.1.0 mask 255.255.255.0

 neighbor 12.1.1.2 remote-as 2

 neighbor 13.1.1.2 remote-as 2

 maximum-paths 2(此时看到BGP表中还是只有一条最优的路由被标记但是有负载均衡的2条路由被放进路由表中!)

 no auto-summary

R2配置:

r2#show running-config | b r b

router bgp 2

 no synchronization

 bgp log-neighbor-changes

 network 2.2.2.0 mask 255.255.255.0

 neighbor 12.1.1.1 remote-as 1

 neighbor 23.1.1.2 remote-as 2

 neighbor 23.1.1.2 next-hop-self(保证R3可以通过R2学到1.1.1.0/24的路由条目)

 no auto-summary

R3配置:

r3#show running-config | b r b

router bgp 2

 no synchronization

 bgp log-neighbor-changes

 neighbor 13.1.1.1 remote-as 1

 neighbor 23.1.1.1 remote-as 2

maximum-paths 2(没有任何效果)

 no auto-summary

 

R1的路由表和BGP表:

r1#show ip bgp

BGP table version is 8, local router ID is 1.1.1.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

*> 1.1.1.0/24       0.0.0.0                  0         32768 i

*> 2.2.2.0/24       13.1.1.2                               0 2 i

*                   12.1.1.2                 0             0 2 i

r1#show ip route

     1.0.0.0/24 is subnetted, 1 subnets

C       1.1.1.0 is directly connected, Loopback0

     2.0.0.0/24 is subnetted, 1 subnets

B       2.2.2.0 [20/0] via 12.1.1.2, 00:06:48

                [20/0] via 13.1.1.2, 00:05:52

     12.0.0.0/24 is subnetted, 1 subnets

C       12.1.1.0 is directly connected, Serial1/0

     13.0.0.0/24 is subnetted, 1 subnets

C       13.1.1.0 is directly connected, Serial1/1

 

我们可以得到这样的结论:

做负载均衡的两条(或更高的)路径必须是EBGP属性,经我测试一条EBGP,一条IBGP是不可以的,2IBGP也是不可以的。BGP表中还是一条最优的路径被选择就是11条选录原则 但是命令maximum-paths可以对最终放进路由表中的路由进行负载均衡

 

上一篇:[56cto网友尾巴原创]路由反射器 联邦综合实验  
下一篇:[56cto网友原创]15.下一跳可达