Monday, January 26, 2009

My Most Oft Used Cisco IOS Commands

Many thanks to Ian Carder for this blog entry!

Over the past year we have replaced all of our remaining Cabletron network equipment with Cisco gear. Being a K-12 School District, we made use of Cisco Catalyst Express series of switches in our IDFs. The CE series of switches are configured using a web browser. We do have a large install base of Catalyst 2950s and 3550s. Our core network switches, Catalyst 4500 series, are all configured on the command line using IOS. The network configuration is in place and not changing any time soon. Most of the IOS work I do now are simple tasks such as changing switch-port VLAN designations and diagnostics. Here are some of the commands I use most often:

do show run
I always find myself needing to double check something in the running config while I'm in configuration mode. Instead of dumping back into exec mode, issuing do sh run will enable you to check your running config. In general, the do command is to run any exec mode command while in configuration mode.

show run | begin
When you have to check how you have an interface configured on a loaded Catalyst 4500, I find myself hitting space bar a lot and half the time I blow right by the interface or line I was looking for anyway. Assuming I know what I'm looking for and it's a unique entry in the running config, piping the begin command with whatever text you're searching for after a sh run will jump the sh run output right to the text you specified after the begin command. An example I might do would be a sh run | being 6/26 to see the config for blade 6/port 26. You can also combine it with the do command if you're in configuration mode.

show ip route
Generally I don't have to check out the routing table. Our network is fairly stable at this point. Anytime I have to add a new subnet, I'll end up issuing the sh ip route command just to be sure that the subnet has 'propagated' throughout the network. If you're doing more layer 3 work in your network, you'll probably be using the command often.

show vlan
I use this command to quickly see if an access or voice vlan is up, and to see what ports are associated with it. If you create a vlan on a switch, it won't automatically become active unless you assign an interface to it.

show interface
The show interface command is extremely useful for diagnostics. There is a ton of useful information for each interface that you run this command against. The most basic output is whether the interface is up or down, and whether you shut it down(administratively down) or not.


If you find yourself schlepping around IOS often, or any other platform for that matter, feel free to talk about commands you use most often and why.