Cover | Table of Contents | Colophon
The modern world is networked in a way that could barely be imagined a few decades ago. Today, the Internet reaches into virtually every business and almost every home. Our children and even our grandparents speak of dot-coms, email, and web sites. The Internet is now part of our culture.
Router>
show commands in user mode
are limited to a few basic levels. You cannot edit or view configurations at this stage; you can only view the router status and other miscellaneous information. To obtain a basic listing of commands, type a question mark:
Router>?
enable command to enter this mode:Router>enable Password: Router# Privileged mode prompt
> at the end; the privileged mode prompt always has a # at the end, regardless of the submode.configure terminal (see "Command-Line Completion" later in this chapter for a shortcut). This command can be entered only when you are in privileged mode.Router#configure terminal Enter configuration commands, one per line. End with Ctrl-Z
configure terminal:
Router#configure terminal
Router#conf t
conf t to configure terminal, completing the command for you. It may seem like extra work to learn these short versions of the commands, but doing so really pays off, especially for the commands you use frequently. But if you haven't learned the shortcut, you can try pressing Tab. In this case, you could have pressed Tab after typing conf; the router fills in the best completion, which is configure. If you press Tab and the router doesn't fill in the rest of the command, type a few more letters and press Tab again.
Router#show running-config
Router#sh ru
show is what you wanted, because show is the only command that begins with "sh"; likewise, the only subcommand of show that begins with "ru" is running-config.^) under the point at which it ran into trouble. For example:
Router>show itnerface e0
>show itnerface e0
^
% Invalid input detected at '^' marker.
Router>show interface e0
Router>sh int e0
? at the prompt. You can also use this trick to find the subcommands of any command. For example, if you know you want to use the copy command but cannot remember which subcommand you need, type:
Router#copy ?
WORD Copy from flash device - format <dev:>[partition:][filename]
flash Copy from system flash
flh-log Copy FLH log file to server
mop Copy from a MOP server
rcp Copy from an rcp server
running-config Copy from current system configuration
startup-config Copy from startup configuration
tftp Copy from a TFTP server
configure command begins with "co", but that's it. The router gives us the matching commands:
Router#co?
configure connect copy
copy. Had there not been a space, the router would have tried to complete the word "copy" for us, not given us the next available commands. In the next example, we did not add the space, so the router tried to complete "co" with all the commands it could find that start with "co".|
Keys
|
Commands
|
|---|---|
|
Ctrl-a
|
Returns the cursor to the beginning of the current line.
|
|
Ctrl-b
|
Moves the cursor back one character. (Equivalent to the left-arrow key.)
|
|
Ctrl-d
|
Deletes the character to the left of the cursor.
|
|
Ctrl-e
|
Moves the cursor to the end of the line.
|
|
Ctrl-f
|
Moves the cursor forward one character. (Equivalent to the right-arrow key.)
|
|
Ctrl-k
|
Deletes all the characters from the current cursor position to the end of the line.
|
|
Ctrl-n
|
Goes to the next command in the session history. (Equivalent to the down-arrow key.)
|
|
Ctrl-p
|
Goes to the previous command in the session history. (Equivalent to the up-arrow key.)
|
|
Ctrl-t
|
Switches the current character with the character to the left of the cursor.
|
terminal command, you can set an important feature of the user interface: the pausing of lengthy output. For example, if you run a command that has more than one page of output, the router will pause after 24 lines with a —More— prompt. The value 24 is the default terminal length. Depending on the size of your terminal window, this might not be adequate. You can change the length and width using the terminal command, like this:Router>terminal length 10 Router>terminal width 80
Router>terminal length 0
show commands. They are among the most useful commands you will ever use; they allow you to view just about any settings within the router. Issuing the command show ? produces output like this:
Router>show ?
clock Display the system clock
history Display the session command history
hosts IP domain-name, lookup style, nameservers, and host table
sessions Information about Telnet connections
snmp snmp statistics
terminal Display terminal configuration parameters
users Display information about terminal lines
version System hardware and software status
show command has many different subcommands. However, notice that we are in user mode. In privileged mode, the show command has a lot more subcommands, which would take up a few pages if we listed them here. The important thing to remember is that show commands often have more than one keyword. For example, the command show ip route works by itself, but many other options can be applied to it. For example:
router#show ip route ?
Hostname or A.B.C.D Network to display information about or hostname
bgp Border Gateway Protocol (BGP)
connected Connected
egp Exterior Gateway Protocol (EGP)
eigrp Enhanced Interior Gateway Routing Protocol (EIGRP)
igrp Interior Gateway Routing Protocol (IGRP)
isis ISO IS-IS
odr On Demand stub Routes
ospf Open Shortest Path First (OSPF)
rip Routing Information Protocol (RIP)
static Static routes
summary Summary of all routes
supernets-only Show supernet entries only
<cr>
show keywords with the question mark. The show version:
Router>show version
Cisco Internetwork Operating System Software IOS (tm)
3600 Software (C3640-JS-M), Version 12.0(5)T1, RELEASE SOFTWARE (fc1)
show version:
Router>show version
Cisco Internetwork Operating System Software IOS (tm)
3600 Software (C3640-JS-M), Version 12.0(5)T1, RELEASE SOFTWARE (fc1)
|
Identifier
|
Platforms
|
|---|---|
|
as
|
Access Server 5200 series
|
|
ca
|
Cisco Advantage
|
|
cpa
|
Cisco Pro
|
|
cs
|
Communication Server
|
|
c800, c1000, c1005, c1600
|
c3745-entbase-mz.123-9a.bin
ethernet0). Let's assume that the address 10.10.1.1 is available for the router and that the TFTP server is 10.10.1.2. Before you load the new image, enter the following commands:Router>enable Router#config terminal Router(config)#interface ethernet0 Router(config-if)#ip address 10.10.1.1 255.255.255.0 Router(config-if)#no shutdown Router(config-if)#exit Router(config)#exit Router#ping 10.10.1.2
|
Filesystem type
|
Router
|
|---|---|
|
Class A
|
7000 series, C12000, and LightStream 1010
|
|
Class B
|
1003, 1004, 1005, 2500, 2600, 3600, 4000, AS5200, 800
|
|
Class C
|
3810, disk0 of SC3640
|
|
Command
|
Filesystem
|
Description
|
|---|---|---|
cd
|
All
|
Changes the working directory.
|
delete
|
All
|
Router#copy running-config startup-config
Building configuration...
Router#copy running-config tftp
Router#copy tftp running-config (for TFTP) Router#copy rcp running-config (for RCP) Router#copy scp://user@ip:. running-config (for SCP)
Router#copy tftp startup-config (for TFTP) Router#copy rcp startup-config (for RCP) Router#copy scp://user@ip:. startup-config (for SCP)
Router#copy running-config startup-config
Router#show startup-config Router#show running-config
hostname command:
Router(config)#hostname Sphinx
Sphinx(config)#
hostname command:
Router(config)#hostname Sphinx
Sphinx(config)#
prompt command. For example:Sphinx(config)#prompt %h:%n%p Sphinx(config)#exit Sphinx:5#
%h), followed by the command number (%n), followed by the appropriate prompt character for the current command mode (%p). The escape sequences for the prompt command are listed in Table 3-1.|
Escape sequence
|
Meaning
|
|---|---|
%%
|
Percent character
|
%h
|
Hostname of the router
|
%n
|
TTY number for this EXEC session
|
%p
|
Prompt character: either
> for user level or # for privileged level |
%s
|
Space character
|
%t
|
Tab character
|
! ! This is a comment. !
enable password command:
Router(config)#enable password not2secure
not2secure. Once the password is set, the router prompts you for the password before it enters privileged mode.service password-encryption (with no arguments) configures the router to store the password in an encrypted form.show commands or to use commands such as ping to check your network connectivity.ip host command builds and maintains the router's host table. This command takes a hostname, followed by one or more IP addresses. You can have up to eight IP addresses per hostname.ip host pyramid 10.10.1.3 ip host sphinx 10.10.1.2 10.10.1.4 10.10.1.5
no ip host pyramid 10.10.1.3 no ip host sphinx 10.10.1.2 10.10.14 10.10.1.5
ip domain-lookup. To configure DNS, you must specify one or more name servers and the domain name to be used to complete unqualified names (typically, your own domain name). A typical configuration looks like this:clock set command. This command is not a configuration command (i.e., you must be in enable mode to give it, but you don't need to give the configure terminal command) and is not stored in the router's configuration. The time is in military (24-hour) time
. For example:
Router#clock set 13:00:00 20 jun 1999
clock timezone command. This command is part of the router's configuration. For example, a router on the east coast of the United States would have the line:
Router(config)#clock timezone EST -5
Router(config)#clock summer-time EDT recurring
calendar set command simply sets the time and is not stored in the router's configuration.Router#calendar set 12:10:00 5 September 2004 Router#clock read-calendar
snmp-server community name mode access-list
RO for read-only access (unprivileged) or RW for read-write access (privileged). RO means that the management station can read information about the router but can't change anything; RW allows the management station to use SNMP to change the router's state. SNMP management stations typically use different community strings for read and write operations.cdp run
no form of the command:no cdp run
no cdp enable command in interface configuration mode.
Router>show cdp neighbors
Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge
S - Switch, H - Host, I - IGMP
Device ID Local Intrfce Holdtme Capability Platform Port ID
switch1 Eth 0 162 T S 1900 AUI
router2 Eth 0 176 R 4000 Eth 0
show cdp neighbors detail, which will give you much more information, such as the IP addresses of the interfaces.This is the message of the day banner. (motd banner) This is the login banner. (login banner) User access verification Password: (not echoed) This is the exec banner. (exec banner) Router> (user mode prompt)
#
message
#. The pound character (#) represents the delimiting character of your choice and marks the beginning and end of your message. You cannot use the delimiting character inside the message body. For example, this command sets the message of the day:
Router(config)#banner motd # Router will be rebooted today for
maintenance. #
Router(config)#banner motd $ Enter TEXT message. End with the character '$'. Router will be down until tomorrow. I guess we should have planned it better. $ Router(config)#
banner command followed by the type of banner and the message:Router(config)#banner motd # message # Router(config)#banner login # message # Router(config)#banner exec # message # Router(config)#banner incoming #