Install guide
Filtering IP Routes 2-35
Software Version 2.7.5
C613-10454-00 REV A
Filtering When Writing BGP Routes to the RIB:
Using a Route Map
This example extends the basic BGP configuration shown in Basic BGP
Configuration in the BGP chapter of the Software Reference, which connects
two routers or switches as EBGP peers and gives:
■ Router or Switch A an IP address of 10.0.0.2 and AS number of 65000
■ Router or Switch B an IP address of 10.0.0.1 and AS number of 65001
This example uses the inroutemap filter on a BGP peer. The inroutemap filter
is applied after all other filters have acted on an update message. This
particular route map filters received BGP update messages on the basis of their
AS path attributes. It acheives the same effect as the first part of the previous
“Filtering When Writing BGP Routes to the RIB: Using an AS Path Filter”
example.
Route map filters are sometimes more useful than path filters because route
maps can modify the attributes of a received BGP update message. Path filters
only include or exclude messages. However, this example does not
demonstrate how to modify the message attributes, because it is meaningless
to modify attributes and then discard the message.
To set Router or Switch A to filter out update messages that originate
from AS 300
1. Add an AS path list entry.
add ip aspathlist=1 entry=1 include="300$"
2. Add a route map entry.
add ip routemap=as300 entry=1 match aspathlist=1
action=exclude
This entry matches AS paths that are included in the path list, and excludes
them.
3. Apply the AS path list to the BGP peer.
set bgp peer=10.0.0.1 inroutemap=as300
By default, the router or switch uses all update messages from this peer
that do not match the route map.