Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation
Guide That Contains This Content
[+] Expand All
[-] Collapse All

    Example: Configuring a Route Map to Filter Routes on the Basis of the AS Path

    This example explains how to configure a router to filter routes on the basis of AS paths.

    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

    This example describes how to configure the 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.

    Figure 1 depicts the network structure containing the router London connected to other routers.

    Figure 1: Filtering with AS-Path Access Lists

    Filtering with AS-Path Access Lists

    Configuration

    Step-by-Step Procedure

    The following example demonstrates about configuring the router London to accept routes originated in AS 621 and AS 11 only if they pass directly to router London and 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.

    To configure the router London to accept and forward routes:

    1. Configure the BGP routing process.
      host1(config)#router bgp 47
    2. Add entries to the BGP neighbor table.
      host1(config-router)#neighbor 10.2.9.2 remote-as 621 host1(config-router)#neighbor 10.2.8.2 remote-as 11 host1(config-router)#neighbor 10.2.7.2 remote-as 435
    3. Apply AS-path access lists to advertisements inbound from or outbound to the specified neighbor.
      host1(config-router)#neighbor 10.2.9.2 filter-list 1 in host1(config-router)#neighbor 10.2.8.2 filter-list 2 in host1(config-router)#neighbor 10.2.7.2 filter-list 3 out host1(config-router)#exit
    4. Define BGP-related access lists.

      host1(config)#ip as-path access-list 1 deny ^11 host1(config)#ip as-path access-list 1 permit .* host1(config)#ip as-path access-list 2 deny ^621 host1(config)#ip as-path access-list 2 permit .* host1(config)#ip as-path access-list 3 deny [621 11] host1(config)#ip as-path access-list 3 permit .*

    Results

    AS-path access list 1 is applied to routes that router London receives from router Paris. Router London rejects routes with the AS path 11 621 or 11 282 621.

    AS-path access list 2 is applied to routes that router London receives from router Berlin. Router London rejects routes with the AS path 621 11 or 621 282 11.

    Router London accepts routes with the AS path 282 11, 282 621, 282 621 11, or 282 11 621. However, it applies AS-path access list 3 to routes that it forwards to router Madrid, and filters out routes with the AS path 282 621 11 or 282 11 621.

    Published: 2014-08-12