cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1245
Views
15
Helpful
7
Replies

BGP conditional advertisement

Elopower123
Level 1
Level 1

Hi,

I have two ISPs and I would like to only advertise a specific network on my side to ISP 2 only when ISP 1 is down. Both ISPs only advertise the summarised route of 0.0.0.0/0 in my BGP connection with them. I'm trying to create a conditional advertisement but I'm having issues with the non-exist part as I don't know which network to use in verifying the reach-ability of my ISP 1.

Any help would be greatly appreciated.

1 Accepted Solution

Accepted Solutions

Hello
Using the same prefix for conditional route advertisement using bgp advertised and non-exist maps may not work unless you specify the source ip also, But it should work based on different prefixes in the rib, However given the example below, 0.0.0.0/0 should be advertised if the default from 20.20.20.0/24 doesn’t exist in the route table.

Example:
ip prefix-list 10 permit 0.0.0.0/0
ip prefix-list 11 permit 10.10.10.1/32

ip prefix-list 20 permit 0.0.0.0/0
ip prefix-list 21 permit 20.20.20.1/32

 

route-map ADV
match ip address prefix-list 10
match ip source-ip prefix-list 11


route-map NO_ADV
match ip address prefix-list 20
match ip source-ip prefix-list 21

router bgp x
neigbour x.x.x. advertise-map ADV non-exist-map NO_ADV


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

View solution in original post

7 Replies 7

Cristian Matei
VIP Alumni
VIP Alumni

Hi,

 

    Post the IP addresses of your ISP's that you use to peer BGP with. Post the prefixes that you want to advertise, and specify which one(s) do you want to advertise conditionally, if which BGP peer fails.

 

Regards,

Cristian Matei.

ISP 1 : 10.10.10.0/30

ISP 2 : 20.20.20.0/30

 

I would like to advertise 100.100.100.0/24 to ISP 1 only if ISP 2 is down

 

Hello,

 

based on what you are saying, I wonder if a conditional route works. Since you get only the default route, from both ISPs, that default route will always exist (if one ISP is down, the other still sends the same (default) route). So you cannot match on the only route you get, the default route, because it is always existing.

 

An alternative would be a simple SLA. When one ISP is down, the route you want to add gets added, if the ISP is back up, the route will be removed. A generic sample config is below:

 

track 1 ip sla 1 reachability
!
interface GigabitEthernet0/0
description Link to ISP 1
ip address 100.100.100.1 255.255.255.252
ip nat outside
!
interface GigabitEthernet0/1
description Link to ISP 2
ip address 200.200.200.1 255.255.255.252
ip nat outside
!
ip sla 1
icmp-echo 8.8.8.8 source-ip 100.100.100.1
timeout 1000
threshold 2
frequency 3
!
ip sla schedule 1 life forever start-time now
!
event manager applet ROUTE_INJECT_DOWN
even track 1 state down
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "ip route 150.150.150.0 255.255.255.0 200.200.200.2"
action 4.0 cli command "end"
action 5.0 cli command "clear ip nat translations *"
!
event manager applet ROUTE_INJECT_UP
even track 1 state up
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "no ip route 150.150.150.0 255.255.255.0 200.200.200.2"
action 4.0 cli command "end"
action 5.0 cli command "clear ip nat translations *"

Hello
Using the same prefix for conditional route advertisement using bgp advertised and non-exist maps may not work unless you specify the source ip also, But it should work based on different prefixes in the rib, However given the example below, 0.0.0.0/0 should be advertised if the default from 20.20.20.0/24 doesn’t exist in the route table.

Example:
ip prefix-list 10 permit 0.0.0.0/0
ip prefix-list 11 permit 10.10.10.1/32

ip prefix-list 20 permit 0.0.0.0/0
ip prefix-list 21 permit 20.20.20.1/32

 

route-map ADV
match ip address prefix-list 10
match ip source-ip prefix-list 11


route-map NO_ADV
match ip address prefix-list 20
match ip source-ip prefix-list 21

router bgp x
neigbour x.x.x. advertise-map ADV non-exist-map NO_ADV


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

Hi Paul,

Thanks for your suggestion, I'll try this out.

Thanks very much Paul,

 

Your suggestion worked. I tweaked the config in a few places like on the route map for the non-exist map, I used the "match ip route-source prefix-list xx" command instead.

 

So thanks for your help.

Hi Paul,

 

I have other networks that I would like to advertise to both ISPs simultaneously, I'd like to know if conditionally advertising one of the networks using the configuration below will affect the other networks as well.

 

Thanks

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: