IBGP负载分担
根据路由选路原则前面9条相同时(下一跳度量值同) 两种负载分担:
one.双链路的IBGP迭代负载
two.不同链路开启负载(IBGP负载分担) 命令:
[r1-bgp]maximum load-balancing ?
INTEGER<1-32> Specify maximum equal cost routes ebgp EBGP routes as equal cost route ibgp IBGP routes as equal cost route
[r1-bgp]load-balancing as-path-ignore 可选当到
AS外
使能
思路:BGP默认不负载分担,R1上到4.4.4.4的路由BGP中通过R3/R2学到2条,但IP路由表只有一条.
开启IBGP负载分担在R1上看4.4.4.4是否负载分担,4.4.4.4是AS外的路由,注意要忽略路径.
没开负载R1/R4路由(没有负载)
开启负载后.
R1
EBGP负载分担
EBGP多跳负载分担(最多2跳,默认EBGP一跳)
思路:利用环回地址建立EBGP关系,静态指定两端的路由,利用IGP的路由迭代实现负载实际是IGP的负载分担。 命令—peer x.x.x.x ebgp-max-hop 2
拓扑:
r1 #
interface LoopBack0
ip address 1.1.1.1 255.255.255.255 # bgp 100
router-id 1.1.1.1
peer 2.2.2.2 as-number 200 peer 2.2.2.2 ebgp-max-hop 2
peer 2.2.2.2 connect-interface LoopBack0 #
ipv4-family unicast undo synchronization peer 2.2.2.2 enable #
ip route-static 2.2.2.2 255.255.255.255 192.168.1.2 ip route-static 2.2.2.2 255.255.255.255 192.168.2.2 #
r2 #
interface LoopBack0
ip address 2.2.2.2 255.255.255.255 #
interface LoopBack100
ip address 3.3.3.3 255.255.255.255 # bgp 200
router-id 2.2.2.2
peer 1.1.1.1 as-number 100 peer 1.1.1.1 ebgp-max-hop 2
peer 1.1.1.1 connect-interface LoopBack0 #
ipv4-family unicast undo synchronization
network 3.3.3.3 255.255.255.255 peer 1.1.1.1 enable #
ip route-static 1.1.1.1 255.255.255.255 192.168.1.1 ip route-static 1.1.1.1 255.255.255.255 192.168.2.1 #