networking-forum.com
Community BlogCommunity Wiki * Register  * Search  * Login
View unanswered postsView active topics

All times are UTC - 6 hours [ DST ]



Post new topic Reply to topic  [ 42 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Useful IOS Commands
PostPosted: Tue Dec 01, 2009 1:50 pm 
Offline
Ultimate Member
Ultimate Member

Joined: Wed Nov 11, 2009 12:25 am
Posts: 575
http://blog.alwaysthenetwork.com/?p=208

After reading that blog post, I got to thinking about IOS commands I use day to day that are the most useful to me and make life easier in one way or another.

What are some other commands you all use that are very useful?

One of my favorites by far is

show proc cpu history

That commands gives you an ascii graph of the cpu utilization for the past 60 seconds, 60 minutes, and 72 hours.

Works on routers and switches.

UPDATE: As requested, I have posted most of the commands in the replies in the main thread. Some of the commands I did not post were ones which I could not test/use to provide an accurate description of what they were (all of them are in Steven King and Vitos post)

Code:
show interface description

shows list of interfaces, their current state, and their description
Code:
show ip bgp summary

shows summary of BGP neighbor status
Code:
show run, then type /(text)

After you enter show run, typing the / will tell the IOS to search for the specified string that is typed after the /. For example:
Code:
show run
/wccp

You will be taken to the first line with wccp in it.
Code:
show run | redirect tftp://##.##.##.##/bob.cfg

Easy backup or kick reports to a tftp server
Quote:
show standby brief

Code:
show standby brief

shows router redundancy information (HSRP)
Code:
show interface status | exclude disa

shows interface status and excludes interfaces in the disabled state
Code:
show cdp neighbor detail | include Device | IP address

Shows cdp neighbor device id (name) and its IP address
Code:
show ver | i uptime
SHO INT | I FastE|never

In combination, usefull for telling you what ports on a switch are not used but still patched in by matching when the last input/output with the uptime of the switch.
Code:
traceroute mac ip <source ip> <destination ip>

Usefull for doing traces across a layer 2 network
Code:
wr
reload in 10
< make changes >
reload cancel
wr

Gives you a ten minute window to make changes and if you lose
connectivity the device, it reloads in 10 minutes and reverts back
to the startup-config, just remember to save AFTER you cancel the reload
Code:
verify (image location)

make sure your IOS is not corrupt before reloading and ending up in ROMMON.
Code:
show proc cpu sort | excl 0.00%__0.00%__0.00%

shows only active CPU procs
Quote:
more system:run

ASA command, Shows your running config with more details. For example when you need to see the pre-shared key between a site-to-site VPN.
Quote:
show interface status

shows current interfaces with current status (connected/not connected), vlan of each interface, duplex and speed.
Code:
show interface stats

displays how much traffic goes across an interface, as well as how much of that traffic is process switched or cache switched.
Code:
show vlan brief

Gives you what vlans are on switch and what ports on the switch are in those vlans without the extra "fluff" of show vlan.
Fluff being the extra chart at the bottom of a show vlan that show MTU, parentID, etc..
Code:
sh cry isa sa

Active security associations, also known as tunnels
Code:
sh cry ipsec sa

Shows encryption statistics detailed by access list entry for each tunnel
Code:
sh cry isa policy

Shows phase 1 and 2 settings for tunnels
Code:
clear cry isa sa

Shuts down a tunnel and waits for re-negotiation of phase 1
Code:
show users

Shows users logged into vty lines
Code:
clear line vty line #

And once you know the line of the person you don't want on your router.
Code:
term no mon

Disable terminal monitoring


Last edited by ZeroZeroFourteen on Mon Feb 08, 2010 6:47 pm, edited 8 times in total.

Top
 Profile  
 
 Post subject: Re: Useful IOS Commands
PostPosted: Tue Dec 01, 2009 2:02 pm 
Offline
Moderator
Moderator
User avatar

Joined: Mon Apr 07, 2008 10:38 am
Posts: 9390
Location: Orlando, FL
Certs: CCNP RS, CCNP DC, CCDP, CCIP
Free advertising! :lol:

I'll post my favorites. I use a lot of aliases, so I'll post those:

Code:
alias exec traffic sh ip nbar protocol-discovery stats bit-rate top-n 10
alias exec s sh ip int b
alias exec sir show ip route
alias exec sion show ip ospf neighbor
alias exec svb show vlan brief
alias exec sr show run
alias exec sal show access-lists
alias exec srm sh route-map
alias exec proc show proc cpu sort | excl 0.00%__0.00%__0.00%
alias exec salsec sh ip access-list | sec
alias exec spmo show policy-map int fa0/0 out
alias exec spmi show policy-map int fa0/0 in
alias exec sift sh ip flow top


Most of the time I forget the alias so I just type the command out though, lol.

_________________
http://blog.alwaysthenetwork.com


Top
 Profile  
 
 Post subject: Re: Useful IOS Commands
PostPosted: Tue Dec 01, 2009 2:25 pm 
Offline
Member
Member
User avatar

Joined: Fri May 02, 2008 11:06 pm
Posts: 128
My favourites...

sh int des
sh ip b s


CB


Top
 Profile  
 
 Post subject: Re: Useful IOS Commands
PostPosted: Tue Dec 01, 2009 3:00 pm 
Online
Post Whore
Post Whore
User avatar

Joined: Mon Jun 15, 2009 9:48 am
Posts: 2882
Location: Lynchburg VA
Certs: CC\NP\DP\IP\NA-Security\NA-Voice
Most of the ones I use are CCNA type stuff, the one I did find that not many know about is the

/

you can use it to filter though till you get to a line with the info in it

Ex
show run
/wccp

will do a show of the running config
the /wccp will take you to the 1st line with wccp in it




Easy backup or kick reports to a tftp server
show run | redirect tftp://##.##.##.##/bob.cfg

_________________
Freedom to all the people. Brave, true and strong.
Freedom to all the people. Unless I think you're wrong

dhimes.com


Top
 Profile  
 
 Post subject: Re: Useful IOS Commands
PostPosted: Tue Dec 01, 2009 3:03 pm 
Offline
Moderator
Moderator
User avatar

Joined: Mon Apr 07, 2008 10:38 am
Posts: 9390
Location: Orlando, FL
Certs: CCNP RS, CCNP DC, CCDP, CCIP
dlots wrote:
Most of the ones I use are CCNA type stuff, the one I did find that not many know about is the

/

you can use it to filter though till you get to a line with the info in it

Ex
show run
/wccp

will do a show of the running config
the /wccp will take you to the 1st line with wccp in it


I didn't know about that! They stole it from VI. Awesome!

_________________
http://blog.alwaysthenetwork.com


Top
 Profile  
 
 Post subject: Re: Useful IOS Commands
PostPosted: Tue Dec 01, 2009 4:08 pm 
Offline
Member
Member
User avatar

Joined: Fri May 02, 2008 11:06 pm
Posts: 128
dlots wrote:
Most of the ones I use are CCNA type stuff, the one I did find that not many know about is the
Ex
show run
/wccp

will do a show of the running config
the /wccp will take you to the 1st line with wccp in it


That is 1337.


*** I just used this command for the very first time a min ago in a job I was doing :) Its going to be my in my fav. list pretty soon!


