R2-R3间有3条L3的链路互联,并且R2-R3间通过这3条链路分别都起eBGP. 通过R3向R2发布1条BGP路由,
通过BGP 负载均衡配置调节负载均衡链路数。
一、未配置均衡前,会选最优路由
R2# show run
Building configuration...
Current configuration : 1994 bytes
!
! Last configuration change at 16:20:43 UTC Wed Aug 9 2017
upgrade fpd auto
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R2
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
!
!
!
!
no ip domain lookup
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
redundancy
!
!
ip tcp synwait-time 5
!
!
!
!
!
!
!
!
!
!
interface Loopback0
!
interface FastEthernet0/0
!
interface FastEthernet1/0
!
interface FastEthernet1/1
!
interface FastEthernet2/0
!
interface FastEthernet2/1
!
!
router ospf 1
!
router bgp 64512
ip forward-protocol nd
no ip http server
no ip http secure-server
!
!
!
!
ip prefix-list Filter-Summary-Network seq 1 permit 4.2.1.0/24
ip prefix-list Filter-Summary-Network seq 10 permit 4.3.1.1/32
ip prefix-list Filter-Summary-Network seq 20 permit 4.3.1.0/24
no cdp log mismatch duplex
!
route-map Filter-Summary-Network permit 10
!
!
!
control-plane
!
!
!
mgcp profile default
!
!
!
gatekeeper
!
!
line con 0
line aux 0
line vty 0 4
!
!
end
R2#
show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
+ - replicated route, % - next hop override
Gateway of last resort is not set
1.0.0.0/32 is subnetted, 1 subnets
O E2
1.1.1.1 [110/20] via 12.1.1.1, 00:20:25, FastEthernet0/0
1.1.1.1 [110/20] via 12.1.1.1, 00:20:25, FastEthernet0/0
2.0.0.0/32 is subnetted, 1 subnets
C
2.2.2.2 is directly connected, Loopback0
2.2.2.2 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
O IA
3.3.3.3 [110/2] via 23.1.1.2, 00:20:20, FastEthernet1/0
4.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
O IA
4.2.1.0/24 [110/3] via 23.1.1.2, 00:20:20, FastEthernet1/0
4.2.1.0/24 [110/3] via 23.1.1.2, 00:20:20, FastEthernet1/0
O IA
4.3.1.1/32 [110/3] via 23.1.1.2, 00:20:20, FastEthernet1/0
4.3.1.1/32 [110/3] via 23.1.1.2, 00:20:20, FastEthernet1/0
12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C
12.1.1.0/30 is directly connected, FastEthernet0/0
12.1.1.0/30 is directly connected, FastEthernet0/0
L
12.1.1.2/32 is directly connected, FastEthernet0/0
12.1.1.2/32 is directly connected, FastEthernet0/0
23.0.0.0/8 is variably subnetted, 6 subnets, 2 masks
C
23.1.1.0/30 is directly connected, FastEthernet1/0
23.1.1.0/30 is directly connected, FastEthernet1/0
L
23.1.1.1/32 is directly connected, FastEthernet1/0
23.1.1.1/32 is directly connected, FastEthernet1/0
C
23.2.1.0/30 is directly connected, FastEthernet1/1
23.2.1.0/30 is directly connected, FastEthernet1/1
L
23.2.1.1/32 is directly connected, FastEthernet1/1
23.2.1.1/32 is directly connected, FastEthernet1/1
C
23.3.1.0/30 is directly connected, FastEthernet2/0
23.3.1.0/30 is directly connected, FastEthernet2/0
L
23.3.1.1/32 is directly connected, FastEthernet2/0
23.3.1.1/32 is directly connected, FastEthernet2/0
34.0.0.0/30 is subnetted, 1 subnets
O IA
34.1.1.0 [110/2] via 23.1.1.2, 00:20:21, FastEthernet1/0
34.1.1.0 [110/2] via 23.1.1.2, 00:20:21, FastEthernet1/0
100.0.0.0/24 is subnetted, 1 subnets
B 100.1.1.0 [20/0] via 23.1.1.2, 00:00:18
B
101.1.1.0 [20/0] via 23.1.1.2, 00:00:18
101.1.1.0 [20/0] via 23.1.1.2, 00:00:18
R2#
R3#show run
Building configuration...
Current configuration : 1828 bytes
!
! Last configuration change at 16:14:28 UTC Wed Aug 9 2017
upgrade fpd auto
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname R3
!
boot-start-marker
boot-end-marker
!
!
!
no aaa new-model
no ip icmp rate-limit unreachable
!
!
!
!
!
!
no ip domain lookup
ip cef
no ipv6 cef
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
redundancy
!
!
ip tcp synwait-time 5
!
!
!
!
!
!
!
!
!
!
interface Loopback0
!
interface FastEthernet0/0
!
interface FastEthernet1/0
!
interface FastEthernet1/1
!
interface FastEthernet2/0
!
interface FastEthernet2/1
!
!
router ospf 1
!
router bgp 58000
!
ip forward-protocol nd
no ip http server
no ip http secure-server
!
!
ip route 100.1.1.0 255.255.255.0 34.1.1.2
!
no cdp log mismatch duplex
!
!
!
control-plane
!
!
!
mgcp profile default
!
!
!
gatekeeper
!
!
line con 0
line aux 0
line vty 0 4
!
!
end
二、有3条BGP路由时,但配置最大均衡链路数为2,仅选择并安装2条等价BGP路由
R2#show run | be router bgp
router bgp 64512
maximum-paths 2
!
R2#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
Gateway of last resort is not set
O E2
1.1.1.1 [110/20] via 12.1.1.1, 00:24:33, FastEthernet0/0
1.1.1.1 [110/20] via 12.1.1.1, 00:24:33, FastEthernet0/0
C
2.2.2.2 is directly connected, Loopback0
2.2.2.2 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
O IA
3.3.3.3 [110/2] via 23.1.1.2, 00:24:28, FastEthernet1/0
3.3.3.3 [110/2] via 23.1.1.2, 00:24:28, FastEthernet1/0
O IA
4.2.1.0/24 [110/3] via 23.1.1.2, 00:24:28, FastEthernet1/0
4.2.1.0/24 [110/3] via 23.1.1.2, 00:24:28, FastEthernet1/0
O IA
4.3.1.1/32 [110/3] via 23.1.1.2, 00:24:28, FastEthernet1/0
4.3.1.1/32 [110/3] via 23.1.1.2, 00:24:28, FastEthernet1/0
C
12.1.1.0/30 is directly connected, FastEthernet0/0
12.1.1.0/30 is directly connected, FastEthernet0/0
L
12.1.1.2/32 is directly connected, FastEthernet0/0
12.1.1.2/32 is directly connected, FastEthernet0/0
C
23.1.1.0/30 is directly connected, FastEthernet1/0
23.1.1.0/30 is directly connected, FastEthernet1/0
L
23.1.1.1/32 is directly connected, FastEthernet1/0
23.1.1.1/32 is directly connected, FastEthernet1/0
C
23.2.1.0/30 is directly connected, FastEthernet1/1
23.2.1.0/30 is directly connected, FastEthernet1/1
L
23.2.1.1/32 is directly connected, FastEthernet1/1
23.2.1.1/32 is directly connected, FastEthernet1/1
C
23.3.1.0/30 is directly connected, FastEthernet2/0
23.3.1.0/30 is directly connected, FastEthernet2/0
L
23.3.1.1/32 is directly connected, FastEthernet2/0
23.3.1.1/32 is directly connected, FastEthernet2/0
O IA
34.1.1.0 [110/2] via 23.1.1.2, 00:24:29, FastEthernet1/0
34.1.1.0 [110/2] via 23.1.1.2, 00:24:29, FastEthernet1/0
B
R2#
三、配置最大均衡链路数为3时,等价路由数变为3条:
R2(config)#router bgp 64512
R2(config-router)#
maximum-paths 3
maximum-paths 3
R2#show ip route
*Aug
9 16:25:43.607: %SYS-5-CONFIG_I: Configured from console by console
R2#show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
Gateway of last resort is not set
O E2
1.1.1.1 [110/20] via 12.1.1.1, 00:25:10, FastEthernet0/0
1.1.1.1 [110/20] via 12.1.1.1, 00:25:10, FastEthernet0/0
C
2.2.2.2 is directly connected, Loopback0
2.2.2.2 is directly connected, Loopback0
O IA
3.3.3.3 [110/2] via 23.1.1.2, 00:25:05, FastEthernet1/0
3.3.3.3 [110/2] via 23.1.1.2, 00:25:05, FastEthernet1/0
O IA
4.2.1.0/24 [110/3] via 23.1.1.2, 00:25:05, FastEthernet1/0
4.2.1.0/24 [110/3] via 23.1.1.2, 00:25:05, FastEthernet1/0
O IA
4.3.1.1/32 [110/3] via 23.1.1.2, 00:25:05, FastEthernet1/0
4.3.1.1/32 [110/3] via 23.1.1.2, 00:25:05, FastEthernet1/0
C
12.1.1.0/30 is directly connected, FastEthernet0/0
12.1.1.0/30 is directly connected, FastEthernet0/0
L
12.1.1.2/32 is directly connected, FastEthernet0/0
12.1.1.2/32 is directly connected, FastEthernet0/0
C
23.1.1.0/30 is directly connected, FastEthernet1/0
23.1.1.0/30 is directly connected, FastEthernet1/0
L
23.1.1.1/32 is directly connected, FastEthernet1/0
23.1.1.1/32 is directly connected, FastEthernet1/0
C
23.2.1.0/30 is directly connected, FastEthernet1/1
23.2.1.0/30 is directly connected, FastEthernet1/1
L
23.2.1.1/32 is directly connected, FastEthernet1/1
23.2.1.1/32 is directly connected, FastEthernet1/1
C
23.3.1.0/30 is directly connected, FastEthernet2/0
23.3.1.0/30 is directly connected, FastEthernet2/0
L
23.3.1.1/32 is directly connected, FastEthernet2/0
23.3.1.1/32 is directly connected, FastEthernet2/0
O IA
34.1.1.0 [110/2] via 23.1.1.2, 00:25:05, FastEthernet1/0
34.1.1.0 [110/2] via 23.1.1.2, 00:25:05, FastEthernet1/0
B 100.1.1.0 [20/0] via 23.3.1.2, 00:00:02
R2#