cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1172
Views
0
Helpful
8
Replies

Filtering routing table outputs with regular expressions

matthew_epps
Level 1
Level 1

I have a pair of routers which have large routing tables. I want to be able to look at subsets of this routing info (e.g all 192.168.*.* subnets). Can someone tell me how I can do this. I belive Regular Expressions are the answer but cannot figure one out.

Thanks,

Matt

8 Replies 8

rwiesmann
Level 4
Level 4

Hi Matt

What ist your routing protocol i got in place? (EIGRP/BGP/OSPF...)

Regards

Roger

Currently RIP although some of the subnets I want to filter out are Static Routes and Directly Connected routes. All are in the 192.168.*.* range.

Matt

Hi Matt

The RIP Routes you can filter with a distribute-list in the routing process.

Like the sample below:

router rip

network 10.0.0.0

distribute-list 10 out

!

access-list 10 permit 10.10.10.0 0.0.0.255

Only the 10.10.10.0 net will be propagated by rip.

The static routes you can filter with ther redistribution command and a route map. Here a sample:

ip route 10.10.10.0 255.255.255.0 192.168.1.1 tag 100

ip route 10.10.11.0 255.255.255.0 192.168.1.1

!

Route-map static2rip permit 10

match tag 100

!

Router rip

network 192.168.1.0

redistribute route-map static2rip metric 2

!

That means only the static route with the tag will be redistributed into the rip.

In rip there is nothing like regex. Regex can only be in place with bgp.

Hope that helps you

Roger

Roger,

thanks for the reply. Unfortunately what I was actually asking for was a way to filter the output of a "Show IP Route" command to only show routes to 192.168.*.* subnets, no a way to filter routing updates.

If you could help here, I would be grateful,

thanks,

Matt

You could try using the Include keyword under the pipe function (|):

SHOW IP ROUTE | INCLUDE 192.168

sorry

Thats sh ip route | include 10.90*

Ciao

Roger

Thanks,

I was able to use your responses to help me find my solution,

Many thanks,

Matt

Matt,

If you issue the following command you can will only see the routing information for 192.168.*.*:

router#show ip route | include 192.168

There is a certain level of IOS that supports this command(I think the 12.x and above).

Hope this helps.

Dave

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: