BGP Prefix Matching

Prefix lists provide an alternative method to matching networks with a routing protocol.

The prefix list can identify a specific IP address, network, or an entire network range. It is flexible enough to allow of selection of multiple network ranges too.

Prefix matching in it’s simplest form can be defined with a, where it matches the network with a subnet mask of

The prefix matching can be enhanced with the use of pattern matching.

Pattern Matching

There are two pattern matching keywords that can be used with prefix matching, le or ge.

le is less than or equal to (<=)

ge is greater than or equal to (>=)


Using a prefix with the syntax ge 24 with some example scenarios: – No match – Match – Match

The no match is due to the prefix length being 16, much less than the specified ‘ge 24’ in the command.

The portion of the command allows networks from to to be selectable, but only with a prefix length of 24 or greater.

Prefix Lists

A prefix list can contain multiple prefix statements for network matching, with either a permit or deny option if that prefix statement is matched.

Similar to access control lists, prefix lists are evaluated from top to bottom.

To configure a prefix list, enter the command ip prefix-list followed by the prefix list name, the sequence number with seq and whether to permit or deny it. Finally on the same statement, add the prefix matching statement.

ip prefix-list testing 5 permit ge 24

Prefix Lists with IPv6

Prefix lists with IPv6 operate in a very similar way, the command is changed from ip prefix-list to ipv6 prefix-list



, ,




Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.