Last edited by Chinese Buffet on Tue Dec 01, 2009 5:07 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Useful IOS Commands
PostPosted: Tue Dec 01, 2009 4:44 pm 
Offline
Member
Member
User avatar

Joined: Mon Jan 05, 2009 4:56 am
Posts: 223
Location: Oslo, Norway
Certs: CCNP
Chinese Buffet wrote:
sh int des

Nice, that one's going into my standard. I use "sh int status" a lot, but that truncates the description. I use these on all switches (also basic stuff)

Code:
alias exec ss show standby brief
alias exec si sh int status | ex disa
alias exec sip sh ip int bri | ex una


And a nice one where cdp is used

Code:
alias exec cdpnei sh cdp nei det | inc Device | IP address


Top
 Profile  
 
 Post subject: Re: Useful IOS Commands
PostPosted: Tue Dec 01, 2009 5:17 pm 
Offline
Member
Member
User avatar

Joined: Mon Nov 23, 2009 7:15 pm
Posts: 151
Location: Brazil
Certs: CCNA Certified! | Get a life!
I just use q (as in quit) and then enter when I need to log out a device.

Also, I like to use the shortcuts in IOS...

http://www.cisco.com/en/US/docs/ios/12_ ... #wp1001693


Top
 Profile  
 
 Post subject: Re: Useful IOS Commands
