cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1291
Views
5
Helpful
3
Replies

General question of how to maintain device configuration

leowls
Level 1
Level 1

Hi guys,

 

Is there anyway I can check for all the commands related to a certain configuration on a switch/router? For example for "Policy Based Routing" configuration, is there a way for to list all PBR commands if there is a need to remove them from the device completely? 

 

Thanks.

2 Accepted Solutions

Accepted Solutions

Hello,

 

you can use the | (pipe) command with keywords to filter and display parts of your configuration, e.g.:

 

R1#sh run | section route-map
route-map BGP_OUT permit 10
match ip address prefix-list BGP_PREFIX
set community no-export

 

You can also use 'grep' to filter output.

 

Router#conf t
Router(config)#shell processing full
Router(config)#exit
Router#terminal shell

 

This enables you to run show commands with grep.

 

Router#sh run | grep 'route-map'

 

The | pipe command allows for regular expressions as well...

View solution in original post

BTW, older Cisco software images don't support as many line matching commands as the newer Cisco images. For example, you might find "sec(tion)" not supported, but some commands go way back, like "in(clude)".

View solution in original post

3 Replies 3

Hello,

 

you can use the | (pipe) command with keywords to filter and display parts of your configuration, e.g.:

 

R1#sh run | section route-map
route-map BGP_OUT permit 10
match ip address prefix-list BGP_PREFIX
set community no-export

 

You can also use 'grep' to filter output.

 

Router#conf t
Router(config)#shell processing full
Router(config)#exit
Router#terminal shell

 

This enables you to run show commands with grep.

 

Router#sh run | grep 'route-map'

 

The | pipe command allows for regular expressions as well...

thank you!

BTW, older Cisco software images don't support as many line matching commands as the newer Cisco images. For example, you might find "sec(tion)" not supported, but some commands go way back, like "in(clude)".
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:

Review Cisco Networking products for a $25 gift card