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:

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

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:

  1. Configure the BGP routing process.
    host1(config)#router bgp 293
  2. 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
  3. 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
  4. 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
  5. Define a BGP-related access list.
    host1(config)#ip as-path access-list boston deny _32_
  6. Specify a route map for applying routing policies to filter or modify routes.
    host1(config)#route-map block1 deny 1
  7. Match a BGP AS-path access list.
    host1(config-route-map)#match as-path boston

Related Documentation