Case Study Conditional Advertisement

It's often useful to conditionally advertise some routes to upstream neighbors — particularly if you are trying to control which link is crossed by traffic destined to a particular network. (Refer to "Case Study: Dual-Homed Connections to the Internet" for an example.)

BGP has the capability to conditionally advertise routes; look at Figure 8-8 and work through the example that follows.

Figure 8-8 Conditional Advertisement

Figure 8-8 Conditional Advertisement

In this case, you want to advertise to Router B as long as that link is up, but if it fails, you want to advertise this route to Router A from Router C.

Here, you would build a normal eBGP neighbor relationship between Routers B and D and a normal iBGP neighbor relationship between Routers C and D. The only magic is on Router C. Take a look at Router C's configuration:

C#sho running-config

Building configuration...

i router ospf 100 network area 0

i router bgp 100 network mask neighbor remote-as 200 neighbor distribute-list 20 out neighbor advertise-map toadvertise non-exist-map ifnotexist neighbor remote-as 100

i access-list 10 permit access-list 20 deny access-list 20 permit any access-list 30 permit

route-map ifnotexist permit 10 match ip address 30

i route-map ifnotexist deny 20 i route-map toadvertise permit 10 match ip address 10

The magic is in the neighbor advertise-map toadvertise non-exist-map ifnotexist configuration statement. This tells BGP to advertise those networks permitted by the route map toadvertise if the networks matched by route map ifnotexist aren't in the BGP table.

To see if it works, you need to shut down the link from Router B to Router D and see if Router A picks the network up in its routing table:

D(config)#int si


%LINEPROTO-5-UPDOWN: Line protocol on Interface Seriali, changed state to down

%LINK-5-CHANGED: Interface Seriali, changed state to administratively down

A>sho ip route is subnetted, 1 subnets

Was this article helpful?

0 0

Post a comment