PostPosted: Tue Dec 01, 2009 7:41 pm 
Offline
New Member
New Member

Joined: Sat Oct 24, 2009 10:31 pm
Posts: 5
Certs: A+
here is my favorite cisco command:

Quote:
?
(space ?)

Once you know that command, you know them all :)
noop


Top
 Profile  
 
 Post subject: Re: Useful IOS Commands
PostPosted: Tue Dec 01, 2009 7:59 pm 
Offline
Ultimate Member
Ultimate Member

Joined: Wed Nov 11, 2009 12:25 am
Posts: 575
lowjab wrote:
Chinese Buffet wrote:
sh int des

Nice, that one's going into my standard. I use "sh int status" a lot, but that truncates the description. I use these on all switches (also basic stuff)

Code:
alias exec ss show standby brief
alias exec si sh int status | ex disa
alias exec sip sh ip int bri | ex una


And a nice one where cdp is used

Code:
alias exec cdpnei sh cdp nei det | inc Device | IP address



That CDP Command is really nifty! I like the show int status as well.


Top
 Profile  
 
 Post subject: Re: Useful IOS Commands
PostPosted: Tue Dec 01, 2009 10:31 pm 
Offline
Ultimate Member
Ultimate Member
User avatar

Joined: Tue Jul 08, 2008 9:17 pm
Posts: 720
Location: ATL
Certs: C_NA
excellent thread!

_________________
" Those that know how to win are much more numerous than those who know how to make proper use of their victories."

Polybius


Top
 Profile  
 
 Post subject: Re: Useful IOS Commands
PostPosted: Wed Dec 02, 2009 2:37 am 
Offline
CCIE #38070
CCIE #38070
User avatar

Joined: Wed Jun 18, 2008 7:49 am
Posts: 12425
Location: London, UK
Certs: CCIE ,CC-NP/IP, JNCIP-SP, JNCIS-ENT, BC-/SPNE/NP
Personally I don't use aliases because of the sheer amount of routers we log into. Also as the entire NOC and a few others need to log in, we would all want different aliases.

Therefore I'm just used to typing them out, as least not fully.

'do' is one of my most used commands. Saves a lot of time

_________________
www.mellowd.co.uk/ccie/


Top
 Profile  
 
 Post subject: Re: Useful IOS Commands
PostPosted: Wed Dec 02, 2009 6:40 am 
Offline
Post Whore
Post Whore
User avatar

Joined: Fri Mar 11, 2005 10:26 pm
Posts: 2510
Location: Perth, Western Australia
wr is quite handy.

Aubrey

_________________
The illiterate of the 21st century will not be those who cannot read and write, but those who cannot learn, unlearn, and relearn. Alvin Toffler, "Future Shock" 1970


Top
 Profile  
 
 Post subject: Re: Useful IOS Commands
PostPosted: Wed Dec 02, 2009 11:12 am 
Online
Post Whore
Post Whore
User avatar

