Install guide

Filtering IP Routes 2-21
Software Version 2.7.5
C613-10454-00 REV A
Applying Filters When Writing to the RIB
When the router or switch receives information about a route, it normally adds
that route to its RIB. This makes the route available for the router or switch to
use. You can use route filters to stop the router or switch from adding certain
routes—or routes with certain characteristics—into the RIB. This gives you
control over the routes packets take when they leave the router or switch.
Filtering BGP routes when writing to the RIB
Filters act on the BGP update messages that the router or switch receives, or on
the routes within update messages. The different types of filter you can use are
prefix lists
AS path lists
route maps
Applying prefix lists Prefix filtering rejects some of the routes from an update message, without
rejecting the whole update. This enables you to configure the router or switch
to accept only routes for particular networks from a particular peer.
To use a prefix list as a prefix filter, use one of the commands:
add bgp peer=ipadd remoteas=asn [infilter=prefixlist-name]
[other-options]
set bgp peer=ipadd [infilter=prefixlist-name] [other-options]
add bgp peertemplate=1..30 [infilter=prefixlist-name]
[other-options]
set bgp peeertemplate=1..30 [infilter=prefixlist-name]
[other-options]
The infilter parameter uses the prefix list to filter update messages that the
router or switch receives from the peer. If a prefix matches a prefix in the prefix
list, BGP rejects that route. Otherwise, it accepts the route.
The router or switch checks every route in the update message against every
entry in the filter, starting with the entry with the lowest entry number, until it
finds a match or gets to the end of the filter.
You can also use a prefix list in a route map and apply the route map.
Applying AS path
lists
To apply an AS path list directly as a filter on a BGP peer, use the command:
add bgp peer=ipadd remoteas=asn [inpathfilter=1..99]
[outpathfilter=1..99] [other-options]
The inpathfilter parameter applies the AS path list as a filter on update
messages that the router or switch receives from the peer. The router or switch
only accepts update messages if they match an AS path list entry that has the
action include. If an update message matches an entry with the action exclude,
the router or switch rejects the update. If an update message does not match
any entry in the AS path list, the router or switch rejects the update. This is
because each non-empty AS path list ends with an implicit entry that matches
any AS path list and has the action exclude.
You can also use an AS path list in a route map and apply the route map.