A bug in the IOS “section” filter
The section filter of the show commands contains a nasty bug (at least in the IOS release 12.4T) in IOS release 12.2SRC: if a line in the section matches the same regular expression as the section header, the rest of the section is not printed.
I guess this sounds a bit perplexing, so here's an example. When using the router bgp regular expression in a section filter appended to the show running command, the whole BGP configuration is displayed:
PE-A#show run ¦ section router bgpHowever, if you use bgp as the regular expression, the printout starts with the router bgp command, but stops abruptly after the first line containing the string bgp, skipping the rest of the section:
router bgp 65000
template peer-policy Internal
send-community both
exit-peer-policy
!
template peer-session Internal
remote-as 65000
update-source Loopback0
exit-peer-session
!
no synchronization
bgp log-neighbor-changes
neighbor 10.0.1.5 inherit peer-session Internal
neighbor 10.0.1.5 description PE-C(RR)
neighbor 10.0.1.5 inherit peer-policy Internal
no auto-summary
!
address-family vpnv4
neighbor 10.0.1.5 activate
neighbor 10.0.1.5 send-community extended
exit-address-family
PE-A#show run ¦ section bgp
router bgp 65000
template peer-policy Internal
send-community both
exit-peer-policy
!
template peer-session Internal
remote-as 65000
update-source Loopback0
exit-peer-session
!
no synchronization
bgp log-neighbor-changes
show running-config | section ^router bgp
lab01#sh run | section bgp
router bgp 65519
no synchronization
bgp router-id 172.16.0.1
bgp log-neighbor-changes
redistribute connected
redistribute static
no auto-summary
snmp-server enable traps bgp
lab01#show running-config | section ?
LINE Regular Expression
exclude Exclude entire section(s) of output
include Include entire section(s) of output
lab01#show running-config | section
which version of adsl microcode you use?
Looks like there is still an easy way to submit bug reports to Cisco :) Something I've been hoping to find for the last 10 years :))