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 172.28.23.0/24 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 0.0.0.0 255.255.255.255 area 0

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

i access-list 10 permit 172.28.23.0 0.0.0.255 access-list 20 deny 10.1.3.0 0.0.0.255 access-list 20 permit any access-list 30 permit 10.1.3.0 0.0.0.255

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 10.1.1.1 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 172.28.23.0/24 network up in its routing table:

D(config)#int si

D(config-if)#shut

%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

172.28.0.0/16 is subnetted, 1 subnets

Was this article helpful?

0 0

Post a comment