BGP多链路负载均衡配置

2018年7月1日00:22:24

BGP多链路负载均衡配置

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
ip address 2.2.2.2 255.255.255.255
!
interface FastEthernet0/0
ip address 12.1.1.2 255.255.255.252
duplex half
!
interface FastEthernet1/0
ip address 23.1.1.1 255.255.255.252
duplex auto
speed auto
!
interface FastEthernet1/1
ip address 23.2.1.1 255.255.255.252
duplex auto
speed auto
!
interface FastEthernet2/0
ip address 23.3.1.1 255.255.255.252
duplex auto
speed auto
!
interface FastEthernet2/1
no ip address
shutdown
duplex auto
speed auto
!
!
router ospf 1
router-id 2.2.2.2
area 1 filter-list prefix Filter-Summary-Network in
redistribute connected subnets
network 12.1.1.0 0.0.0.3 area 1
network 23.1.1.0 0.0.0.3 area 0
!
router bgp 64512
bgp log-neighbor-changes
 neighbor 23.1.1.2 remote-as 58000
 neighbor 23.2.1.2 remote-as 58000
 neighbor 23.3.1.2 remote-as 58000
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
match ip address prefix-list Filter-Summay-Network
!
!
!
control-plane
!




!
!
mgcp profile default
!
!
!
gatekeeper
shutdown
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line vty 0 4
login
transport input all
!
!
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
2.0.0.0/32 is subnetted, 1 subnets
C
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
O IA
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
L
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
L
23.1.1.1/32 is directly connected, FastEthernet1/0
C
23.2.1.0/30 is directly connected, FastEthernet1/1
L
23.2.1.1/32 is directly connected, FastEthernet1/1
C
23.3.1.0/30 is directly connected, FastEthernet2/0
L
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
100.0.0.0/24 is subnetted, 1 subnets
B        100.1.1.0 [20/0] via 23.1.1.2, 00:00:18
      101.0.0.0/24 is subnetted, 1 subnets
B
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
ip address 3.3.3.3 255.255.255.255
!
interface FastEthernet0/0
ip address 23.1.1.2 255.255.255.252
duplex half
!
interface FastEthernet1/0
ip address 34.1.1.1 255.255.255.252
duplex auto
speed auto
!
interface FastEthernet1/1
ip address 23.2.1.2 255.255.255.252
duplex auto
speed auto
!
interface FastEthernet2/0
ip address 23.3.1.2 255.255.255.252
duplex auto
speed auto
!
interface FastEthernet2/1
no ip address
shutdown
duplex auto
speed auto
!
!
router ospf 1
router-id 3.3.3.3
area 2 range 4.2.1.0 255.255.255.0
network 3.3.3.3 0.0.0.0 area 2
network 23.1.1.0 0.0.0.3 area 0
network 34.1.1.0 0.0.0.3 area 2
!
router bgp 58000
bgp log-neighbor-changes
 network 100.1.1.0 mask 255.255.255.0
 network 101.1.1.0 mask 255.255.255.0
 neighbor 23.1.1.1 remote-as 64512
 neighbor 23.2.1.1 remote-as 64512
 neighbor 23.3.1.1 remote-as 64512
!
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
shutdown
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
stopbits 1
line vty 0 4
login
transport input all
!
!
end
R3#
二、有3条BGP路由时,但配置最大均衡链路数为2,仅选择并安装2条等价BGP路由
R2#show run | be router bgp
router bgp 64512
bgp log-neighbor-changes
neighbor 23.1.1.2 remote-as 58000
neighbor 23.2.1.2 remote-as 58000
neighbor 23.3.1.2 remote-as 58000

maximum-paths 2
!
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:24:33, FastEthernet0/0
2.0.0.0/32 is subnetted, 1 subnets
C
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
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:24:28, FastEthernet1/0
O IA
4.3.1.1/32 [110/3] via 23.1.1.2, 00:24:28, 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
L
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
L
23.1.1.1/32 is directly connected, FastEthernet1/0
C
23.2.1.0/30 is directly connected, FastEthernet1/1
L
23.2.1.1/32 is directly connected, FastEthernet1/1
C
23.3.1.0/30 is directly connected, FastEthernet2/0
L
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:24:29, FastEthernet1/0
100.0.0.0/24 is subnetted, 1 subnets
B

 100.1.1.0 [20/0] via 23.3.1.2, 00:01:14

                          [20/0] via 23.1.1.2, 00:01:14
R2#
三、配置最大均衡链路数为3时,等价路由数变为3条:
R2(config)#router bgp 64512
R2(config-router)#
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
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:25:10, FastEthernet0/0
2.0.0.0/32 is subnetted, 1 subnets
C
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:25:05, 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:25:05, FastEthernet1/0
O IA
4.3.1.1/32 [110/3] via 23.1.1.2, 00:25:05, 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
L
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
L
23.1.1.1/32 is directly connected, FastEthernet1/0
C
23.2.1.0/30 is directly connected, FastEthernet1/1
L
23.2.1.1/32 is directly connected, FastEthernet1/1
C
23.3.1.0/30 is directly connected, FastEthernet2/0
L
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:25:05, FastEthernet1/0
100.0.0.0/24 is subnetted, 1 subnets
B        100.1.1.0 [20/0] via 23.3.1.2, 00:00:02
                         [20/0] via 23.2.1.2, 00:00:02
                         [20/0] via 23.1.1.2, 00:00:02
R2#

  • 更新时间:2018年7月1日00:22:24 ,共 8221 字。