cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1140
Views
1
Helpful
9
Replies

How many sections in running-config command

banoosh
Level 1
Level 1

Hi community,

 

i would like to ask when i run show running command in either switch or router, what are all the sections that i can search for it?

9 Replies 9

@banoosh 

 Can you try to ask differently?

What do you mean by section? Have an example? 

Show running-config | section …….

Got It. 

This is a filter to parcing inside the device output. There Will be no fix value for Section. It Will depend on How you use It. For example 

Router# show running-config | section include interface

 Like any filter It Will depend on what you are looking for. 

I believe the section command will match against any config statement that matches its argument and then include anything indented under it.


@Joseph W. Doherty wrote:

I believe the section command will match against any config statement that matches its argument and then include anything indented under it.


From a couple of recent replies, possibly my prior reply wasn't understood.

The "section" option only appears to "care" about what I mentioned previously, i.e. it matches its argument line, and includes any configuration lines indented underneath it.  To make it clear, in CML, for an IOS router, I added to the config the following:

policy-map x
 class class-default
  fair-queue
  random-detect
policy-map y
 class class-default
   service-policy x

 I chose to use policy map, as they have two indentation levels.

nserthostname-here#sh run | section map  
policy-map x
 class class-default
  fair-queue
  random-detect
policy-map y
 class class-default
   service-policy x
inserthostname-here#sh run | section default
 class class-default
  fair-queue
  random-detect
 class class-default
   service-policy x
inserthostname-here#sh run | section x      
policy-map x
 class class-default
  fair-queue
  random-detect
   service-policy x
 duplex auto
 duplex auto
 duplex auto
 duplex auto
banner exec ^C
* purposes is expressly prohibited except as otherwise authorized by     *
* purposes is expressly prohibited except as otherwise authorized by     *
* purposes is expressly prohibited except as otherwise authorized by     *
line aux 0
inserthostname-here#sh run | section queue
  fair-queue

So, as far as the "section" option is concerned, it matches configuration lines with the text, and includes any immediately indented configuration lines underneath the matched line. 

marce1000
Hall of Fame
Hall of Fame

 

 - A running configuration of a switch or a router , is not considered to contain sections as such ; what is done that usually directives with a targeted functionality or goal are grouped together , but there is  no concept of sections , 

 M.



-- Each morning when I wake up and look into the mirror I always say ' Why am I so brilliant ? '
    When the mirror will then always repond to me with ' The only thing that exceeds your brilliance is your beauty! '

Leo Laohoo
Hall of Fame
Hall of Fame

I cannot appreciate the "section" filter option in switches because the "use case" is fairly limited.  However, I use the "sections" filter option with routers and on 9800.  

Martin L
VIP
VIP

there are section of code reserved for specific commands to configure things; like place holders, that u could call "sections"; i.e. login section for console and vty exists in every Cisco device. Each interface has its own section; Routing has its own placed; One way to spot section is to look for code /commands indentications (indent). You can use "section" keyword like show running-config | section <name like router or line con 0>

here are examples:

line con 0
 exec-timeout 5 0
 privilege level 1
 no login
line aux 0
 transport input all
line vty 0 4
 exec-timeout 5 0
 privilege level 0
 no login

!

router rip
 version 2
 no auto-summary

!

vtp domain cisco
 vlan 5,7,8,9,10,146

interface FastEthernet0/1
 no shutdown
 switchport host
 switchport access vlan 146

interface Loopback0
 ip address 28.119.16.1 255.255.255.0
 ipv6 address 2001:28:119:16::1/64

Regards, ML
**Please Rate All Helpful Responses **

 

 

How about this?

EBD-3850#sh run | i ^[a-z]
version 16.6
no service pad
service timestamps debug datetime localtime show-timezone
service timestamps log datetime localtime show-timezone
service password-encryption
no service dhcp
platform punt-keepalive disable-kernel-core