Joined: Mon Jun 15, 2009 9:48 am
Posts: 2882
Location: Lynchburg VA
Certs: CC\NP\DP\IP\NA-Security\NA-Voice
eaadams wrote:
wr is quite handy.



Yeah I like it... but Cisco doesn't. On my CCNA I blew one of the sim questions because I did a copy start run and realized it right after I hit the next button :-(

_________________
Freedom to all the people. Brave, true and strong.
Freedom to all the people. Unless I think you're wrong

dhimes.com


Top
 Profile  
 
 Post subject: Re: Useful IOS Commands
PostPosted: Wed Dec 02, 2009 11:35 am 
Offline
Post Whore
Post Whore
User avatar

Joined: Thu Jan 10, 2008 7:43 am
Posts: 1185
Location: London
Code:
show ver | i uptime
SHO INT | I FastE|never

In combination, usefull for telling you what ports on a switch are not used but still patched in by matching when the last input/output with the uptime of the switch.


Top
 Profile  
 
 Post subject: Re: Useful IOS Commands
PostPosted: Wed Dec 02, 2009 11:47 am 
Offline
Post Whore
Post Whore
User avatar

Joined: Thu Jan 10, 2008 7:43 am
Posts: 1185
Location: London
Another one I like (actually picked up from this forum!):

Code:
traceroute mac ip <source ip> <destination ip>


Usefull for doing traces across a layer 2 network


Top
 Profile  
 
 Post subject: Re: Useful IOS Commands
PostPosted: Wed Dec 02, 2009 12:39 pm 
Offline
Moderator
Moderator
User avatar

Joined: Mon Apr 07, 2008 10:38 am
Posts: 9390
Location: Orlando, FL
Certs: CCNP RS, CCNP DC, CCDP, CCIP
kannies wrote:
Another one I like (actually picked up from this forum!):

Code:
traceroute mac ip <source ip> <destination ip>


Usefull for doing traces across a layer 2 network


Yea, I've been using this one lately as well. It's pretty cool.

_________________
http://blog.alwaysthenetwork.com


Top
 Profile  
 
 Post subject: Re: Useful IOS Commands
PostPosted: Wed Dec 02, 2009 9:57 pm 
Offline
Post Whore
Post Whore

Joined: Sat Jun 07, 2008 11:06 am
Posts: 2553
Location: Grand Rapids, MI
Certs: CCNP, CCDP
dlots wrote:
On my CCNA I blew one of the sim questions because I did a copy start run and realized it right after I hit the next button

Two things: First, you don't need to save your configuration on the labs. You can. It doesn't hurt anything, but it doesn't affect your score.

However, if you copy the startup config to the running config, that will hurt your score greatly. :)


Top
 Profile  
 
 Post subject: Re: Useful IOS Commands
PostPosted: Thu Dec 03, 2009 10:20 am 
Online
Post Whore
Post Whore
User avatar

Joined: Mon Jun 15, 2009 9:48 am
Posts: 2882
Location: Lynchburg VA
Certs: CC\NP\DP\IP\NA-Security\NA-Voice
save your config was part of the question... and yes... yes it did

_________________
Freedom to all the people. Brave, true and strong.
Freedom to all the people. Unless I think you're wrong

dhimes.com


Top
 Profile  
 
 Post subject: Re: Useful IOS Commands
PostPosted: Thu Dec 03, 2009 10:39 am 
Online
Post Whore
Post Whore
User avatar

Joined: Tue Aug 21, 2007 2:15 pm
Posts: 8279
Location: Frederick MD
Certs: Instanity
reload command, is one I like, when messing with remote gear

wr
reload in 10

< make changes >


reload cancel
wr


gives you a ten minute window to make changes and if you loose
connectivity the device, it reloads in 10 minutes and reverts back
to the startup-config, just remember to save AFTER you cancel the reload


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 42 posts ]  Go to page 1, 2, 3  Next

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: Bing [Bot] and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group