Monday, January 30, 2012

Cisco Router Configuration: Cheat Sheet for Router IOS Modes and CLI

Here are some basic commands so frequently used they're second nature and you'll only find them in your Study Notes for the CCNA Exam.

Cisco Command Line interface (CLI). I am most familiar with the CLI, however I was warned that with the newer exams it was important to be somewhat familiar with SDM.

Cisco SDM - Security Device Manager, web based management system to do router configuration. How do you know if SDM is already loaded on a router, show flash.

Several modes in the various stages of IOS
setup mode: when no valid configuration file is found in NVRAM
user mode: to view statistics and basic information. The prompt Router>
Privileged mode: type enable to view and modify the configuration. The prompt Router#
Global configuration mode: to make global changes; to access this mode from the privileged mode, type enable. The prompt Router(config)#
Interface configuration mode: to make changes to a specific interface, type conf t The prompt Router(config-if)#


If both the enable secret and the enable password commands are configured on your router, how do you get to the # prompt?
Enter the enable secret command.


If you try to make the enable and enable secret password the same despite the warning messages, neither will work and then you have to do Password Recovery. This happened to me!

The basic Cisco commands:
enable: puts you in Privileged mode
disable: takes you back to User mode
logout: completely exits the router
exit: exits the current configuration mode
conf t: shortcut for configure terminal, moves you to global configuration mode
int #: you're in the configuration mode of the specific interface by number, example int fast-ethernet 0/15
line console 0: a subcommand from global configuration mode, modifications to console access, passwords line vty 0 4: a subcommand, from global configuration mode, modifications to vty (telnet) access, passwords
line aux 0: a subcommand, from global configuration mode to modify auxilary (telnet) access, passwords
Ctrl Z, end: like logout, disable

The quick reference guide for more Cisco commands
router protocol: in global configuration mode, configure that protocol eg. router RIP
show running-config: in privileged mode, show the running configuration in RAM
show startup-config: in privileged mode, show the startup config in NVRAM
show compress
show post command when the system runs, in order to see if any port had failed a POST test
show controllers: view the hardware related info on the router/ switch interfaces. Does not show operational status of the switchport
show interface: shows detailed information regarding interfaces or specify the interface, eg. show int fa 0/15
more precisely, show interfaces fa 0/15 switchport
show history: shows the last ten commands
show version: displays hardware and software versions
show user: see who has telnet sessions to the router
clock set: clock set hh:mm:ss mmm yyyy
banner [motd | incoming | login | exec]: sets the Message of the Day banner. Incoming for users using reverse telnet, login on all terminals, exec banner used on line activation like vty.
clock rate rate: in interface configuration mode, setting the device as a DCE. The DCE end of cable must be connected and detected to use the command.
bandwidth rate: not for setting the bandwidth rate all, but used for routing protocols to choose the best path
hostname: in global configuration mode, sets the hostname of the system eg. Router1
username: Example username admin priv 15 password cisco username bob priv 7 password cisco
enable password: in global configuration mode, sets the enable password for the router
enable secret: in global configuration mode, sets the secret password. It's encrypted and overrides the enable password. Cannot be the same as the enable password or it's bad!
no ip domain-lookup: this is a handy command to include so that when you make a typo or incomplete command, the router won't assume you are trying to telnet to a hostname and try to resolve it
ip name-server name-of-DNS-server: the router will use this server for DNS
ip domin-name name: this will append the fully qualified domain name to the hostname

show ip route: will show the contents of the routing table
show ip interface: shows the IP information on interfaces (including access-lists)
encapsulation (hdlc | ppp | frame-relay): choose the encapsulation on  serial interface
ppp encapsulation (pap| chap): set the password for ppp authentication
show frame-relay pvc: shows permanent virtual circuit information including the status
show frame-relay map: shows layer 3 (IP) to layer 3 (DLCI) mapping of PVC



Shortcut commands may pop up in the CCNA Exam Questions
Ctrl+ A: move cursor to beginning of line
Ctrl+ E: end
Ctrl+ Z: move back to the EXEC prompt in privileged mode
Tab: complete a partially entered command, autofill
Esc+ F: move forward one word
Esc+ B: move back one word
Ctrl+ F: move forward one character
Ctrl+ B: back
Ctrl+ D: delete a character
Backspace: delete a character
Ctrl+ U: delete everything on a line before the cursor
Ctrl+ W: delete a word
Ctrl+ P: recall the last line
Up and Down arrows: Recall previous older commands or recall more recent commands

Commands related to debug
Before running the debug command, turn on the synchronous logging first.
conf t
line con 0
logging synchronous

Use the debug command sparingly and be very specific for which item you are debugging. Never debug EVERYTHING (debug all) becuase the output buffer to the screen will fill up very quickly and you will be unable to stop it and the router will certainly crash. Privileged EXEC mode -
Add a timestamp to debug or log message
usage: service timestamps debug datetime msec
Display CPU usage
usage: show processes
Disable all debug commands
usage: undebug all (shortcut u all)
Display debug output to current vty session
usage: terminal monitor


Fancy stuff to be used only by a super geek:
conf t: configure from terminal (user input command line interface)
conf mem: merge startup configuration in NVRAM with the running config
conf network: merge startup config stored on a TFTP server with the running config
conf overwrite-network: overwrite the startup config stored in NVRAM with a configuration from the TFTP server

No comments:

Post a Comment