From: Bob Sinclair (bob@bobsinclair.net)
Date: Tue Oct 16 2007 - 14:38:52 ART
Koen Zeilstra wrote:
> Hi Group,
>
> Please observe the following (I hope) interesting task.
>
> Advertise a default route to a BGP neighbor conditionally. Watch two
> routes in your routing table. When both routes are present the default
> route should be announced to the neighbor.
>
> I was thinking towards the following direction.
>
> neighbor 10.0.0.1 default-originate route-map checkroutes
> !
> route-map checkroutes
> match ip address 10
> match ip address 20
> !
> access-list 10 permit 1.1.1.1
> access-list 20 permit 2.2.2.2
> !
>
>
> However this route-map results in:
>
> route-map checkroutes
> match ip addres 10 20
> !
>
> Which is an "OR" function afterall and not the "AND" we are looking for.
Koen,
You might want to lab this up. When I do a conditional default using
RIP or BGP the router in fact implements the match as an AND function.
In other words, BOTH must be in the table. Here is an example with BGP:
interface Loopback2
ip address 2.2.2.2 255.255.255.0
!
interface Loopback20
ip address 20.0.0.1 255.0.0.0
shutdown
router bgp 200
no synchronization
bgp log-neighbor-changes
neighbor 172.16.25.5 remote-as 500
neighbor 172.16.25.5 default-originate route-map CONDITIONAL
no auto-summary
access-list 10 permit 2.0.0.0
access-list 20 permit 20.0.0.0
!
route-map CONDITIONAL permit 10
match ip address 10 20
As soon as I shut Loop20, BGP withdraws the default. As soon as I
no-shut it, BGP advertises it.
Yes the route-map 'looks' like an 'or'. But it is in fact implemented
as an 'and' (on my equipment!)
Hth,
--Bob Sinclair CCIE 10427 CCSI 30427 www.netmasterclass.net
This archive was generated by hypermail 2.1.4 : Fri Nov 16 2007 - 13:11:15 ART