cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
569
Views
0
Helpful
4
Replies

DEFAULT route advertisement via BGP - Conditional

csco10851021
Level 1
Level 1

 

I have requriment to advertise default route to BGP peer only if DEF route is present in routing table.

 

     R1-ISP (1.1.1.1)..............(1.1.1.2) CE1 (2.2.2.1)----------(2.2.2.2)CE2

 

- Default route is configured on CE - #ip route 0.0.0.0 0.0.0.0 1.1.1.1

- There is iBGP between CE1 and CE2 

 

We want CE1 to advertise Default route to CE2 only when

 - CE1 has default route in his routing table OR 

 - Has reachability to 8.8.8.8.

 

Will following configuration suffice on CE1-

 

ip sla 1
icmp-echo 1.1.1.1 source-ip 1.1.1.2
frequency 5
!
ip sla 2
icmp-echo 8.8.8.8 source-ip 1.1.1.2
frequency 5
!
!
track 1 ip sla 1
!
track 2 ip sla 2
!
track 3 list boolean or
object 1
object 2
!
!
ip route 0.0.0.0 0.0.0.0 1.1.1.1 tag 101 track 3
!
router bgp 10
neighbor CE2 remote-as 20
!
address-family ipv4
redistribute static route-map INTERNET-DEF-ROUTE
neighbor CE2 activate
default-information originate
exit-address-family
!
route-map INTERNET-DEF-ROUTE permit 10
match tag 101
!

 

4 Replies 4

Giuseppe Larosa
Hall of Fame
Hall of Fame

Hello,

your configuration looks like correct to achieve the desired behaviour.

only note that if CE1 and CE2 should be iBGP CE2 should use the same AS number as declared in CE1 router bgp 10.

 

The key point is to avoid to configure default-originate under the neighbor.

 

See the following notes from command reference:

Usage Guidelines

The default-information originate command is used to configure a BGP routing process to advertise a default route (network 0.0.0.0). A redistribution statement must also be configured to complete this configuration or the default route will not be advertised.

The configuration of the default-information originate command in BGP is similar to the configuration of the network (BGP) command. The default-information originate command, however, requires explicit redistribution of the route 0.0.0.0. The network command requires only that the route 0.0.0.0 is present in the Interior Gateway Protocol (IGP) routing table. For this reason, the network command is preferred.


Note The default-information originate command should not be configured with the neighbor default-originate command on the same router. You should configure one or the other.

 

see on

https://www.cisco.com/c/en/us/td/docs/ios/iproute_bgp/command/reference/irg_book/irg_bgp2.html

 

The redistribution of the static route is needed ,an alternate configuration would be the use of network 0.0.0.0 instead of redistribution + default-information originate under route bgp process.

 

Hope to help

Giuseppe

 

Hello,

 

the below should work as well:

 

track 1 ip sla 1 reachability
!
ip sla 1
icmp-echo 8.8.8.8 source-ip 1.1.1.2
threshold 1000
timeout 2000
frequency 2
ip sla schedule 1 life forever start-time now
!
event manager applet BGP_DEFAULT_DOWN
event track 1 state down
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "router bgp 2"
action 4.0 cli command "no neighbor 2.2.2.2 default-originate"
action 5.0 cli command "end"
!
event manager applet BGP_DEFAULT_UP
event track 1 state up
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "router bgp 2"
action 4.0 cli command "neighbor 2.2.2.2 default-originate"
action 5.0 cli command "end"

This device access is controlled by TACACS. Do i need to provision separate account to run event manager script ?

Hello,

 

the EEM script is part of thr running configuration, it doesn't require special TACACS permission.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: