Sunday, June 26, 2016

BGP Default Routing

BGP default routing could be helpful when a stub AS uses just one uplink or uses primary-backup uplinks scenario. The upstream eBGP peers could be configured to advertise just the default route information. You may inject a default route into BGP by using the  network 0.0.0.0 mask 0.0.0.0 command, as long as there is a default route in the RIB.


To selectively generate a default route, use the command
R1(config-router)#neighbor 15.1.1.5 default-originate


Now We will match a condition to generate a default route to neighbor 15.1.1.5 only if prefix 3.3.3.0/24 is present in the BGP table of R1
R1#
!
router bgp 123
 no synchronization
 bgp log-neighbor-changes
 network 1.1.1.0 mask 255.255.255.0
 neighbor 12.1.1.2 remote-as 123
 neighbor 12.1.1.2 next-hop-self
 neighbor 12.1.1.2 send-community
  neighbor 13.1.1.3 remote-as 123
 neighbor 13.1.1.3 next-hop-self
 neighbor 13.1.1.3 send-community
 neighbor 15.1.1.5 remote-as 500
 neighbor 15.1.1.5 default-originate route-map DEFAULT-ROUTE
 no auto-summary
!
ip prefix-list ROUTE-TO-R3 seq 5 permit 3.3.3.0/24
!
route-map DEFAULT-ROUTE permit 10
 match ip address prefix-list ROUTE-TO-R3


We shut the link to R3 and see that the prefix is no more longer learned


Default route is now no longer exist in the BGP table of R5

No comments:

Post a Comment