cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
660
Views
5
Helpful
3
Replies

BGP Advertise when Default Route available

tsalt
Level 1
Level 1

I have 2 routers which are Peering using EBGP.

Router B learns a default route from Router A.

Router B advertises 2 prefixes to router A.

I wish to only allow Router B to Advertise these prefixes as lond as Router B is learning a Default Route from Router A (i.e. Router A is the next hop/Neighbor for teh default route).

Is it possible to do this with Prefix Lists and a route-map?

Thanks

Tom

1 Accepted Solution

Accepted Solutions

Harold Ritter
Cisco Employee
Cisco Employee

You can do that using conditional advertisement.

The following example shows how to advertise 192.168.1.0/24 only when 0/0 is being learnt from the peer:

router bgp 1

no synchronization

bgp log-neighbor-changes

network 192.168.1.0

neighbor 192.168.12.2 remote-as 2

neighbor 192.168.12.2 advertise-map ADV exist-map EXIST

no auto-summary

!

access-list 1 permit 192.168.1.0

access-list 2 permit 0.0.0.0

!

route-map ADV permit 10

match ip address 1

!

route-map EXIST permit 10

match ip address 2

!

You are able to see the status of that conditional advertisement by using the show ip bgp neighbor command:

When the condition is met:

R1#sh ip bgp neighbors

BGP neighbor is 192.168.12.2, remote AS 2, external link

..

Condition-map EXIST, Advertise-map ADV, status: Advertise

When the condition is not met:

R1#sh ip bgp neighbors

BGP neighbor is 192.168.12.2, remote AS 2, external link

..

Condition-map EXIST, Advertise-map ADV, status: Withdraw

Hope this helps,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

View solution in original post

3 Replies 3

ruwhite
Level 7
Level 7

You should be able to do this with conditional advertisement:

http://www.cisco.com/en/US/tech/tk365/technologies_configuration_example09186a0080094309.shtml

Just set up the if-exit map so that as long as the default is learned from router A, the local routes are allowed, rather than denied (which I think is possible). If that doesn't work, then conditional route injection should work, instead:

http://www.cisco.com/en/US/products/sw/iosswrel/ps1839/products_feature_guide09186a00800b5d54.html

Because it's "backwards" from conditional advertisement.

HTH.

:-)

Russ.W

Harold Ritter
Cisco Employee
Cisco Employee

You can do that using conditional advertisement.

The following example shows how to advertise 192.168.1.0/24 only when 0/0 is being learnt from the peer:

router bgp 1

no synchronization

bgp log-neighbor-changes

network 192.168.1.0

neighbor 192.168.12.2 remote-as 2

neighbor 192.168.12.2 advertise-map ADV exist-map EXIST

no auto-summary

!

access-list 1 permit 192.168.1.0

access-list 2 permit 0.0.0.0

!

route-map ADV permit 10

match ip address 1

!

route-map EXIST permit 10

match ip address 2

!

You are able to see the status of that conditional advertisement by using the show ip bgp neighbor command:

When the condition is met:

R1#sh ip bgp neighbors

BGP neighbor is 192.168.12.2, remote AS 2, external link

..

Condition-map EXIST, Advertise-map ADV, status: Advertise

When the condition is not met:

R1#sh ip bgp neighbors

BGP neighbor is 192.168.12.2, remote AS 2, external link

..

Condition-map EXIST, Advertise-map ADV, status: Withdraw

Hope this helps,

Harold Ritter
Sr Technical Leader
CCIE 4168 (R&S, SP)
harold@cisco.com
México móvil: +52 1 55 8312 4915
Cisco México
Paseo de la Reforma 222
Piso 19
Cuauhtémoc, Juárez
Ciudad de México, 06600
México

Many Thanks for this help. Will test when next week.

Review Cisco Networking products for a $25 gift card