4-6-1. Cisco dual BGP with Conditional Announcement
ISPs : 2
WAN links : 2
CPE : 1
GW(PE) : 2
Device :Cisco router with LAN/WAN ports.
WAN1 / Serial IP : 10.20.1.0/30 (mask 255.255.255.252)
WAN2 / Serial IP : 10.30.1.0/30 (mask 255.255.255.252)
Customer LAN IP : 100.100.100.0/24 and 200.200.200.0/24
Receiving Route : Default route
Memory : Full route(recommend 512M), partial route
(recommend 128-256M)
LAN : ISP_"A" (AS20), ISP_"B"(AS30) and Customer (AS10)
[Traffic flow]
Outbound traffic on CPE
All outbound traffic will go out thru WAN link with ISP_"A"(PE) due to we have tagged local-pref 120 on default route from GW(PE) router. WAN link with ISP_"B"(PE) will be less preferred due to local-pref 100(default) until the WAN link down.
Inbound traffic on CPE
Customer routes will be only announced thru WAN link with ISP_"A"(PE) by controlling conditional BGP announcement algorithm. 2nd BGP session with standby WAN link(ISP_"B" will not advertise customer routes unless primary WAN link is down that means Serial IP address/ 10.20.1.0/30 will be dropped from BGP table. As long as the route is disappeared from the BGP table, 2nd BGP will start announcing customer routes, 100.100.100.0/24 and 200.200.200.0/24.
[CPE/Customer Cisco Router]
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname CPE
!
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.20.1.1 255.255.255.252
load-interval 30
serial restart-delay 0
!
interface Serial1/2
ip address 10.30.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 200.200.200.1 255.255.255.0 secondary
ip address 100.100.100.1 255.255.255.0
duplex auto
speed auto
!
router bgp 10
no synchronization
bgp log-neighbor-changes
redistribute connected
neighbor 10.20.1.2 remote-as 20 <--------------------- BGP neighbor to ISP_"A" neighbor 10.20.1.2 prefix-list to-ISP out <------------ Allow only IP block needs to be advertised to ISP neighbor 10.20.1.2 route-map primary-out in <---- Outbound traffic control neighbor 10.30.1.2 remote-as 30 <--------------------- BGP neighbor to ISP_"B" neighbor 10.30.1.2 prefix-list to-ISP out <------------ Allow only IP block needs to be advertised to ISP neighbor 10.30.1.2 advertise-map advertise non-exist-map no-route <------- Inbound traffic control
no auto-summary
!
ip http server
no ip http secure-server
ip forward-protocol nd
!
ip prefix-list prefix-1 seq 5 permit 100.100.100.0/24
!
ip prefix-list prefix-2 seq 5 permit 200.200.200.0/24
!
ip prefix-list to-ISP seq 5 permit 100.100.100.0/24
ip prefix-list to-ISP seq 10 permit 200.200.200.0/24
!
ip prefix-list wan_1 seq 5 permit 10.20.1.0/30 <------- IP address of WAN link with ISP_"A" !
route-map primary-out permit 10
set local-preference 120 <---------------------- Outbound traffic control
!
route-map no-route permit 10
match ip address prefix-list wan_1
!
route-map advertise permit 10
match ip address prefix-list to-ISP
!
control-plane
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
login
!
end
[ISP_"A" GW(PE) / ISP Cisco Router]
version 12.4
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname ISP_A
!
no aaa new-model
memory-size iomem 5
!
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.20.1.2 255.255.255.252
serial restart-delay 0
!
interface Serial1/1
ip address 20.20.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 20
no synchronization
bgp log-neighbor-changes
redistribute connected
neighbor 10.20.1.1 remote-as 10 <-------------------- BGP neighbor to Customer
neighbor 10.20.1.1 default-originate <---------------- Sending default route
neighbor 10.20.1.1 route-map no-routes out <---- Sending no BGP table
neighbor 20.20.1.2 remote-as 20
no auto-summary
!
ip http server
no ip http secure-server
ip forward-protocol nd
!
route-map no-routes deny 10 <--------------------------- Sending no BGP table
!
control-plane
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
login
!
end
[ISP_"B GW(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 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
neighbor 10.30.1.1 default-originate <---------------- Sending default route
neighbor 10.30.1.1 route-map no-routes out <---- Sending no BGP table
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 <--------------------------- Sending no BGP table
!
control-plane
!
line con 0
exec-timeout 0 0
logging synchronous
line aux 0
line vty 0 4
login
!
end
[Dynamips testing]
Download and test it yourself with below Dynamips configuration files.
Dynamips NET file
Router configuration files
[Verifing output]
CPE#sh ip bgp 0.0.0.0
BGP routing table entry for 0.0.0.0/0, version 28
Paths: (2 available, best #1, table Default-IP-Routing-Table)
Not advertised to any peer
20
10.20.1.2 from 10.20.1.2 (20.20.1.1)
Origin IGP, metric 0, localpref 120, valid, external, best
30
10.30.1.2 from 10.30.1.2 (30.30.1.1)
Origin IGP, metric 0, localpref 100, valid, external
CPE#sh ip bgp nei 10.20.1.2 ad
BGP table version is 30, 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, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 100.100.100.0/24 0.0.0.0 0 32768 ?
*> 200.200.200.0 0.0.0.0 0 32768 ?
Total number of prefixes 2
CPE#sh ip bgp nei 10.20.1.2 ro
BGP table version is 30, 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, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 0.0.0.0 10.20.1.2 0 120 0 20 i
Total number of prefixes 1
CPE#sh ip bgp nei 10.30.1.2 ad
Total number of prefixes 0
CPE#sh ip bgp nei 10.30.1.2 ro
BGP table version is 30, 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, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
* 0.0.0.0 10.30.1.2 0 0 30 i
Total number of prefixes 1
CPE#
ISP_A#sh ip bgp nei 10.20.1.1 ro
BGP table version is 45, local router ID is 20.20.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, ? - incomplete
When WAN Link 1 is down, see below routing changes. It will take a time to complete conversion
CPE#sh ip bgp 0.0.0.0
BGP routing table entry for 0.0.0.0/0, version 31
Paths: (1 available, best #1, table Default-IP-Routing-Table)
Not advertised to any peer
30
10.30.1.2 from 10.30.1.2 (30.30.1.1)
Origin IGP, metric 0, localpref 100, valid, external, best
CPE#sh ip bgp nei 10.30.1.2 ad
BGP table version is 34, 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, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 100.100.100.0/24 0.0.0.0 0 32768 ?
*> 200.200.200.0 0.0.0.0 0 32768 ?
Total number of prefixes 2
CPE#sh ip bgp nei 10.30.1.2 ro
BGP table version is 34, 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, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*> 0.0.0.0 10.30.1.2 0 0 30 i
Total number of prefixes 1
CPE#
ISP_B#sh ip bgp neighbors 10.30.1.1 ro
BGP table version is 65, 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, ? - incomplete
If you have any questions, feel free to send email us at
This e-mail address is being protected from spambots. You need JavaScript enabled to view it
. 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.