Name

ip as-path access-list — global

Synopsis

ip as-path access-list access-list {permit | deny} as-regex
no ip as-path access-list access-list {permit | deny} as-regex

Configures

A BGP access list

Default

None

Description

This command allows you to build an access list for BGP autonomous system (AS) paths. These lists can be applied to a neighbor with the filter-list option to the neighbor command. access-list is a number that identifies the list; as-regex is a regular expression that matches AS paths. For more information on valid regular expressions for BGP, see Chapter 10.

Example

The following commands create an AS-path access list that denies (blocks) routes that include AS 111. This access list is then applied to routes that are sent to the BGP neighbor 11.1.1.1.

ip as-path access-list 1 deny _111_

router bgp 120
  network 10.1.0.0
  neighbor 11.1.1.1 remote-as 200
  neighbor 11.1.1.1 filter-list 1 out

Get Cisco IOS in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.