bgp ip-prefix-list

IP prefix lists are a convenient way to filter prefixes (contained in route update packets) transmitted to (or received from) other BGP supported routers. IP prefix lists are similar to access lists. They contain ordered entries (deny or permit prefix rules), identified by their sequence numbers. Each rule specifies match criteria (network and subnet prefixes and prefix masks) to match. When a prefix (received or transmitted) matches the prefix specified in one of the rules, it is filtered and an action is applied depending on where the IP prefix list is used. For example, when used in the BGP neighbor context, the prefixes received from the neighbor are filtered and the filtered prefixes are either rejected or accepted depending on the rule type (deny or permit).

IP prefix lists are also used in the BGP route map context to filter prefixes. The action applied, on filtered prefixes is set within the route map. Another use case for IP prefix lists is to filter prefixes before redistribution of local OSPF routes to eBGP enabled ASs.

Like in access lists, these deny and permit prefix rules are processed sequentially, in ascending order of their sequence number. Once a match is made, the BGP enabled router stops processing all subsequent rules in the ip-prefix-list.

IP prefix lists are used as match criteria in the following contexts:
  • BGP neighbor. For more information, see use.
  • BGP route-map context. For more information, see match.
To navigate to the ip-prefix-list configuration instance, use the following command:
<DEVICE>(config)#bgp ip-prefix-list <IP-PREFIX-LIST-NAME>
BGP IP Prefix List Mode commands:
  deny     IP Prefix deny rule to specify packets to reject
  no       Negate a command or set its defaults
  permit   IP Prefix permit rule to specify packets to forward

  clrscr   Clears the display screen
  commit   Commit all changes made in this session
  do       Run commands from Exec mode
  end      End current mode and change to EXEC mode
  exit     End current mode and down to previous mode
  help     Description of the interactive help system
  revert   Revert changes
  service  Service Commands
  show     Show running system information
  write    Write running configuration to memory or terminal

The following table summarizes the BGP IP prefix list configuration commands:
Click to expand in new window

BGP IP-Prefix-List Config Mode Commands

Command Description
deny (ip-prefix-list) Creates and configures a deny, prefix-list rule
permit (ip-prefix-list) Creates and configures a permit, prefix-list rule
no (ip-prefix-list) Removes the specified deny or permit prefix-list rule from this IP prefix list