Cisco IOS

 
Usefull and useless IOS Command.
Good to kown and a place, to write it down.

Send messages to connected users

Who is logged in on the router
	R4#sh users
	    Line       User       Host(s)              Idle       Location
	* 66 vty 0     chw        idle                 00:00:00 192.168.2.100
	  67 vty 1     chw        idle                 00:10:09 192.168.2.156
	
	  Interface    User               Mode         Idle     Peer Address
Or
	R4#who
	    Line       User       Host(s)              Idle       Location
	* 66 vty 0     chw        idle                 00:00:00 192.168.2.100
	  67 vty 1     chw        idle                 00:10:22 192.168.2.156
	
	  Interface    User               Mode         Idle     Peer Address
	
	R4#
And now, the send command, to write a message to a other User on the Router
	R4#send ?
	  *        All tty lines
	  <0-70>   Send a message to a specific line
	  aux      Auxiliary line
	  console  Primary terminal line
	  qdm      Send a message to QDM client
	  tty      Terminal controller
	  vty      Virtual terminal
	  x/y      Slot/Port for Modems
and here a example:
	R4#send 66
	Enter message, end with CTRL/Z; abort with CTRL/C:
	Hello User on Line 66
	^Z
	Send message? [confirm]
	R4#
And the Result on the other end
	***
	***
	*** Message from tty67 to tty66:
	***
	Hello User on Line 66
Or send to all Lines
	R4#send *
	Enter message, end with CTRL/Z; abort with CTRL/C:
	Hi ALL Userers ....
	^Z
	Send message? [confirm]
	R4#

SN + Inventory

Show SN
Sometime it's easyer, to execute a command on the cli, then walk to the Router.
	R4#show inventory
	NAME: "2611 chassis", DESCR: "2611 chassis, Hw Serial#: JAD064802LF (65967582), Hw Revision: 0x00"
	PID:                   , VID: 0x00, SN: JAD064802LF (65967582)
Or other command, with the same information
	show version
	show hardware

Linenum + includes
show all line with contain 255 with the linenumber
	show run linenum | include 255
show all lines begin beginning with 100
	show run linenum | begin 100
Display with | (pipe) Command
	evil-router#sh run | ?
  	append    Append redirected output to URL (URLs supporting append operation only)
  	begin     Begin with the line that matches
  	exclude   Exclude lines that match
  	include   Include lines that match
  	redirect  Redirect output to URL
  	section   Filter a section of output
  	tee       Copy output to URL

Configuraton Change Notification and Logging
Config Change Notification an loging
	enable
	configure terminal
	archive
	log config
	logging enable
	logging size entries
	hidekeys
	notify syslog 
And Display Command
	
	show archive log config all

Alias
Alias
Samples
	alias exec sbn show ip bgp neighbor
	alias exec sb show ip bgp
	alias exec srip show run | begin router rip
	alias exec sr show run
	alias exec sis show interface status
following alias makes show available in configuratione mode
	alias configure show do show
And Display the Command
	
	show alias

terminal length 0
Change the lenght of lines display to 0
	terminal lenght 0
And Display the Command
	
	show terminal
	
	evil-router#show terminal
	Line 6, Location: "", Type: "xterm"
	Length: 41 lines, Width: 128 columns
	Baud rate (TX/RX) is 9600/9600
	Status: PSI Enabled, Ready, Active, No Exit Banner, Automore On
	Capabilities: none
	Modem state: Ready
	Special Chars: Escape  Hold  Stop  Start  Disconnect  Activation
	                ^^x    none   -     -       none
	Timeouts:      Idle EXEC    Idle Session   Modem Answer  Session   Dispatch
 	              00:10:00        never                        none     not set
	                            Idle Session Disconnect Warning
	                              never
	                            Login-sequence User Response
	                            00:00:30
	                          Autoselect Initial Wait
	                            not set
	Modem type is unknown.
	Session limit is not set.
	Time since activation: 00:26:07
	Editing is enabled.
	History is enabled, history size is 20.
	DNS resolution in show commands is enabled
	Full user help is disabled
	Allowed input transports are telnet ssh.
	Allowed output transports are pad telnet rlogin ssh.
	Preferred transport is telnet.
	No output characters are padded
	No special data dispatching character

Cisco Command reference
show parser dump all
this command displays all commands on a router.
	evil-router#sh parser dump all
	 Mode Name :exec
	15 upgrade
	15 upgrade rom-monitor preference readonly
	15 upgrade rom-monitor preference upgrade
	15 upgrade rom-monitor file <URL>
	15 upgrade filesystem monlib
	1 clear
	1 clear counters <interface>
	1 clear counters Line <tty>
	1 clear counters
	1 clear host vrf <string> <string>
	1 clear host all
	1 clear host
	1 clear parser cache
	1 clear logging xml
	1 clear logging
	1 clear access-list counters <1-199>
	1 clear access-list counters <1300-2699>        

