The following commands are executed by pressing the appropriate key:
- Question Mark: Gets help.
- Use at any prompt to see what commands can be executed there.
- Type in the beginning of a command, followed directly by a question mark (no space in between), to see the commands starting with those characters.
- Type in a command, then a space, then a question mark, to see options.
- Q: When in user or privileged EXEC mode, logs you out of the router. When at the "---More---" prompt, returns you to the EXEC prompt.
- Tab: Completes a partial command name entry.
- Backspace: Erases the character to the left of the cursor.
- Return: When at the "---More---" prompt, displays the next line.
- Space Bar: When at the "---More---" prompt, displays the next screen.
- Left Arrow: Moves the cursor one character to the left (same as Ctrl-B).
- Right Arrow: Moves the cursor one character to the right (same as Ctrl-F).
- Up Arrow: Recalls commands in the history buffer, beginning with the most recent command (same as Ctrl-P).
- Down Arrow: Recalls more recent commands in the history buffer (same as Ctrl-N).
The following commands are executed by pressing the keys simultaneously:
- Ctrl-A: Moves the cursor to the beginning of the line.
- Ctrl-B: Moves the cursor back one character (same as Left Arrow).
- Ctrl-C: When in any config mode, ends the config mode and returns you to privileged EXEC mode.
- Ctrl-D: Deletes the character at the cursor.
- Ctrl-E: Moves the cursor to the end of the command line.
- Ctrl-F: Moves the cursor forward one character (same as Right Arrow).
- Ctrl-I: Redisplays the system prompt and command line (same as Ctrl-L and Ctrl-R).
- Ctrl-K: Deletes all characters from the cursor to the end of the command line.
- Ctrl-L: Redisplays the system prompt and command line (same as Ctrl-I and Ctrl-R).
- Ctrl-N: Recalls more recent commands in the history buffer (same as Down Arrow).
- Ctrl-P: Recalls commands in the history buffer, beginning with the most recent command (same as Up Arrow).
- Ctrl-R: Redisplays the system prompt and command line (same as Ctrl-I and Ctrl-L).
- Ctrl-T: Transposes the character to the left of the cursor with the character located at the cursor.
- Ctrl-U: Deletes all characters from the cursor back to the beginning of the command line (same as Ctrl-X).
- Ctrl-V: Inserts a code to indicate to the system that the keystroke immediately following should be treated as a command entry, not as an editing key (same as Esc Q).
- Ctrl-W: Deletes the word to the left of the cursor.
- Ctrl-X: Deletes all characters from the cursor back to the beginning of the command line (same as Ctrl-U).
- Ctrl-Y: Recalls the most recent entry in the delete buffer. The delete buffer contains the last ten items you have deleted or cut. Ctrl-Y can be used in conjunction with Esc Y.
- Ctrl-Z: When in a config mode, ends the config mode and returns you to privileged EXEC mode. When in user or privileged EXEC mode, logs you out of the router.
- Ctrl-Shift-6: All-purpose break sequence. Use to abort DNS lookups, traces, pings, etc.
- Ctrl-Shift-6, followed by X: Suspends (but doesn't terminate) a telnet session. To see the open sessions, use "show sessions". To return to a suspended session, enter that session's number followed by the * Return key. To return to the most recently suspended session, hit the Return key at the EXEC mode prompt.
The following commands are executed by pressing and releasing the escape key, and then pressing the appropriate letter:#
- Esc B: Moves the cursor back one word.
- Esc C: Capitalizes the word from the cursor to the end of the word.
- Esc D: Deletes from the cursor to the end of the word.
- Esc F: Moves the cursor forward one word.
- Esc L: Changes the word to lowercase from the cursor to the end of the word.
- Esc Q: Inserts a code to indicate to the system that the keystroke immediately following should be treated as a command entry, not as an editing key (same as Ctrl-V).
- Esc U: Capitalizes from the cursor to the end of the word.
- Esc Y: Recalls the next buffer entry. The buffer contains the last ten items you have deleted. Press "Ctrl-Y" first to recall the most recent entry. Then do "Esc Y" up to nine times to recall the remaining entries in the buffer. If you bypass an entry, continue to press "Esc Y" to cycle back to it.
You'll also find the following commands to be useful (when specifying options, don't include the brackets):
- conf t: When in privileged EXEC mode, puts you into global config mode.
- copy run start: Saves the running config to NVRAM. This is an overwrite.
- copy start run: Merges the startup config into the running config. This is NOT an overwrite.
- debug option: Starts the specified debugging. Use "debug ?" to see the choices.
- en (enable): When in user EXEC mode, gets you into privileged EXEC mode.
- end: When in a config mode, takes you back to privileged EXEC mode.
- ex (exit): When in user or privileged EXEC mode, logs you out of the router. When in global config mode, takes you to privileged EXEC mode. When in a specific config mode, takes you back to global config mode.
- int type number: When in any config mode, takes you to interface config mode for the specified interface.
- logg sync (logging synchronous): When in line config mode, turns on automatic redisplay of command lines interrupted by console messages.
- no logging console: When in global config mode, shuts off informational messages ("logging console" turns them back on).
- no ip domain-lookup: When in global config mode, shuts off DNS name resolution ("ip domain-lookup" turns it back on).
- router protocol AS-number: When in global config mode, takes you to router config mode for the specified IP routing protocol.
- term mon (terminal monitor): When in line config mode, sends debugging messages to the chosen terminal line.
- un all (undebug all): When in privileged EXEC mode, shuts off all debugging.
Show Commands#
Commonly used "show" commands (when specifying options, don't include the brackets):- sh config: The obsolete, pre-10.3 version of "sh start".
- sh cont type number: Layer-1 info for specified interface, including cable type, DTE/DCE, etc. Example: "sh cont e 3" (NOT "sh cont e3").
- sh int type number: Layer-2 info for specified interfaces. Example: "sh int e0".
- sh protocol int type number: Layer-3 info for the specified protocol and interface. Example: "sh ip int s2".
- sh proto: Active Layer 3 protocols.
- sh ip proto: Active IP routing protocols.
- sh protocol route: Routing table for the specified protocol. Example: "sh ip route".
- sh run (show running-config): Shows the running config. Obsoletes "write terminal".
- sh start (show startup-config): Shows the startup config. Obsoletes "show config".
- wr term: The obsolete, pre-10.3 version of "sh run".
Copy TFTP commands (used to backup and restore configs and IOS):#
- copy flash tftp: Copies a file from flash to a TFTP server.
- copy run tftp: Copies the running config to a TFTP server.
- copy start tftp: Copies the startup config to a TFTP server.
- copy tftp flash: Copies a file from a TFTP server to flash.
- copy tftp run: Merges a file on the TFTP server into the running config.
- copy tftp start: Replaces the startup config with a file from a TFTP server.
Hints for "copy" commands which involve a TFTP server ...#
Make sure that the TFTP server software is configured and running. Make sure that the router can see the TFTP server (PING it). Execute the appropriate "copy" command. Make sure that you READ THE QUESTIONS before you answer them!Useful terms:#
- Flash: Special type of RAM that does not lose its contents when power is removed. Used to store IOS.
- IOS (Internetwork Operating System): Cisco's operating system. Stored in flash.
- NVRAM (Non-Volatile RAM): RAM with a battery attached, used to store the startup config.
- POST (Power-On Self-Test): Diagnostics performed at boot-up, tests the hardware.
- RAM (Random-Access Memory): Stores frequently-changing data, such as ARP caches, routing tables, packets awaiting forwarding, etc.
- ROM (Read-Only Memory): Chipset on system board where POST and boot loader (and, on some routers, an IOS subset) are stored.
- running config (also known as "current" or "active" config): How the router is currently configured. Stored in RAM.
- startup config (also known as "backup" config): How the router will be configured at the next restart. Stored in NVRAM.
Remember ...#
- Show commands don't work from ANY config mode.
- Config commands don't work from user or privileged EXEC mode.
- Hot keys and command keywords are not case-sensitive, BUT PASSWORDS ARE!
- Some (not all!) of these commands work on some (not all!) of the switches.
Basic Router Commands To get into Privilege Mode from User mode - enable To exit out of Privilege mode disable To exit the router - Exit or logoff Previous Command - Up arrow or Ctrl-P Next Command - Down arrow or Ctrl-N Move forward one character - Right arrow or Ctrl-F Move back one character - Left arrow or Ctrl-B Break Key or Cancel - <ctrl>“c” Auto Complete the command - <tab> Setting Passwords Set Password for Console Port line console 0 login password password Set Password for Telnet line vty 0 4 login password password Set Password for Privilege (Enabled) mode enable password password Set Encrypted password for Privilege mode enable password password Router Configuration Commands To go from Privilege mode to Global Configuration mode configure terminal To copy the running-configuration to the start-up configuration copy run start To copy the startup-config to the runningconfig copy start run To copy the startup-config to a TFTP server copy start tftp To copy the running-config to a TFTP server copy run tftp Save a backup of the IOS to a TFTP server copy flash tftp Upgrade the IOS from a TFTP server copy tftp flash Tell the router which IOS in flash to boot from boot system flash {filename} Tell the Router which IOS to request from a TFTP server (usually a fallback option) boot system tftp {filename} Viewing the Router’s Information IOS Version info show version Current config stored in RAM show running-config Configuration stored in NVRAM show startup-config To see IOS info stored in flash show flash To see information on the interfaces show interfaces To see a summary of the interfaces show ip int brief To see processor utilization show processes cpu Configuring an Interface To access an interface “From Global config” interface {type} {number} example : interface Ethernet 0 To set Clock rate on a serial interface Clock rate {kbps} Example : clock rate 64000 Enable the interface no shutdown Disable the interface shutdown Assign an IP address to an Interface ip address {Ip address} {subnet mask} Example: ip address 10.1.1.1 255.255.255.0 Configuring TCP/IP To enable IP routing on a Router “From Global config” ip routing To disable IP routing on a Router “From Global config” no ip routing Displays values about routing timers, networks, and routing information. show ip protocols Displays contents of the routing table. show ip route Assign an [IP Address] to an Interface ip address {Ip address} {subnet mask} Example: ip address 10.1.1.1 255.255.255.0 Manually setups up a host table mapping a hostname to an ip address. ip host name “ ip” “addresss” Displays the host table show hosts Configure RIP router rip network “network address” Configure IGRP Router rip Network “network address” Displays RIP updates [debug] ip rip Displays IGRP transactions debug ip igrp transactions Displays IGRP summary transactions Debug ip igrp events Displays status and global parameters associated with an interface show ip interfaces Allows remote management of a device telnet “ip address of host” Uses ICMP to verify hardware connection and logical address of the network layer ping “network address” To setup a static route ip route “network” “mask” “next hop address” IPX configuration Enable IPX on a router ipx routing To enable load balancing ipx maximum-paths “number” To assign a IPX network address to an interface ipx network “network number” To set the encapsulation type on an interface encap novell-ether encap sap encap arpa encap snap To view the IPX routing table show ipx route To view an IPX address on an interface show ipx interface To view the sap table show ipx servers To view IPX traffic statistics show ipx traffic To view the IPX rip updates debug ipx routing activity To view the SAP packets coming and going debug ipx sap Cisco Discovery Protocol See info on directly connected neighbors Add “detail” to the end for more info show cdp neighbors To see what interfaces are runnning CDP show cdp interface To specify and particular neighbor and see CDP information show cdp entry “hostname” To turn off CDP for the entire router no cdp run To turn off CDP for an interface No cdp enable To change how often the router sends CDP updates cdp timer “seconds” To change how long the router will wait before it’s removes a CDP neighber from it’s table cdp holdtime “seconds” Access-Lists IP Standard Access Lists 1-99 Set parameters for this access list test statement access-list access-list-number, permit |deny, source, [source-mask] Enable an interface to become part of a group that uses the specified access list. protocol access-group access-listnumber, in | out IP Extended Access Lists 100-199 Set parameters for this access list entry access-list Access-list-number, permit |deny, protocol, source, source-mask, destination, destination-mask, [operator operand], [established] Enable an interface to become part of a group that uses the specified access list. protocol access-group accesslist- number, in | out Assigns an alpha-numeric name string to an access list ip access-list standard | extended name Activates the access list on an interface ip access-group name | 1-199, in | out Can be used to verify whether access lists are set show ip interfaces Displays the contents of all access lists show access-lists IPX Standard Access Lists 800-899 Set parameters for this access list entry access-list Access-list-number, permit | deny, source-network [.source-node], [source-node-mask], [destinationnetwork], [.destination-node] [destinationnode- mask] Enable an interface to become part of a group that uses the specified access list. ipx access-group access-listnumber, in | out IPX Extended Access Lists 900-999 Set parameters for this access list entry access-list Access-list-number, permit | deny, protocol, source-network [[[.source-node]source-node-mask] | [.source-node source-network-mask.source-nodemask]], [source-socket], [destinationnetwork],[[[. destination-node] destination-node- mask] | [destination-node destination-network- mask.destination-node-mask]], [destination-socket], [log] Enable an interface to become part of a group that uses the specified access list. ipx access-group access-listnumber, in | out IPX SAP Filter Access Lists 1000- 1099 Creates an entry in a SAP filter list access-list Access-list-number, permit | deny, network [.node], [networkmask node-mask], [service-type [servername]] Activates the output SAP filter on the interface ipx output-sap-filter accesslist- number Activates the input SAP filter on the interface ipx input-sap-filter accesslist- number Displays information about the config of the interface including SAP filter numbers. show ipx interface WAN configuration PPP Authentication On each router defines the username and password to expect from the remote router username name password secret Configure the interface for ppp encapsulation encapsulation ppp Configure ppp authentication type PPP authentication chap | chap pap |pap chap | pap Enables PAP on an interface (disabled by default) ppp pap sent-username username password password To use the same host name on multiple routers ppp chap hostname hostname Use to authenticate to an unknown host. This password is not used when the router authenticates a remote device. ppp chap password secret Displays authentication sequence as it occurs [debug] ppp [authentication] Configuring Frame Relay Specifies encapsulation type. encapsulation frame-relay [cisco | ietf] Specifies LMI type used by the FR switch. (default cisco) frame-relay lmi-type ansi | cisco | q933i Inverse ARP is enabled by default. If it has been disabled use this command to enable it. frame-relay inverse-arp [protocol] [dlci] Used to define the address to DLCI table statically. frame-relay map protocol protocoladdress dlci [broadcast] [ietf | cisco ] Displays the route maps (static or dynamic) show frame-relay map Displays LMI information show frame-relay lmi Selects a subinterface to configure interface serial number.subinterface-number multipoint | point-to-point Defines the local DLCI number being linked to the interface frame-relay interface-dlci dlcimumber Misc. Commands Remove 10 minute interval router waits for input no exec-timeout or exec-timeout 0 0 Set clock clock set 20:26:00 04 July 2001 Change number of lines history will record (max 256) terminal history size “lines” Sets token ring speed to 16 Mbps ring-speed 16 Enables early token release early-token release Specifies a media independent interface physical connection media-type 10baseT set the configuration register (where to boot from) 0 for ROM Monitor, 1 for ROM, 2 NVRAM. config-register 0x2102