Example: Configuring a Route Map to Filter Routes on the Basis of the AS Path
This example explains how to configure a route map to filter routes on the basis of the autonomous system (AS) path.
Requirements
This example uses the following software and hardware components:
- JunosE Release 7.1.0 or higher-numbered releases
- E Series router (ERX7xx models, ERX14xx models, the ERX310 router, the E120 router, or the E320 router)
- ASIC-based line modules that support Fast Ethernet or Gigabit Ethernet
Overview
Consider the network structure shown in Figure 1. In this network, you can configure the router NY to block the router Boston from receiving any routes that originate in or pass through the router Chicago.
Figure 1: Applying Route Maps to Routes

Configuration
Step-by-Step Procedure
The following example demonstrates about configuring the router NY to block the router Boston from receiving any routes that originate in or pass through the router Chicago.
To block the router Boston from receiving any routes that originate in or pass through the router Chicago:
- Configure the BGP routing process.host1(config)#router bgp 293
- Configure a BGP speaker with an IPv4 prefix originating
within its AS.host1(config-router)#network 192.168.5.0 mask 255.255.255.0
- Add entries to the BGP neighbor table.host1(config-router)#neighbor 10.5.5.2 remote-as 32 host1(config-router)#neighbor 10.2.2.2 remote-as 873 host1(config-router)#neighbor 10.2.2.4 remote-as 17
- Apply a route map to incoming or outgoing routes.host1(config-router)#neighbor 10.2.2.4 route-map block1 out host1(config-router)#exit
- Define a BGP-related access list.host1(config)#ip as-path access-list boston deny _32_
- Specify a route map for applying routing policies to filter
or modify routes.host1(config)#route-map block1 deny 1
- Match a BGP AS-path access list.host1(config-route-map)#match as-path boston
Related Documentation
- Understanding Route Map Match and Set Clauses
- Defining the Conditions for Redistributing Routes Using a Route Map
- Configuring Match Clauses and Values for a Route Map
- Defining AS-Path Access Lists
- Monitoring the AS-Path Access Lists for IP
- Monitoring IP Protocols
- Monitoring Route Map Details
- ip as-path access-list
- match as-path
- neighbor remote-as
- neighbor route-map
- network
- route-map
- router bgp