
Cisco dual BGP with eBGP (Failover)
|
|
[Traffic flow]
In this sample, we assumed both CPEs are receiving default route from ISPs and it will make outbound traffic flow to WAN link that is directly connected. Meaning outbound traffic associated with 100.100.100.0/24 will be routed to ISP_"A" and traffic associated with 200.200.200.0/24 will be routed to ISP_"B". CPE1 and CPE2 are announcing default route learned from each ISP. It will be less preferred path for outbound traffic. See below example to better understand it. When one of WAN links is failed, outbound traffic is going thru Point-to-point circuit between CPE1 and CPE2. Yes, it supports failover.
All inbound traffic associated with 100.100.100.0/24 will be routed thru ISP_"A" and 200.200.200.0/24 will be routed thru ISP_"B". One of lines is failed, other link will take both traffic. See below example and testing output. The below example configuration will also cover failover situation.
[CPE_1/Customer Cisco Router]
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname CPE_1
!
ip cef
no ip domain lookup
!
interface FastEthernet0/0
no ip address
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial1/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/1
ip address 10.30.1.1 255.255.255.252
load-interval 30
serial restart-delay 0
!
interface Serial1/2
ip address 10.20.1.1 255.255.255.252
load-interval 30
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
interface FastEthernet2/0
ip address 100.100.100.1 255.255.255.0
duplex auto
speed auto
!
router bgp 10
no synchronization
bgp log-neighbor-changes
network 100.100.100.0 mask 255.255.255.0
network 200.200.200.0
redistribute connected
neighbor 10.20.1.2 remote-as 20 <—————— BGP neighbor to CPE_2
neighbor 10.20.1.2 timers 3 20 <——————— BGP keepalive & hold timer
neighbor 10.20.1.2 prefix-list to-CPE-2 out <—— Filtering BGP announcement to CPE_2
neighbor 10.30.1.2 remote-as 30 <—————— BGP neighbor to ISP_"A"
neighbor 10.30.1.2 timers 3 20 <——————— BGP keepalive & hold timer
neighbor 10.30.1.2 prefix-list to-ISP out <——— Filtering BGP announcement to ISP_"A"
no auto-summary
!
ip http server
no ip http secure-server
ip forward-protocol nd
!
ip prefix-list to-CPE-2 seq 5 permit 0.0.0.0/0 <—— Filtering BGP announcement to CPE_2
ip prefix-list to-CPE-2 seq 10 permit 100.100.100.0/24
!
ip prefix-list to-ISP seq 5 permit 100.100.100.0/24 <——— Filtering BGP announcement to ISP_"A"
ip prefix-list to-ISP seq 10 permit 200.200.200.0/24
!
control-plane
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
login
!
end
[CPE_2/Customer Cisco Router]
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname CPE_2
!
ip cef
no ip domain lookup
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial1/0
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/1
ip address 20.40.1.1 255.255.255.252
load-interval 30
serial restart-delay 0
!
interface Serial1/2
ip address 10.20.1.2 255.255.255.252
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
interface FastEthernet2/0
ip address 200.200.200.1 255.255.255.0
duplex auto
speed auto
!
router bgp 20
no synchronization
bgp log-neighbor-changes
network 100.100.100.0 mask 255.255.255.0
network 200.200.200.0
redistribute connected
neighbor 10.20.1.1 remote-as 10 <—————— BGP neighbor to CPE_1
neighbor 10.20.1.1 timers 3 20 <——————— BGP keepalive & hold timer
neighbor 10.20.1.1 prefix-list to-CPE-1 out <—— Filtering BGP announcement to CPE_1
neighbor 20.40.1.2 remote-as 40 <—————— BGP neighbor to ISP_"B"
neighbor 20.40.1.2 timers 3 20 <——————— BGP keepalive & hold timer
neighbor 20.40.1.2 prefix-list to-ISP out <——— Filtering BGP announcement to ISP_"B"
no auto-summary
!
ip http server
no ip http secure-server
ip forward-protocol nd
!
ip prefix-list to-CPE-1 seq 5 permit 0.0.0.0/0 <—— Filtering BGP announcement to CPE_1
ip prefix-list to-CPE-1 seq 10 permit 200.200.200.0/24 le 32
!
ip prefix-list to-ISP seq 5 permit 100.100.100.0/24 <——— Filtering BGP announcement to ISP_"B"
ip prefix-list to-ISP seq 10 permit 200.200.200.0/24
!
control-plane
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
login
!
end
[ISP_A PE/ISP Cisco Router]
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname ISP_A
!
ip cef
no ip domain lookup
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial1/0
ip address 10.30.1.2 255.255.255.252
serial restart-delay 0
!
interface Serial1/1
ip address 30.30.1.1 255.255.255.252
serial restart-delay 0
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
router bgp 30
no synchronization
bgp log-neighbor-changes
redistribute connected
neighbor 10.30.1.1 remote-as 10 <———————– BGP neighbor to Customer office A
neighbor 10.30.1.1 default-originate <——————- Sending default route
neighbor 10.30.1.1 route-map no-routes out <——- No BGP routes will be sent to Customer
neighbor 30.30.1.2 remote-as 30
no auto-summary
!
ip http server
no ip http secure-server
ip forward-protocol nd
!
route-map no-routes deny 10 <——- No BGP routes will be sent to Customer
!
control-plane
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
login
!
end
[ISP_B PE / ISP Cisco Router]
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname ISP_B
!
ip cef
no ip domain lookup
!
interface FastEthernet0/0
no ip address
shutdown
duplex auto
speed auto
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial1/0
ip address 20.40.1.2 255.255.255.252
serial restart-delay 0
!
interface Serial1/1
ip address 40.40.1.1 255.255.255.252
serial restart-delay 0
!
interface Serial1/2
no ip address
shutdown
serial restart-delay 0
!
interface Serial1/3
no ip address
shutdown
serial restart-delay 0
!
router bgp 40
no synchronization
bgp log-neighbor-changes
redistribute connected
neighbor 20.40.1.1 remote-as 20 <———————– BGP neighbor to Customer Office B
neighbor 20.40.1.1 default-originate <——————- Sending default route
neighbor 20.40.1.1 route-map no-routes out <——- No BGP routes will be sent to Customer
neighbor 40.40.1.2 remote-as 40
no auto-summary
!
ip http server
no ip http secure-server
ip forward-protocol nd
!
route-map no-routes deny 10 <——- No BGP routes will be sent to Customer
!
control-plane
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
login
!
end
[Verifing output]
CPE_1#sh ip bgp nei 10.30.1.2 ro
BGP table version is 10, local router ID is 100.100.100.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incompleteNetwork Next Hop Metric LocPrf Weight Path
*> 0.0.0.0 10.30.1.2 0 0 30 iTotal number of prefixes 1
CPE_1#sh ip bgp nei 10.30.1.2 ad
BGP table version is 10, local router ID is 100.100.100.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incompleteNetwork Next Hop Metric LocPrf Weight Path
*> 100.100.100.0/24 0.0.0.0 0 32768 i
*> 200.200.200.0 10.20.1.2 0 0 20 iTotal number of prefixes 2
CPE_1#sh ip bgp nei 10.20.1.2 ro
BGP table version is 10, local router ID is 100.100.100.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incompleteNetwork Next Hop Metric LocPrf Weight Path
* 0.0.0.0 10.20.1.2 0 20 40 i
*> 200.200.200.0 10.20.1.2 0 0 20 iTotal number of prefixes 2
CPE_1#sh ip bgp nei 10.20.1.2 ad
BGP table version is 10, local router ID is 100.100.100.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incompleteNetwork Next Hop Metric LocPrf Weight Path
*> 0.0.0.0 10.30.1.2 0 0 30 i
*> 100.100.100.0/24 0.0.0.0 0 32768 iTotal number of prefixes 2
CPE_1#CPE_2#sh ip bgp nei 20.40.1.2 ro
BGP table version is 13, local router ID is 200.200.200.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incompleteNetwork Next Hop Metric LocPrf Weight Path
*> 0.0.0.0 20.40.1.2 0 0 40 iTotal number of prefixes 1
CPE_2#sh ip bgp nei 20.40.1.2 ad
BGP table version is 13, local router ID is 200.200.200.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incompleteNetwork Next Hop Metric LocPrf Weight Path
*> 100.100.100.0/24 10.20.1.1 0 0 10 i
*> 200.200.200.0 0.0.0.0 0 32768 iTotal number of prefixes 2
CPE_2#sh ip bgp nei 10.20.1.1 ro
BGP table version is 13, local router ID is 200.200.200.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incompleteNetwork Next Hop Metric LocPrf Weight Path
* 0.0.0.0 10.20.1.1 0 10 30 i
*> 100.100.100.0/24 10.20.1.1 0 0 10 iTotal number of prefixes 2
CPE_2#sh ip bgp nei 10.20.1.1 ad
BGP table version is 13, local router ID is 200.200.200.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incompleteNetwork Next Hop Metric LocPrf Weight Path
*> 0.0.0.0 20.40.1.2 0 0 40 i
*> 200.200.200.0 0.0.0.0 0 32768 iTotal number of prefixes 2
CPE_2#ISP_A#sh ip bgp nei 10.30.1.1 ro
BGP table version is 32, local router ID is 30.30.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incompleteNetwork Next Hop Metric LocPrf Weight Path
*> 100.100.100.0/24 10.30.1.1 0 0 10 i
*> 200.200.200.0 10.30.1.1 0 10 20 iTotal number of prefixes 2
ISP_A#ISP_B#sh ip bgp nei 20.40.1.1 ro
BGP table version is 28, local router ID is 40.40.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incompleteNetwork Next Hop Metric LocPrf Weight Path
*> 100.100.100.0/24 20.40.1.1 0 20 10 i
*> 200.200.200.0 20.40.1.1 0 0 20 iTotal number of prefixes 2
ISP_B#
TR_A#sh ip bgp 100.100.100.0
BGP routing table entry for 100.100.100.0/24, version 29
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Advertised to update-groups:
1
10
10.30.1.1 from 30.30.1.1 (30.30.1.1)
Origin IGP, metric 0, localpref 100, valid, internal, bestTR_A#sh ip bgp 200.200.200.0
BGP routing table entry for 200.200.200.0/24, version 32
Paths: (3 available, best #2, table Default-IP-Routing-Table)
Advertised to update-groups:
1 2
50 40 20
30.50.1.2 from 30.50.1.2 (40.50.1.2)
Origin IGP, localpref 100, valid, external
40 20
30.40.1.2 from 30.40.1.2 (40.50.1.1)
Origin IGP, localpref 100, valid, external, best
10 20
10.30.1.1 from 30.30.1.1 (30.30.1.1)
Origin IGP, metric 0, localpref 100, valid, internal
TR_A#TR_B#sh ip bgp 200.200.200.0
BGP routing table entry for 200.200.200.0/24, version 27
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Advertised to update-groups:
2
20
20.40.1.1 from 40.40.1.1 (40.40.1.1)
Origin IGP, metric 0, localpref 100, valid, internal, bestTR_B#sh ip bgp 100.100.100.0
BGP routing table entry for 100.100.100.0/24, version 24
Paths: (3 available, best #3, table Default-IP-Routing-Table)
Advertised to update-groups:
1 2
20 10
20.40.1.1 from 40.40.1.1 (40.40.1.1)
Origin IGP, metric 0, localpref 100, valid, internal
50 30 10
40.50.1.2 from 40.50.1.2 (40.50.1.2)
Origin IGP, localpref 100, valid, external
30 10
30.40.1.1 from 30.40.1.1 (30.50.1.1)
Origin IGP, localpref 100, valid, external, best
TR_B#
Other_ISP#sh ip bgp 100.100.100.0
BGP routing table entry for 100.100.100.0/24, version 31
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Advertised to update-groups:
1
40 30 10
40.50.1.1 from 40.50.1.1 (40.50.1.1)
Origin IGP, localpref 100, valid, external
30 10
30.50.1.1 from 30.50.1.1 (30.50.1.1)
Origin IGP, localpref 100, valid, external, bestOther_ISP#tr 100.100.100.2
Type escape sequence to abort.
Tracing the route to 100.100.100.21 30.50.1.1 64 msec 64 msec 8 msec
2 30.30.1.1 [AS 30] 16 msec 16 msec 12 msec
3 10.30.1.1 [AS 30] 24 msec 32 msec 16 msec
4 100.100.100.2 [AS 10] 48 msec * 88 msecOther_ISP#sh ip bgp 200.200.200.0
BGP routing table entry for 200.200.200.0/24, version 34
Paths: (2 available, best #1, table Default-IP-Routing-Table)
Advertised to update-groups:
1
40 20
40.50.1.1 from 40.50.1.1 (40.50.1.1)
Origin IGP, localpref 100, valid, external, best
30 40 20
30.50.1.1 from 30.50.1.1 (30.50.1.1)
Origin IGP, localpref 100, valid, externalOther_ISP#tr 200.200.200.2
Type escape sequence to abort.
Tracing the route to 200.200.200.21 40.50.1.1 68 msec 32 msec 12 msec
2 40.40.1.1 [AS 40] 12 msec 32 msec 12 msec
3 20.40.1.1 [AS 40] 16 msec 20 msec 16 msec
4 200.200.200.2 [AS 20] 56 msec * 104 msec
Other_ISP#
Once WAN link is failed, see below output
CPE_1#sh ip bgp nei 10.30.1.2 ro
Total number of prefixes 0
CPE_1#sh ip bgp nei 10.30.1.2 ad
Total number of prefixes 0
CPE_1#sh ip bgp nei 10.20.1.2 ro
BGP table version is 12, local router ID is 100.100.100.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incompleteNetwork Next Hop Metric LocPrf Weight Path
*> 0.0.0.0 10.20.1.2 0 20 40 i
*> 200.200.200.0 10.20.1.2 0 0 20 iTotal number of prefixes 2
CPE_1#sh ip bgp nei 10.20.1.2 ad
BGP table version is 12, local router ID is 100.100.100.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incompleteNetwork Next Hop Metric LocPrf Weight Path
*> 100.100.100.0/24 0.0.0.0 0 32768 iTotal number of prefixes 1
CPE_1#CPE_2#sh ip bgp nei 20.40.1.2 ro
BGP table version is 13, local router ID is 200.200.200.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incompleteNetwork Next Hop Metric LocPrf Weight Path
*> 0.0.0.0 20.40.1.2 0 0 40 iTotal number of prefixes 1
CPE_2#sh ip bgp nei 20.40.1.2 ad
BGP table version is 13, local router ID is 200.200.200.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incompleteNetwork Next Hop Metric LocPrf Weight Path
*> 100.100.100.0/24 10.20.1.1 0 0 10 i
*> 200.200.200.0 0.0.0.0 0 32768 iTotal number of prefixes 2
CPE_2#sh ip bgp nei 10.20.1.1 ro
BGP table version is 13, local router ID is 200.200.200.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incompleteNetwork Next Hop Metric LocPrf Weight Path
*> 100.100.100.0/24 10.20.1.1 0 0 10 iTotal number of prefixes 1
CPE_2#sh ip bgp nei 10.20.1.1 ad
BGP table version is 13, local router ID is 200.200.200.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incompleteNetwork Next Hop Metric LocPrf Weight Path
*> 0.0.0.0 20.40.1.2 0 0 40 i
*> 200.200.200.0 0.0.0.0 0 32768 iTotal number of prefixes 2
CPE_2#ISP_A#sh ip bgp nei 10.30.1.1 ro
Total number of prefixes 0
ISP_A#ISP_B#sh ip bgp nei 20.40.1.1 ro
BGP table version is 30, local router ID is 40.40.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i – internal,
r RIB-failure, S Stale
Origin codes: i – IGP, e – EGP, ? – incompleteNetwork Next Hop Metric LocPrf Weight Path
*> 100.100.100.0/24 20.40.1.1 0 20 10 i
*> 200.200.200.0 20.40.1.1 0 0 20 iTotal number of prefixes 2
ISP_B#TR_A#sh ip bgp 100.100.100.0
BGP routing table entry for 100.100.100.0/24, version 35
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Advertised to update-groups:
1 2
50 40 20 10
30.50.1.2 from 30.50.1.2 (40.50.1.2)
Origin IGP, localpref 100, valid, external
40 20 10
30.40.1.2 from 30.40.1.2 (40.50.1.1)
Origin IGP, localpref 100, valid, external, bestTR_A#sh ip bgp 200.200.200.0
BGP routing table entry for 200.200.200.0/24, version 32
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Advertised to update-groups:
1 2
50 40 20
30.50.1.2 from 30.50.1.2 (40.50.1.2)
Origin IGP, localpref 100, valid, external
40 20
30.40.1.2 from 30.40.1.2 (40.50.1.1)
Origin IGP, localpref 100, valid, external, best
TR_A#TR_B#sh ip bgp 100.100.100.0
BGP routing table entry for 100.100.100.0/24, version 28
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Advertised to update-groups:
2
20 10
20.40.1.1 from 40.40.1.1 (40.40.1.1)
Origin IGP, metric 0, localpref 100, valid, internal, bestTR_B#sh ip bgp 200.200.200.0
BGP routing table entry for 200.200.200.0/24, version 27
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Advertised to update-groups:
2
20
20.40.1.1 from 40.40.1.1 (40.40.1.1)
Origin IGP, metric 0, localpref 100, valid, internal, best
TR_B#Other_ISP#sh ip bgp 100.100.100.0
BGP routing table entry for 100.100.100.0/24, version 37
Paths: (2 available, best #2, table Default-IP-Routing-Table)
Advertised to update-groups:
1
30 40 20 10
30.50.1.1 from 30.50.1.1 (30.50.1.1)
Origin IGP, localpref 100, valid, external
40 20 10
40.50.1.1 from 40.50.1.1 (40.50.1.1)
Origin IGP, localpref 100, valid, external, best
Other_ISP#tr 100.100.100.2
Type escape sequence to abort.
Tracing the route to 100.100.100.21 40.50.1.1 72 msec 68 msec 8 msec
2 40.40.1.1 [AS 40] 16 msec 28 msec 12 msec
3 20.40.1.1 [AS 40] 16 msec 20 msec 16 msec
4 10.20.1.1 20 msec 36 msec 28 msec
5 100.100.100.2 [AS 10] 64 msec * 68 msec
Other_ISP#
[Dynamips testing]
Download and test it yourself with below Dynamips configuration files.
If you have any questions, feel free to send email us at [email protected]. If you are looking for professional grade service, you might want to try our "BGP experts service". What is "BGP Experts service"? Click "BGP Experts" from the top menu option. You will find out what the "BGP Experts" and what we are doing here for.
Recent Comments