The Journey of a Network Engineer

Dec 7 2010   2:59AM GMT

How to use IP Prefix List?

Sulaiman Syed Profile: Sulaiman Syed

IP prefix list mostly used with route filtering in IGP (OSPF, IS-IS, EIGRP) and EGP (BGP) protocols. At first sight, the command will look confusing, but it is pretty simple and straight forward.

Prefix list can be used with route map, and they would be referred with a match command. The command syntax as follows:

ip prefix-list list-name [seq value] {deny network/length | permit network/length} [ge value] [le value]

as seen from the syntax, the command is divided into two parts. First, the network/length. Then, ge, and le. To summarize the meaning of two parts.

  1. network/length will determine range of addressed implied by the prefix list.
  2. the prefix (subnet mask) of the route must match the prefixes implied by the ge (greater or equal) and le (less or equal).

This mind sound confusing slightly, but an example will show what it means.

  1. This means any network with 192 in the first octet only. which would mean network.
  2. ge 16. This means any network starting to 192.168.xx.xx/32
  3. ge 8 le 16. This will imply network starting from to 192.xx.0.0/16
  4. This means any network with prefix zero. only default routes have this.
  5. le 32. This range implies all networks.

Another example to show how it works, imagine the following networks.

  4. will match only network 2. since it is exact match. ge 8 will match all routes. Since all of the above networks are starting with 10. and the lowest subnet mask is 8. ge 9 le 16 will match network 1,3, and 4. Because ge 9 implies a subnet mask equal or greater than 9. and route 2 has subnet mask of 8.

I hope this article did explain how to write and understand prefix list. It is strong tool when it comes to filter routes in any route map. For further reading, please refer to IP prefix List by Cisco.

3  Comments on this Post

There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.
  • testst ge y  with x<y ge 16.    here you have x=y , it will be rejected by the IOS
    0 pointsBadges:
  • Sulaiman Syed
    Hi, you are correct. M-AHA-NSW-PARKST_R01(config)#ip prefix-list TEST permit ge 16 % Invalid prefix range for, make sure: len < ge-value <= le-value M-AHA-NSW-PARKST_R01(config)#
    130 pointsBadges:
  • bart12345
    Finally someone explaining this the way I could understand.  Thank you!
    0 pointsBadges:

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: