Example: Configuring Access Lists to Filter Routes Advertised to a BGP Device

This example explains how to use an access list to filter routes advertised to a BGP device.

Requirements

This example uses the following software and hardware components:

Overview

Consider the network structure in FigureĀ 2. In this network, you can configure the router Boston to apply the access list reject1 for routes inbound from the router Sanjose. This access list rejects routes matching 172.24.160.0/19.

Figure 2: Filtering with Access Lists

Filtering with Access Lists

Configuration

Step-by-Step Procedure

The following example demonstrates about configuring the router Boston to apply the access list reject1 for routes inbound from the router Sanjose.

To apply the access list reject1 for routes inbound from the router Sanjose:

  1. Configure the BGP routing process.
    host1(config)#router bgp 17
  2. Add an entry to the BGP neighbor table.
    host1(config-router)#neighbor 10.5.5.4 remote-as 873
  3. Distribute the BGP neighbor information as specified in the access list.
    host1(config-router)#neighbor 10.5.5.4 distribute-list reject1 in host1(config-router)#exit
  4. Define a standard or extended IP access list.
    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

Related Documentation