Wednesday, December 2, 2015

Useful Cisco Commands

Here's a collection of Cisco commands I still haven't been taught by Cisco.  But I learned through various other methods.

terminal monitor
and
term no mon
Terminal monitor is the answer to all remote diagnostic issues.  So when you ssh or telnet into a client, you then get the output you would if you were on site.  The only problem is that output occasionally drives you mad as you try to figure out the solution to a problem.  How in the world do you turn it off?  That's where term no mon comes into play.  It turns off console connections for after they have been turned on with terminal monitor.  Terminal monitor is taught in class.  Term no mon is not.

term len 0
Another terminal command.  The terminal length command tells how many lines of output to display when you hit a key.  But term len 0 has a special use.  Let's say you want to do a quick examination of the entire running config of a site.  How do I do that?

Using Putty, turn on logging.  I'd actually recommend setting logging to default so it logs every piece of output forever. Might be useful when you have other issues.  Next, remote access the system via telnet or ssh.  Next.  term len 0.  You now just set the terminal length to 0, so it will display the entire output without having to press a single key.  Guess what?  No more parsing crud out of text files.  You now have a complete running config stored in the Putty log file that only needs minor parsing.  No more removing typing, input characters, or what not.  Just open the file and remove the login/logout sections.

Next, exit.  Do not save.  No not write.  That way, the next time you log in everything will be just as you found it before.  No weirdness or strangeness.  Otherwise you might have to use term len 10 or something to that effect to put it all back together again.

monitor session 1 source interface interface_name/number
monitor session 1 destination interface interface_name/number
The only pair of commands in my list.  I've only used these commands on switches.  They might work on routers as well.  Not sure.  But here's the great thing about these commands: along with Wireshark, you can kick back and examine all the traffic going through a device in order to try and troubleshoot communication issues.  It's kind of like a programmable hub, but better.  And, you can monitor as few or as many ports as you want.  I'm sure there's limitations to the commands, but like I said, these are things I've learned that classes have never taught me.

So, there you go.  A short collection of Cisco commands that seem to make life easier.  Or get rid of terminal monitor after you start it up.  Hope it helps.




No comments:

Post a Comment