number to the AS-path attribute. The AS-path attribute is the list of ASs that a route has
passed through to reach a destination.
To filter routes based on the AS-path, define the access list with the
ip as-path access-list
command, and apply the list to routes received from or passed to a neighbor with the
neighbor filter-list
command. AS-path access lists use regular expressions to describe
the AS path to be matched. A regular expression uses special characters—often referred
to as metacharacters—to define a pattern that is compared with an input string. For a
full discussion of regular expressions, with examples on how to use them, see
JunosE IP
Services Configuration Guide
.
The router compares each route’s AS path against the conditions in the access list one
by one. If the first match is for a permit condition, the route is accepted or passed. If the
first match is for a deny condition, the route is rejected or blocked. The order of conditions
is critical because testing stops with the first match. If no conditions match, the router
rejects or blocks the route; that is, the last action of any list is an implicit deny condition
for all routes.
You cannot selectively place conditions in or remove conditions from an AS-path access
list. You can insert a new condition only at the end of an AS-path access list.
Example 1
Consider the network structure in Figure 23 on page 86.
Figure 23: Filtering with AS-Path Access Lists
Suppose you want router London to behave in the following way:
•
Accept routes originated in AS 621 only if they pass directly to router London
•
Accept routes originated in AS 11 only if they pass directly to router London
•
Forward routes from AS 282 to AS 435 only if they pass through either AS 621 or AS 11,
but not both AS 621 and AS 11
The following commands configure router London to apply filters based on the AS path
to routes received from router Berlin and router Paris and to routes forwarded to router
Madrid.
host1(config)#
router bgp 47
host1(config-router)#
neighbor 10.2.9.2 remote-as 621
Copyright © 2010, Juniper Networks, Inc.
86
JunosE 11.2.x BGP and MPLS Configuration Guide
Summary of Contents for JUNOSE 11.2.X BGP AND MPLS
Page 6: ...Copyright 2010 Juniper Networks Inc vi...
Page 8: ...Copyright 2010 Juniper Networks Inc viii JunosE 11 2 x BGP and MPLS Configuration Guide...
Page 38: ...Copyright 2010 Juniper Networks Inc 2 JunosE 11 2 x BGP and MPLS Configuration Guide...
Page 192: ...Copyright 2010 Juniper Networks Inc 156 JunosE 11 2 x BGP and MPLS Configuration Guide...
Page 242: ...Copyright 2010 Juniper Networks Inc 206 JunosE 11 2 x BGP and MPLS Configuration Guide...
Page 244: ...Copyright 2010 Juniper Networks Inc 208 JunosE 11 2 x BGP and MPLS Configuration Guide...
Page 310: ...Copyright 2010 Juniper Networks Inc 274 JunosE 11 2 x BGP and MPLS Configuration Guide...
Page 356: ...Copyright 2010 Juniper Networks Inc 320 JunosE 11 2 x BGP and MPLS Configuration Guide...
Page 418: ...Copyright 2010 Juniper Networks Inc 382 JunosE 11 2 x BGP and MPLS Configuration Guide...
Page 524: ...Copyright 2010 Juniper Networks Inc 488 JunosE 11 2 x BGP and MPLS Configuration Guide...
Page 544: ...Copyright 2010 Juniper Networks Inc 508 JunosE 11 2 x BGP and MPLS Configuration Guide...
Page 608: ...Copyright 2010 Juniper Networks Inc 572 JunosE 11 2 x BGP and MPLS Configuration Guide...
Page 672: ...Copyright 2010 Juniper Networks Inc 636 JunosE 11 2 x BGP and MPLS Configuration Guide...
Page 674: ...Copyright 2010 Juniper Networks Inc 638 JunosE 11 2 x BGP and MPLS Configuration Guide...
Page 716: ...Copyright 2010 Juniper Networks Inc 680 JunosE 11 2 x BGP and MPLS Configuration Guide...
Page 717: ...PART 6 Index Index on page 683 681 Copyright 2010 Juniper Networks Inc...
Page 718: ...Copyright 2010 Juniper Networks Inc 682 JunosE 11 2 x BGP and MPLS Configuration Guide...