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. 192.168.10.0/8. This means any network with 192 in the first octet only. which would mean 192.0.0.0/8 network.
  2. 192.168.10.0/16 ge 16. This means any network starting 192.168.0.0/16 to 192.168.xx.xx/32
  3. 192.168.10.0/8 ge 8 le 16. This will imply network starting from 192.0.0.0/8 to 192.xx.0.0/16
  4. 0.0.0.0/0. This means any network with prefix zero. only default routes have this.
  5. 0.0.0.0/0 le 32. This range implies all networks.

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

  1. 10.1.0.0/16
  2. 10.0.0.0/8
  3. 10.2.0.0/16
  4. 10.128.0.0/9

10.0.0.0/8 will match only network 2. since it is exact match.

10.0.0.0/8 ge 8 will match all routes. Since all of the above networks are starting with 10. and the lowest subnet mask is 8.

10.0.0.0/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.

2  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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • testst
    192.168.10.0/x ge y  with x<y
    192.168.10.0/16 ge 16.    here you have x=y , it will be rejected by the IOS
    0 pointsBadges:
    report
  • Sulaiman Syed
    Hi, you are correct. M-AHA-NSW-PARKST_R01(config)#ip prefix-list TEST permit 192.168.10.0/16 ge 16 % Invalid prefix range for 192.168.0.0/16, make sure: len < ge-value <= le-value M-AHA-NSW-PARKST_R01(config)#
    100 pointsBadges:
    report

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: