cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
14861
Views
14
Helpful
5
Replies

Verify match of a prefix list

fabio.marino
Level 1
Level 1

Hi All,

I have a routing map with different prefix list, let´s assume prefix list A, B, C ,D.

How can I verify which prefix list is macthed by a route?

Of course this route is not mentioning explicitely in all of these prefix list.

The router is using NX-OS.

Thanks.

1 Accepted Solution

Accepted Solutions

antonio.guirado
Level 3
Level 3

Hello,

for example if you configure the following prefix-list:

ip prefix-list rip-filter seq 5 deny 192.168.48.0/22 ge 23

ip prefix-list rip-filter seq 10 permit 0.0.0.0/0 le 32

You can use the commands:

R1#show ip prefix-list rip-filter                            

ip prefix-list rip-filter: 2 entries

   seq 5 deny 192.168.48.0/22 ge 23

   seq 10 permit 0.0.0.0/0 le 32

To see the matches count:

R1#show ip prefix-list detail rip-filter

ip prefix-list rip-filter:

   count: 2, range entries: 2, sequences: 5 - 10, refcount: 3

   seq 5 deny 192.168.48.0/22 ge 23 (hit count: 1504, refcount: 1)

   seq 10 permit 0.0.0.0/0 le 32 (hit count: 1402, refcount: 1)

To see if a specific prefix does match or not:

R1#show ip prefix-list rip-filter 192.168.48.0/24 first-match

   seq 5 deny 192.168.48.0/22 ge 23 (hit count: 1512, refcount: 1)

R1#show ip prefix-list rip-filter 192.168.48.0/23 first-match

   seq 5 deny 192.168.48.0/22 ge 23 (hit count: 1512, refcount: 1)

R1#show ip prefix-list rip-filter 192.168.48.0/22 first-match

   seq 10 permit 0.0.0.0/0 le 32 (hit count: 1410, refcount: 1)

Regards.

View solution in original post

5 Replies 5

U can try debug ip routing or debug ip packet detail. BUT I would be careful not to overwhelm the Router.

Maybe u can try to find it out with a close look the the match clauses, wouldn't that enough? If you like u can post the prefix-list with the route u asked for..

I use the next command to check the matching in IOS 15.X.

 

show ip prefix-list TEST_1 <prefix>/<len> first-match 

 

where:

 

<prefix>: is the prefix 

<len>: is the length mask.

 

Example:

 

XXXX#show ip prefix-list TEST_1
ip prefix-list TEST_1: 1 entries
seq 1 permit 10.0.0.0/16 le 30

 

When i try to check with a different length, the output is none:
XXXXX#show ip prefix-list TEST_1 10.0.0.0/17

 

When i try to check with a different length and the command recommended in the first line, the output is:

 

XXXX#show ip prefix-list TEST_1 10.0.0.0/17 first-match
seq 1 permit 10.0.0.0/16 le 30 (hit count: 0, refcount: 1)

 

 

this command was tested in:

Cisco IOS Software, 2801 Software (C2801-IPBASEK9-M), Version 15.1(2)T4, RELEASE SOFTWARE (fc1)

 

antonio.guirado
Level 3
Level 3

Hello,

for example if you configure the following prefix-list:

ip prefix-list rip-filter seq 5 deny 192.168.48.0/22 ge 23

ip prefix-list rip-filter seq 10 permit 0.0.0.0/0 le 32

You can use the commands:

R1#show ip prefix-list rip-filter                            

ip prefix-list rip-filter: 2 entries

   seq 5 deny 192.168.48.0/22 ge 23

   seq 10 permit 0.0.0.0/0 le 32

To see the matches count:

R1#show ip prefix-list detail rip-filter

ip prefix-list rip-filter:

   count: 2, range entries: 2, sequences: 5 - 10, refcount: 3

   seq 5 deny 192.168.48.0/22 ge 23 (hit count: 1504, refcount: 1)

   seq 10 permit 0.0.0.0/0 le 32 (hit count: 1402, refcount: 1)

To see if a specific prefix does match or not:

R1#show ip prefix-list rip-filter 192.168.48.0/24 first-match

   seq 5 deny 192.168.48.0/22 ge 23 (hit count: 1512, refcount: 1)

R1#show ip prefix-list rip-filter 192.168.48.0/23 first-match

   seq 5 deny 192.168.48.0/22 ge 23 (hit count: 1512, refcount: 1)

R1#show ip prefix-list rip-filter 192.168.48.0/22 first-match

   seq 10 permit 0.0.0.0/0 le 32 (hit count: 1410, refcount: 1)

Regards.

Grazie Antonio,

Very useful hints!!

Thank you for sharing this nice information.

 

i have one question here.

qus : in   "show ip prefix-list detail rip-filter" what is the " refcount: 3" value.

when it become 1 and when change to different.

 

thank you!

 

 

Review Cisco Networking for a $25 gift card