Figure 2: Filtering with Access Lists
The following commands configure router Boston to apply access list reject1 to routes
inbound from router SanJose. Access list reject1 rejects routes matching
172.24.160.0/19.
host1(config)#
router bgp 17
host1(config-router)#
neighbor 10.5.5.4 remote-as 873
host1(config-router)#
neighbor 10.5.5.4 distribute-list reject1 in
host1(config-router)#
exit
host1(config)#
access-list reject1 permit 172.24.48.0 0.0.255
host1(config)#
access-list reject1 deny 172.24.160.0 0.0.0.255
host1(config)#
access-list reject1 permit 172.24.24.0 0.0.0.255
Filtering AS Paths
You can use a filter list to filter incoming and outgoing routes based on the value of
the AS-path attribute. Whenever a BGP route passes through an AS, BGP prepends
its AS 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 of
how to use them, see “Using Regular Expressions” on page 44.
The router compares each route's AS path with each condition in the access list. 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.
Access Lists
■
23
Chapter 1: Configuring Routing Policy
Summary of Contents for IP SERVICES - CONFIGURATION GUIDE V 11.1.X
Page 6: ...vi...
Page 8: ...viii JUNOSe 11 1 x IP Services Configuration Guide...
Page 18: ...xviii Table of Contents JUNOSe 11 1 x IP Services Configuration Guide...
Page 20: ...xx List of Figures JUNOSe 11 1 x IP Services Configuration Guide...
Page 22: ...xxii List of Tables JUNOSe 11 1 x IP Services Configuration Guide...
Page 28: ...2 Chapters JUNOSe 11 1 x IP Services Configuration Guide...
Page 138: ...112 Monitoring J Flow Statistics JUNOSe 11 1 x IP Services Configuration Guide...
Page 286: ...260 Monitoring IP Tunnels JUNOSe 11 1 x IP Services Configuration Guide...
Page 312: ...286 Monitoring IP Reassembly JUNOSe 11 1 x IP Services Configuration Guide...
Page 357: ...Part 2 Index Index on page 333 Index 331...
Page 358: ...332 Index JUNOSe 11 1 x IP Services Configuration Guide...