Thursday, June 16, 2011

Top Ten Cisco IOS Commands -10) Show Run

Let's face it...there's nothing sexy about this command. However, that being said, you may not know as much as you should about this command. I'm sure you've ran a "sh run" or two in your day, but how about these variances....
How about looking at just the config of one interface?

router1# sh run int G0/0

Building configuration...
Current configuration : 279 bytes
!
interface GigabitEthernet0/0
description to Master Switch
bandwidth 10000000
ip address 10.10.10.13 255.255.255.0
ip flow egress
ip nat inside
ip route-cache same-interface
ip route-cache flow
ip policy route-map SendThisWay
duplex auto
speed auto
end


Or, maybe you want to see the running-config starting at the auxiliary line...

router1# sh run | begin line aux

line aux 0
session-timeout 10
password 7 03F44C1E1A4A0E58D2
login
modem Dialin
stopbits 1
flowcontrol hardware
line vty 0 2
access-class ITGuys in
exec-timeout 0 0
password 7 03F44C1E1A4A0E58D2
logging synchronous
login
line vty 3 4
access-class ITGuys in
password 7 03F44C1E1A4A0E58D2
logging synchronous
login
line vty 5 15
access-class ITGuys in
password 7 03F44C1E1A4A0E58D2
login
!
ntp logging
ntp clock-period 17179769
ntp source GigabitEthernet0/3
ntp master
ntp server 10.10.10.10
.....
.....


If you need to remove an old ACL you'd better check to see what the ramifications might be.
Here I did an "include" to show me all the places this ACL was being used...

router1# sh run | i MyAcl

ip access-list extended MyAcl
remark ACL MyAcl
match ip address MyAcl


It looks like my access list is being used in a route-map!
I'd better use the "section" argument to look at sections in the running-config with MyAcl in them...

router1# sh run | sec MyAcl

ip access-list extended MyAcl
remark ACL MyAcl ver 4a
permit ip any host 1.2.3.4
permit ip any host 1.2.3.5
permit ip any host 1.2.3.6
permit ip any host 1.2.3.7
deny ip any any
route-map MyAcl permit 1
description Traffic for SQL
match ip address MyAcl
set ip next-hop verify-availability 61.62.63.259 10 track 1


Also, did you know the show run command tells the last time a write mem was performed...

router1# sh run

Building configuration...
Current configuration : 31823 bytes
!
! Last configuration change at 15:56:22 EST Tue Feb 15 2011
!
version 12.7
!


So as you can see, this command is pretty useful when you know which argument to use!
I almost hated to put this on the list, but, I use it on a daily basis.
Thanks for reading!


No comments:

Post a Comment