White Papers

Table Of Contents
Filtering BGP Routes Using AS-PATH Information
To filter routes based on AS-PATH information, use these commands.
1. Create an AS-PATH ACL and assign it a name.
CONFIGURATION mode
ip as-path access-list as-path-name
2. Create an AS-PATH ACL filter with a deny or permit action.
AS-PATH ACL mode
{deny | permit} as-regular-expression
3. Return to CONFIGURATION mode.
AS-PATH ACL
exit
4. Enter ROUTER BGP mode.
CONFIGURATION mode
router bgp as-number
5. Filter routes based on the criteria in the configured route map.
CONFIG-ROUTER-BGP mode
neighbor {ip-address | peer-group-name} filter-list as-path-name {in | out}
Configure the following parameters:
ip-address or peer-group-name: enter the neighbors IP address or the peer groups name.
as-path-name: enter the name of a configured AS-PATH ACL.
in: apply the AS-PATH ACL map to inbound routes.
out: apply the AS-PATH ACL to outbound routes.
To view which commands are configured, use the show config command in CONFIGURATION ROUTER BGP mode and the
show ip as-path-access-list command in EXEC Privilege mode.
To forward all routes not meeting the AS-PATH ACL criteria, include the permit .* filter in your AS-PATH ACL.
Redistributing Routes
In addition to filtering routes, you can add routes from other routing instances or protocols to the BGP process. With the
redistribute command, you can include ISIS, OSPF, static, or directly connected routes in the BGP process.
To add routes from other routing instances or protocols, use any of the following commands in ROUTER BGP mode.
Include, directly connected or user-configured (static) routes in BGP.
ROUTER BGP or CONF-ROUTER_BGPv6_ AF mode
redistribute {connected | static} [route-map map-name]
Configure the map-name parameter to specify the name of a configured route map.
Include specific ISIS routes in BGP.
ROUTER BGP or CONF-ROUTER_BGPv6_ AF mode
redistribute isis [level-1 | level-1-2 | level-2] [metric value] [route-map map-name]
Configure the following parameters:
level-1, level-1-2, or level-2: Assign all redistributed routes to a level. The default is level-2.
metric value: The value is from 0 to 16777215. The default is 0.
map-name: name of a configured route map.
Include specific OSPF routes in IS-IS.
ROUTER BGP or CONF-ROUTER_BGPv6_ AF mode
redistribute ospf process-id [match external {1 | 2} | match internal] [metric-type
{external | internal}] [route-map map-name]
Border Gateway Protocol IPv4 (BGPv4)
183