Tee Command / Redirect Command
Tee Command
The Tee Command will display the output and create a file
	evil-router#show run | tee ?
	  /append  Copy and append output to URL (URLs supporting append operation only)
	  flash:   Uniform Resource Locator
	  ftp:     Uniform Resource Locator
	  http:    Uniform Resource Locator
	  https:   Uniform Resource Locator
	  nvram:   Uniform Resource Locator
	  pram:    Uniform Resource Locator
	  rcp:     Uniform Resource Locator
	  scp:     Uniform Resource Locator
	  snmp:    Uniform Resource Locator
	  tftp:    Uniform Resource Locator
Sample
	show tech-support | tee tftp://192.168.1.1/techsupp.txt
	show running | /append tee tftp://192.168.1.1/techsupp.txt	
		And Display the Command
Redirect Command
The Redirect Command will create a file
	evil-router#show run | redirect ?
	  flash:  Uniform Resource Locator
	  ftp:    Uniform Resource Locator
	  http:   Uniform Resource Locator
	  https:  Uniform Resource Locator
	  nvram:  Uniform Resource Locator
	  pram:   Uniform Resource Locator
	  rcp:    Uniform Resource Locator
	  scp:    Uniform Resource Locator
	  snmp:   Uniform Resource Locator
Sample
	show running | redirect tftp://192.168.1.1/techsupp.txt

processes cpu
show processes cpu history
Display cpu History
	evil-router#sh processes cpu history
	
	evil-router   07:35:12 PM Monday May 5 2008 UTC
	
	
	    99999999995555511111
	    66666666666666600000
	100 **********
	 90 **********
	 80 **********
	 70 **********
	 60 ***************
	 50 ***************
	 40 ***************
	 30 ***************
	 20 ***************
	 10 ********************
	   0....5....1....1....2....2....3....3....4....4....5....5....
	             0    5    0    5    0    5    0    5    0    5
	               CPU% per second (last 60 seconds)
	      11 1                    1
	    1 0090996666566 112218899909866665655   111 11 1 11  114
	    0700905142636059002215921003904709182959000600707009810097
	100   *****                   *
	 90   *#*#**             **####**
	 80   *#*##*             *######*
	 70   *#*###  *   *      *######*  *
	 60   ##*###*******      *#######*******
	 50   ##*#########*      *##############*
	 40   ##*##########      ###############*                  *
	 30   ##*##########      ################                  *
	 20   ##*##########   ** ################                  *
	 10 **#############******################******************#****
	   0....5....1....1....2....2....3....3....4....4....5....5....
	             0    5    0    5    0    5    0    5    0    5
	               CPU% per minute (last 60 minutes)
	              * = maximum CPU%   # = average CPU%
	    1
	    0
	    0
	100 *
	 90 *
	 80 *
	 70 *
	 60 *
	 50 *
	 40 *
	 30 *
	 20 #
	 10 #
	   0....5....1....1....2....2....3....3....4....4....5....5....6....6....7.
	             0    5    0    5    0    5    0    5    0    5    0    5    0
	                   CPU% per hour (last 72 hours)
	                  * = maximum CPU%   # = average CPU%
	

more command
MORE Commands and its options:
 evil-router#more ?
   /ascii    Display binary files in ascii
   /binary   Force display to hex/text format
   /ebcdic   Display binary files in ebcdic
   archive:  File to display
   cns:      File to display
   flash:    File to display
   ftp:      File to display
   http:     File to display
   https:    File to display
   null:     File to display
   nvram:    File to display
   pram:     File to display
   rcp:      File to display
   scp:      File to display
   snmp:     File to display
   system:   File to display
   tar:      File to display
   tftp:     File to display
   xmodem:   File to display
   ymodem:   File to display

 evil-router#more /?
 /ascii  /binary  /ebcdic
 
 evil-router#
with mor /binary you can force to display the output in binary format:
 evil-router#more /binary auto.tcl
 00000000:  23200A23 202D2D2D 2D2D2D2D 2D2D2D2D    # .#  --- ---- ----
 00000010:  2D2D2D2D 2D2D2D2D 2D2D2D2D 2D2D2D2D    ---- ---- ---- ----
 00000020:  2D2D2D2D 2D2D2D2D 2D2D2D2D 0A232020    ---- ---- ---- .#
 00000030:  436F7079 72696768 74202863 29203230    Copy righ t (c ) 20
 00000040:  30302D32 3030322C 20323030 342D3230    00-2 002,  200 4-20
 00000050:  30352062 79204369 73636F20 53797374    05 b y Ci sco  Syst
 00000060:  656D732C 20496E63 2E0A2320 20416C6C    ems,  Inc ..#   All
 00000070:  20726967 68747320 72657365 72766564     rig hts  rese rved
