BGP Multipath for IPv4
BGP supports multipath for IPv4 prefixes. BGP Multipath allows load-balancing traffic among multiple BGP routes. It supports both iBGP and eBGP routes. In case of eBGP, the routes should arrive from same AS number.
Topology
Figure 53. Multipath iBGP for IPv4
Configuration
Rtr1
|
#configure terminal |
Enter the Configure mode. |
|
(config)#router bgp 100 |
Assign the ASN value (100) to the BGP router. |
|
(config-router)#bgp router-id 2.2.2.2 |
Configure a fixed Router ID (2.2.2.2). |
|
(config-router)#neighbor 30.30.30.9 remote-as 100 |
Configure neighbor 30.30.30.9 for iBGP. |
|
(config-router)# address-family ipv4 unicast |
.Under address family, Redistribute the static routes. |
|
(config-router-af)#redistribute static |
Redistribute the static routes. |
|
config-router-af)# neighbor 30.30.30.9 activate |
Activate the neighbor |
|
(config-router-af)#exit-address-family |
Exit address-family mode. |
|
(config-router)#exit |
Exit the BGP Router mode and return to the Configure mode. |
|
(config)#ip route 88.88.0.0/16 Null |
Configure static route. |
|
(config)#commit |
Commit the candidate configuration to the running configuration. |
Rtr3
|
#configure terminal |
Enter the Configure mode. |
|
(config)#router bgp 100 |
Assign the ASN value (100) to the BGP router. |
|
(config-router)#bgp router-id 4.4.4.4 |
Configure a fixed Router ID (4.4.4.4). |
|
(config-router)#neighbor 40.40.40.9 remote-as 100 |
Configure neighbor 40.40.40.9 for iBGP. |
|
(config-router)# address-family ipv4 unicast |
Enter address-family ipv4 unicast mode |
|
(config-router-af)#redistribute static |
Redistribute the static routes. |
|
config-router-af)# neighbor 40.40.40.9 activate |
Activate the neighbor |
|
(config-router-af)#exit-address-family |
Exit address-family mode |
|
(config-router)#exit |
Exit the BGP Router mode and return to the Configure mode. |
|
(config)#ip route 88.88.0.0/16 Null |
Configure static route. |
|
(config)#commit |
Commit the candidate configuration to the running configuration. |
Rtr4
|
#configure terminal |
Enter the Configure mode. |
|
(config)#router bgp 100 |
Assign the ASN value (100) to the BGP router. |
|
(config-router)#bgp router-id 6.6.6.6 |
Configure a fixed Router ID (6.6.6.6). |
|
(config-router)#neighbor 50.50.50.9 remote-as 100 |
Configure neighbor 50.50.50.9 for iBGP. |
|
(config-router)# address-family ipv4 unicast |
Enter address-family ipv4 unicast mode |
|
(config-router-af)#redistribute static |
Redistribute the static routes. |
|
config-router-af)# neighbor 50.50.50.9 activate |
Activate the neighbor |
|
(config-router-af)#exit-address-family |
Exit address-family mode |
|
(config-router)#exit |
Exit the BGP Router mode and return to the Configure mode. |
|
(config)#ip route 88.88.0.0/16 Null |
Configure static route. |
|
(config-router)#commit |
Commit the candidate configuration to the running configuration. |
Rtr2
|
#configure terminal |
Enter the Configure mode. |
|
(config)#router bgp 100 |
Assign the ASN value (100) to the BGP router. |
|
(config)#bgp router-id 9.9.9.9 |
Configure a fixed Router ID (9.9.9.9). |
|
(config-router)#neighbor 30.30.30.2 remote-as 100 |
Configure neighbor 30.30.30.2 for iBGP. |
|
(config-router)#neighbor 40.40.40.4 remote-as 100 |
Configure neighbor 40.40.40.4 for iBGP. |
|
(config-router)#neighbor 50.50.50.6 remote-as 100 |
Configure neighbor 50.50.50.6 for iBGP. |
|
(config-router)#address-family ipv4 unicast |
Enter address-family ipv4 unicast mode |
|
config-router-af)# neighbor 30.30.30.2 activate |
Activate the neighbor |
|
config-router-af)# neighbor 40.40.40.4 activate |
Activate the neighbor |
|
config-router-af)# neighbor 50.50.50.6 activate |
Activate the neighbor |
|
config-router-af)# max-paths ibgp 2 |
Configure iBGP max-paths (2). |
|
(config-router-af)#exit-address-family |
Exit address-family mode |
|
(config-router)#commit |
Commit the candidate configuration to the running configuration. |
Validation
#show ip bgp 88.88.0.0
BGP routing table entry for 88.88.0.0/16
Paths: (3 available, best #1, table Default-IP-Routing-Table) Not advertised to any peer
Local
30.30.30.2 from 30.30.30.2 (2.2.2.2)
Origin incomplete, metric 0, localpref 100, valid, internal, multipath- candidate, installed, best
Last update: Wed Mar 2 15:17:38 2016
Local
50.50.50.6 from 50.50.50.6 (6.6.6.6)
Origin incomplete, metric 0, localpref 100, valid, internal, multipath- candidate
Last update: Wed Mar 2 15:23:58 2016
Local
40.40.40.4 from 40.40.40.4 (4.4.4.4)
Origin incomplete, metric 0, localpref 100, valid, internal, multipath- candidate, installed
Last update: Wed Mar 2 15:21:45 2016
#show ip route
Codes: K - kernel, C - connected, S - static, R - RIP, B - BGP 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, L1 - IS-IS level-1, L2 - IS-IS level-2,
ia - IS-IS inter area, E - EVPN, v - vrf leaked
* - candidate default
IP Route Table for VRF "default"
C 30.30.30.0/24 is directly connected, eth1, 00:15:04 C 40.40.40.0/24 is directly connected, eth6, 00:14:30 C 50.50.50.0/24 is directly connected, eth3, 00:14:46 B 88.88.0.0/16 [200/0] via 40.40.40.4, eth6, 00:02:58
[200/0] via 30.30.30.2, eth1
C 127.0.0.0/8 is directly connected, lo, 00:19:21
C 192.168.52.0/24 is directly connected, eth0, 00:19:16 Gateway of last resort is not set
Gateway of last resort is not set
#show running-config router bgp
!
router bgp 100
bgp router-id 9.9.9.9
neighbor 30.30.30.2 remote-as 100
neighbor 40.40.40.4 remote-as 100
neighbor 50.50.50.6 remote-as 100
!
address-family ipv4 unicast
max-paths ibgp 2
neighbor 30.30.30.2 activate
neighbor 40.40.40.4 activate
neighbor 50.50.50.6 activate
exit-address-family
!