4-5-1. Cisco dual BGP with Origin Value (Redundancy)

BGP sample configuration 3-1-1

Cisco dual BGP with Origin Value (Redundancy)

   
  • ISPs : 2
  • WAN links : 2
  • CPE : 1
  • 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)
  • LAN / Ethernet IP : 100.100.100.0/24
  • Receiving Route : Default route only from ISP
  • Memory : Full route(recommend 512M), partial route
    (recommend 128-256M)
  • LAN : ISP_A (AS20), ISP_B(AS30), Customer (AS10) and Other ISP(AS50)

 

BGP sample configuration 3-1-1

 [Read it first]

When you have more than two ISP links, Origin attribute option won’t be enough to achieve failover and load-sharing goals. 
why? simply shortest AS path is more prefer attribute than Origin attribute option on BGP selection criteria. 
 
Below example we used AS-Path prepending for inbound traffic on shadow link which is connected to ISP_"B".
 

[Traffic flow]

Outbound traffic on CPE

Both links are receiving default route thru BGP, but on Shadow link CPE put AS prepending once to make less prefer. So outbound traffic will go out to ISP_"A" link all the time.

Inbound traffic  on CPE

All traffic inbound traffic will be routed thru ISP_"A" link, b/c of Origin value is IGP on BGP announcement to ISP_"A" link, but incomplete on other BGP link. See below sample and testing output.

wwwtopology_BGP4-1-1.png

[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
!
ip auth-proxy max-nodata-conns 3
ip admission max-nodata-conns 3
!
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
 serial restart-delay 0
!
interface Serial1/2
 ip address 10.30.1.1 255.255.255.252
 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
 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 need to be advertised to ISP
 neighbor 10.20.1.2 route-map primary-out out
 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 need to be advertised to ISP
 neighbor 10.30.1.2 route-map backup-in in <—– Prepending AS to default route from ISP to make less prefersed to ISP
 neighbor 10.30.1.2 route-map backup-out out
 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 to-ISP seq 5 permit 100.100.100.0/24
!
route-map backup-in permit 10
 set as-path prepend 10

!
route-map primary-out permit 10
 match ip address prefix-list prefix-1
 set origin igp

!
route-map backup-out permit 10
 match ip address prefix-list prefix-1
 set as-path prepend 10

!
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.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 thru BGP
 neighbor 10.20.1.1 route-map no-routes out <——- No BGP routes will be sent to Customer
 neighbor 20.20.1.2 remote-as 20
 no auto-summary
!
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 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 thru BGP
 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
!
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#sh ip bgp nei 10.20.1.2 ad
BGP table version is 5, 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 ?

Total number of prefixes 1

CPE#sh ip bgp nei 10.20.1.2 ro
BGP table version is 5, 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             0 20 i

Total number of prefixes 1

CPE#sh ip bgp nei 10.30.1.2 ad
BGP table version is 5, 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 ?

Total number of prefixes 1


CPE#sh ip bgp nei 10.30.1.2 ro

BGP table version is 5, 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 10 30 i

Total number of prefixes 1
CPE#

 
ISP_B#sh ip bgp 100.100.100.2
BGP routing table entry for 100.100.100.0/24, version 10
Paths: (2 available, best #1, table Default-IP-Routing-Table)
  Not advertised to any peer
  20 10
    20.30.1.1 from 30.30.1.2 (30.50.1.1)
      Origin IGP, metric 0, localpref 100, valid, internal, best
  10 10
    10.30.1.1 from 10.30.1.1 (100.100.100.1)
      Origin incomplete, metric 0, localpref 100, valid, external
 
 
ISP_B#tr 100.100.100.2

Type escape sequence to abort.
Tracing the route to 100.100.100.2

  1 30.30.1.2 72 msec 44 msec 8 msec
  2 20.30.1.1 44 msec 12 msec 12 msec
  3 20.20.1.1 [AS 20] 20 msec 36 msec 24 msec
  4 10.20.1.1 [AS 20] 20 msec 36 msec 20 msec
  5 100.100.100.2 [AS 10] 64 msec *  44 msec
ISP_B#

 
 
TR_B#sh ip bgp 100.100.100.2
BGP routing table entry for 100.100.100.0/24, version 10
Paths: (2 available, best #2, table Default-IP-Routing-Table)
  Advertised to update-groups:
     1          2
  50 20 10
    30.50.1.2 from 30.50.1.2 (30.50.1.2)
      Origin IGP, localpref 100, valid, external
  20 10
    20.30.1.1 from 20.30.1.1 (20.50.1.1)
      Origin IGP, localpref 100, valid, external, best
 
 
TR_B#tr 100.100.100.2

Type escape sequence to abort.
Tracing the route to 100.100.100.2

  1 20.30.1.1 36 msec 44 msec 8 msec
  2 20.20.1.1 [AS 20] 20 msec 20 msec 12 msec
  3 10.20.1.1 [AS 20] 52 msec 16 msec 16 msec
  4  *
    100.100.100.2 [AS 10] 60 msec *

 
 
TR_B#tr 100.100.100.2

Type escape sequence to abort.
Tracing the route to 100.100.100.2

  1 20.30.1.1 80 msec 12 msec 4 msec
  2 20.20.1.1 [AS 20] 20 msec 12 msec 12 msec
  3 10.20.1.1 [AS 20] 16 msec 40 msec 40 msec
  4 100.100.100.2 [AS 10] 56 msec *  32 msec
TR_B#

 
 
ISP_A#sh ip bgp 100.100.100.2
BGP routing table entry for 100.100.100.0/24, version 3
Paths: (1 available, best #1, table Default-IP-Routing-Table)
  Advertised to update-groups:
     1
  10
    10.20.1.1 from 10.20.1.1 (100.100.100.1)
      Origin IGP, metric 0, localpref 100, valid, external, best
ISP_A#

 

TR_A#sh ip bgp 100.100.100.2
BGP routing table entry for 100.100.100.0/24, version 9
Paths: (1 available, best #1, table Default-IP-Routing-Table)
  Advertised to update-groups:
     1
  10
    10.20.1.1 from 20.20.1.1 (20.20.1.1)
      Origin IGP, metric 0, localpref 100, valid, internal, best
TR_A#
 
 
Internet#sh ip bgp 100.100.100.2
BGP routing table entry for 100.100.100.0/24, version 9
Paths: (2 available, best #2, table Default-IP-Routing-Table)
  Advertised to update-groups:
     1
  30 20 10
    30.50.1.1 from 30.50.1.1 (30.50.1.1)
      Origin IGP, localpref 100, valid, external
  20 10
    20.50.1.1 from 20.50.1.1 (20.50.1.1)
      Origin IGP, localpref 100, valid, external, best
Internet#
 
 
Internet#tr 100.100.100.2

Type escape sequence to abort.
Tracing the route to 100.100.100.2

  1 20.50.1.1 52 msec 48 msec 16 msec
  2 20.20.1.1 [AS 20] 20 msec 44 msec 36 msec
  3 10.20.1.1 [AS 20] 20 msec 68 msec 52 msec
  4 100.100.100.2 [AS 10] 20 msec 96 msec *
Internet#

 

 

 [Dynamips testing]

Download and test it yourself with below Dynamips configuration files.

  Dynamips NET file

  Router 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.

Author: Chris Yoon

IT professional