or display remote files:
 evil-router#more http://192.168.2.1/index.html
 <html>
 <main<
 <H1<Webseite Monitoring</H1<
 <h3<MRTG HP Laserjet 4</H3<
 <A HREF="./mrtg/hplj4/index.html"<HP Laserjet 4 Printer </A<</BR<
 <A HREF="/cgi-bin/hplj4.cgi"<HP Laserjet 4 Printer RRD</A<</BR<
 <h3<MRTG VDSL</H3<
 <A HREF="./mrtg/vdsl/index.html"<VDSL Router </A<</BR<
 .
 .

show ip traffic
show ip traffic
Displays Packet Statistics of a Cisco Device.
IP statistics:           
  Rcvd:  217 total, 217 local destination
         0 format errors, 0 checksum errors, 0 bad hop count
         0 unknown protocol, 0 not a gateway                
         0 security failures, 0 bad options, 0 with options 
  Opts:  0 end, 0 nop, 0 basic security, 0 loose source route
         0 timestamp, 0 extended security, 0 record route    
         0 stream ID, 0 strict source route, 0 alert, 0 cipso, 0 ump
         0 other                                                    
  Frags: 0 reassembled, 0 timeouts, 0 couldn't reassemble           
         0 fragmented, 0 fragments, 0 couldn't fragment             
  Bcast: 82 received, 0 sent                                        
  Mcast: 0 received, 0 sent                                         
  Sent:  109 generated, 0 forwarded                                 
  Drop:  20 encapsulation failed, 0 unresolved, 0 no adjacency      
         0 no route, 0 unicast RPF, 0 forced drop                   
         0 options denied                                                                                                                      
  Drop:  0 packets with source IP address zero                                                                                                 
  Drop:  0 packets with internal loop back IP address                                                                                          
         0 physical broadcast                                                                                                                  

ICMP statistics:
  Rcvd: 0 format errors, 0 checksum errors, 18 redirects, 0 unreachable
        0 echo, 0 echo reply, 0 mask requests, 0 mask replies, 0 quench
        0 parameter, 0 timestamp, 0 timestamp replies, 0 info request, 0 other
        0 irdp solicitations, 0 irdp advertisements                           
        0 time exceeded, 0 info replies                                       
  Sent: 0 redirects, 0 unreachable, 0 echo, 0 echo reply                      
        0 mask requests, 0 mask replies, 0 quench, 0 timestamp, 0 timestamp replies
        0 info reply, 0 time exceeded, 0 parameter problem                         
        0 irdp solicitations, 0 irdp advertisements                                

TCP statistics:
  Rcvd: 89 total, 0 checksum errors, 0 no port
  Sent: 66 total                              

BGP statistics:
  Rcvd: 0 total, 0 opens, 0 notifications, 0 updates
        0 keepalives, 0 route-refresh, 0 unrecognized
  Sent: 0 total, 0 opens, 0 notifications, 0 updates
        0 keepalives, 0 route-refresh

IP-EIGRP statistics:
  Rcvd: 0 total
  Sent: 0 total

PIMv2 statistics: Sent/Received
  Total: 0/0, 0 checksum errors, 0 format errors
  Registers: 0/0 (0 non-rp, 0 non-sm-group), Register Stops: 0/0,  Hellos: 0/0
  Join/Prunes: 0/0, Asserts: 0/0, grafts: 0/0
  Bootstraps: 0/0, Candidate_RP_Advertisements: 0/0
  Queue drops: 0
  State-Refresh: 0/0

IGMP statistics: Sent/Received
  Total: 0/0, Format errors: 0/0, Checksum errors: 0/0
  Host Queries: 0/0, Host Reports: 0/0, Host Leaves: 0/0
  DVMRP: 0/0, PIM: 0/0
  Queue drops: 0

UDP statistics:
  Rcvd: 110 total, 0 checksum errors, 84 no port
  Sent: 44 total, 0 forwarded broadcasts

OSPF statistics:
  Rcvd: 0 total, 0 checksum errors
        0 hello, 0 database desc, 0 link state req
        0 link state updates, 0 link state acks

  Sent: 0 total
        0 hello, 0 database desc, 0 link state req
        0 link state updates, 0 link state acks

ARP statistics:
  Rcvd: 754 requests, 2 replies, 0 reverse, 0 other
  Sent: 2 requests, 16 replies (0 proxy), 0 reverse
  Drop due to input queue full: 0

NEW Commands seen
Commands seen and need documentation
	sh warm		
	reload in	Schedule a reload of the software (IOS) to take effect in the specified minutes or hours and minutes.
	reload at	Schedule a reload of the software to take place at the specified time
	logging synchronous	Stops those console messages appearing in the middle of the command you are currently typing. 
	no ip source-route	
	no ip unreachable	Disabling unreachables making network mapping harder.
	no ip directed broadcast This prevents Smurf attacks which is when a ping to the network address causes all hosts to send replies to the source of the ping.
	no ip proxy-arp
	no ip redirects
	exec-timeout 5 		apply a five minute timeout under all consoles, line vtys etc.
(c) 2008 by packetlevel.ch / last update: 26.08.2008