University of Juba
Computer Science & Information Technology
CNT 411: Computer
Network
Instructor: Richard Ring MSc, BCE
Email : ringkuach@[Link])
Part II Implementing Ethernet
LANs
1. Using the Command-Line Interface
2. Analyzing Ethernet LAN Switching
3. Configuring Basic Switch Management
4. Configuring and Verifying Switch Interfaces
1. Using the Command-Line
Interface (CLI)
Using the Command-Line Interface
1. Accessing the Cisco Catalyst 2. Configuring Cisco IOS
Software 3. Command References
Switch CLI:
Cisco Catalyst Switches
Configuration Sub-modes
and Contexts
Accessing the Cisco IOS CLI
• Cabling the Console Connection
• Accessing the CLI with Telnet and SSH
• User and Enable (Privileged) Modes
• Password Security for CLI Access from the Console
Storing Switch
Configuration Files
CLI Help Features
Copying and Erasing
The debug and show Commands
Configuration Files
Accessing the Cisco Catalyst Switch CLI
1 2
Cisco uses command-line interface CLI is a text-based interface in which
(CLI) with its router products and user, network engineer, enters a text
Catalyst LAN switch products. command and presses Enter.
3
4
Pressing Enter sends command to Switch does what command says, and in
switch, which tells device to do some cases, switch replies with some
something. messages stating results of the
command.
Accessing the Cisco Catalyst Switch CLI
5 6
Cisco Catalyst switches support other
methods to both monitor and configure a
switch. Example, a switch can provide a Switches can be controlled & operated
web interface so that an engineer can using network management software.
open a web browser to connect to a web
server running in the switch.
7 8
Cisco Catalyst enterprise-class
switches, and in particular, how to use Catalyst switches in more detail and then
Cisco CLI to monitor and control these explains how a network engineer can get
switches. access to the CLI to issue commands.
Accessing Cisco Catalyst Switches
9 10
Each switch series several models of switches that have
Within Cisco Catalyst brand of LAN switches, Cisco similar features, similar price-versus-performance
produces a wide variety of switch series or families. tradeoffs, & similar internal components. E.g, Cisco 2960-
XR series of switches was a current switch model series.
11 12
Cisco positions 2960-XR series (family) of switches as full-
featured, low-cost wiring closet switches for enterprises. That Each switch series includes several models, with a mix of features.
means that you would expect to use 2960-XR switches as Example, some of switches have 48 RJ-45 unshielded twisted-pair
access switches in a typical campus LAN design. (UTP) 10/100/1000 ports, meaning that these ports can auto
negotiate use of 10BASE-T (10 Mbps), 100BASE-T (100 Mbps), or
Figure -1 shows a photo of 10 different models from the 1000BASE-T (1 Gbps) Ethernet.
2960-XR switch model series from Cisco.
Accessing Cisco Catalyst Switches
Cisco Switch refers to a switch’s physical connectors as either interfaces or ports, with an interface
type and interface number.
Figure -1 Cisco 2960-XR Catalyst Switch Series
Accessing Cisco Catalyst Switches
Example, a 10/100/1000 interface
Interface type, as used in commands Ethernet interfaces that support
(interface that runs at 10 Mbps, 100
on switch, is either Ethernet, Fast running at multiple speeds, the
Mbps, or 1000 Mbps) called Gigabit
Ethernet, Gigabit Ethernet, and so on permanent name for the interface
Ethernet no matter what speed is
for faster speeds. refers to fastest supported speed.
currently in use.
For instance, two 10/100/1000 ports
To uniquely number each different on many older Cisco Catalyst switches
interface, some Catalyst switches use would be called GigabitEthernet 0/0
a two-digit interface number (x/y), and GigabitEthernet 0/1, while on
while others have a three-digit newer 2960-XR series, two interfaces
number (x/y/z). would be GigabitEthernet 1/0/1 and
GigabitEthernet 1/0/2.
Accessing the Cisco IOS CLI
IOS Software for Catalyst switches
implements and controls logic and IOS CLI allows user to use a terminal
computer hardware, Cisco switches
functions performed by a Cisco emulation program, which accepts
need operating system software
switch. Besides controlling the text entered by user. When user
(Internetwork Operating System
switch’s performance and behavior, presses Enter, terminal emulator
(IOS)).
Cisco IOS also defines an interface sends that text to the switch.
for humans called the CLI.
Two of these methods (Telnet and
switch processes text as if it is a SSH) use the IP network in which the
switch CLI can be accessed through
command, does what the command switch resides to reach the switch.
three popular methods—console,
says, and sends text back to terminal The console is a physical port built
Telnet, and Secure Shell (SSH).
emulator. specifically to allow access to the
CLI. Figure -2 depicts the options.
Accessing the Cisco IOS CLI
Console access requires both a physical connection between a Figure -2 CLI Access Options
PC (or another user device) and the switch’s console port, as
well as some software on the PC.
Telnet and SSH require software on the
user’s device, but they rely on existing
TCP/IP networks to transmit data.
Cabling Console Connection Physical console
connection, both old and new, uses three main
components: a physical console port on a switch, a
physical serial port on the PC, and a cable that works
with the console and serial ports. Physical cabling details have changed slowly over time, because of
advances and changes with serial interfaces on PC hardware.
Accessing the Cisco IOS CLI
Three cases: newer connectors Most PCs today use a familiar
on both PC and the switch, older standard USB cable for the
connectors on both, and a third console connection. Cisco has
case with the newer (USB) been including USB ports as
connector on the PC but with an console ports in newer routers
older connector on the switch. and switches as well.
In simplest form, you can use
All you have to do is look at the any USB port on the PC, with a
switch to make sure you have USB cable, connected to the USB
correct style of USB cable end to console port on the switch or
match the USB console port. router, as shown on far right
side of Figure -3.
Accessing the Cisco IOS CLI
Figure -3 Console Connection to a Switch
Console cables
USB-RJ 45
RJ 45 –serial Port
USB-USB
Accessing the Cisco IOS CLI
Older console connections use a PC
The console port looks like any
serial port that pre-dates USB, a UTP The PC serial port typically has a D-
Ethernet RJ-45 port (but is typically
cable, and an RJ-45 console port on shell connector (roughly rectangular)
colored in blue and with the word
the switch, as shown on the left side with nine pins (often called a DB-9).
console beside it on the switch).
of Figure -3.
The use purpose-built console cable
that ships with new Cisco switches
The cabling for this older-style console and routers and not think about the
connection can be simple or require details. However, you can make your
some effort, depending on what cable own cable with a standard serial cable
you use. (with a connector that matches the
PC), a standard RJ-45 to DB-9
converter plug, and a UTP cable.
Accessing the Cisco IOS CLI
However, the UTP cable does not
As it turns out, USB ports became
use the same pinouts as Ethernet; The rollover pinout uses eight wires,
common on PCs before Cisco began
instead, the cable uses rollover rolling the wire at pin 1 to pin 8, pin
commonly using USB for its console
cable pinouts rather than any of the 2 to pin 7, pin 3 to pin 6, and so on.
ports.
standard Ethernet cabling pinouts.
The center of Figure -3 shows that
So, you also have to be ready to use
case. To connect such a PC to a
a PC that has only a USB port and
router or switch console, you need
not an old serial port, but a router
a USB converter that converts from
or switch that has the older RJ-45
the older console cable to a USB
console port (and no USB console
connector, and a rollover UTP cable,
port).
as shown in the middle of Figure -3.
Accessing the Cisco IOS CLI
Figure -4 A Part of a 2960-XR Switch with Console Ports Shown
Accessing the Cisco IOS CLI
After the PC is The terminal emulator
Similarly, any bits
physically connected to software treats all data
coming into the PC
the console port, a as text. It accepts the
over the console
terminal emulator text typed by the user
connection are
software package must and sends it over the
displayed as text for
be installed and console connection to
the user to read.
configured on the PC. the switch.
Accessing the Cisco IOS CLI
The default console port settings on a
switch are as follows. Note that the last
three parameters are referred to
The emulator must be configured to use collectively as 8N1:
the PC’s serial port to match the settings • 9600 bits/second
on the switch’s console port settings. • No hardware flow control
• 8-bit ASCII
• No parity bits
• 1 stop bit
Figure -5 shows one such terminal
The foreground, in the upper right,
emulator. The image shows the window
shows a settings window that lists the
created by the emulator software in the
default console settings as listed just
background, with some output of a show
before this paragraph.
command.
Figure -5 Terminal Settings for Console Access
Accessing the CLI with Telnet and SSH
Telnet and SSH both allow the user
Terminal emulator applications have to connect to another device’s CLI,
supported far more than the ability Terminal emulators support a but instead of connecting through a
to communicate over a serial port variety of TCP/IP applications as console cable to the console port,
to a local device (like a switch’s well, including Telnet and SSH. the traffic flows over the same IP
console). network that the networking
devices are helping to create.
A Telnet client, the device that sits
in front of the user, accepts
Telnet uses the concept of a Telnet
keyboard input and sends those
client (the terminal application) and
commands to the Telnet server. The
a Telnet server (the switch in this
Telnet server accepts the text,
case).
interprets the text as a command,
and replies back.
Accessing the CLI with Telnet and SSH
Cisco Catalyst switches enable a Telnet
Using Telnet in a lab today makes
server by default, but switches need a
sense, but Telnet poses a significant
few more configuration settings before
security risk in production networks.
you can successfully use Telnet to
Telnet sends all data (including any
connect to a switch. “Configuring Basic
username and password for login to
Switch Management,” covers switch
the switch) as clear-text data. SSH
configuration to support Telnet and
gives us a much better option.
SSH in detail.
The differences exist behind the
Think of SSH as the much more secure
scenes: SSH encrypts the contents of
Telnet cousin. Outwardly, you still
all messages, including the passwords,
open a terminal emulator, connect to
avoiding the possibility of someone
the switch’s IP address, and see the
capturing packets in the network and
switch CLI, no matter whether you use
stealing the password to network
Telnet or SSH.
devices.
User and Enable (Privileged) Modes
All three CLI access methods The “EXEC mode” part of name refers
covered so far (console, Telnet, to the fact that in this mode, when you
and SSH) place user in an area of enter a command, switch executes
the CLI called user EXEC mode. command and then displays messages
that describe command’s results.
User EXEC mode, sometimes also
called user mode, allows user to look
around but not break anything.
User and Enable (Privileged) Modes
NOTE If you have not used the CLI before, you
might want to experiment with the CLI from the
Sim Lite product, or view the video about CLI
basics. You can find these resources on the
companion website as mentioned in the
Introduction.
User and Enable (Privileged) Modes
Cisco IOS supports a more The other name for this mode,
powerful EXEC mode called privileged mode, refers to fact
enable mode (also known as that powerful (or privileged)
privileged mode or privileged commands can be executed
EXEC mode). there.
Enable mode gets its name from
For example, you can use the reload
the enable command, which moves
command, which tells the switch to
the user from user mode to enable
reinitialize or reboot Cisco IOS, only
mode, as shown in Figure -6.
from enable mode.
User and Enable (Privileged) Modes
NOTE If the command prompt lists the
hostname followed by a >, the user is in
user mode; if it is the hostname
followed by the #, the user is in enable
mode.
User and Enable (Privileged) Modes
Figure -6 User and Privileged Modes
Example -1 demonstrates the differences between user and enable modes.
User and Enable (Privileged) Modes)
Example shows the output that you Cisco IOS, so IOS allows this At that point, IOS accepts
could see in a terminal emulator powerful command to be reload command now
window, for instance, when used only from enable mode. that user is in enable
connecting from console. mode.
1 2 3 4 5
The user sits at the user mode prompt IOS rejects the reload command
(“Certskills1>”) and tries the reload when used in user mode. Then user
command. The reload command tells moves to enable mode— also called
switch to reinitialize or reboot privileged mode—(using enable
EXEC command).
User and Enable (Privileged) Modes
Example -1 Example of Privileged Mode Commands Being Rejected in User Mode
User and Enable (Privileged) Modes
NOTE The commands that can be
used in either user (EXEC) mode or
enable (EXEC) mode are called
EXEC commands.
User and Enable (Privileged) Modes
This example is the
first instance of this
book showing you Also, the typed
the output from the passwords do not
CLI, so it is worth show up on the
noting a few screen for security
conventions. purposes.
The bold text Finally, note that this
represents what the switch has been
user typed, and the preconfigured with a
non bold text is hostname of Certskills1,
what the switch so the command prompt
sent back to the on the left shows that
terminal emulator. hostname on each line.
Password Security for CLI Access from the Console
Password Security for CLI
Access from the Console a
Cisco switch, with default
settings, remains relatively The reason is that if you have
secure when locked inside a access to the physical console
wiring closet, because by port of the switch, you already
default, a switch allows have pretty much complete
console access only. control over the switch.
By default, the console You could literally get out your
requires no password at all, screwdriver and walk off with
and no password to reach it, or you could unplug the
enable mode for users that power, or follow well-
happened to connect from the published procedures to go
console. through password recovery to
break into the CLI and then
configure anything you want
to configure.
Password Security for CLI Access from the Console
when the user
connects from the
console, and when any
user moves to enable The output holds an
mode (using the enable excerpt from the EXEC
However, many people EXEC command). You command show
go ahead and set up may have noticed that running-config, which
simple password back in Example -1, the lists the current
protection for console user saw a password configuration in the
users. prompt at both points. switch.
Simple passwords can Example -2 shows the
be configured at two additional
points in the login configuration
process from the commands that were
console: configured prior to
collecting the output in
Example -1.
Password Security for CLI Access from the Console
You might have noticed
The output holds an that the command
excerpt from the EXEC prompts in Example -1
command show all began with
running-config, which Certskills1, and that’s
lists the current why the command
configuration in the prompt begins with the
switch. hostname of the switch.
Working from top to Next, note that the lines
bottom, note that the with a ! in them are
first configuration comment lines, both in
command listed by the the text of this book and
show running-config in the real switch CLI.
command sets the
switch’s hostname to
Certskills1.
Password Security for CLI Access from the Console
Example -2 Non default Basic Configuration
Password Security for CLI Access from the Console
The enable secret love Finally, the last three lines configure the Finally, the password faith
configuration command defines console password. The first line (line command defines the
the password that all users must console 0) is the command that password the console user
use to reach enable mode. identifies the console, basically meaning must type when prompted.
“these next commands apply to the
console only.”
So, no matter whether users Login command tells IOS to
connect from the console, Telnet, or perform simple password checking
SSH, they would use the password (at console). Remember, by default,
love when prompted for a password switch does not ask for a password
after typing the enable EXEC for console users.
command.
Password Security for CLI Access from the Console
Example just scratches surface of the kinds of security configuration you might choose
to configure on a switch, but it does give you enough detail to configure switches in
your lab and get started (which is the reason I put these details in this first.
Volume 2, “Securing Network Devices,” shows additional security configuration as
well.
CLI Help Features
If you printed the Cisco IOS Command Reference documents, you
would end up with a stack of paper several feet tall. No one should
expect to memorize all the commands—and no one does.
You can use several very easy, convenient tools to help remember
commands and save time typing.
As you progress through your Cisco certifications, the exams will
cover progressively more commands. However, you should know
the methods of getting command help.
CLI Help Features
Table -2 summarizes command-recall help options available at the
CLI.
Note that, in the first column, command represents any command.
Likewise, parm represents a command’s parameter.
Example, the second row lists command ?, which means that
commands such as show ? and copy ? would list help for the show
and copy commands, respectively.
CLI Help Features
Table -2 Cisco IOS Software Command Help
What You Enter What Help You Get
? Provides help for all commands available in this mode.
command ? With a space between the command and the ?, the switch lists text to
describe all the first parameter options for the command.
com? Lists commands that start with com.
command Lists all parameters beginning with the parameter typed so far. (Notice
parm? that there is no space between parm and the ?.)
command Pressing the Tab key causes IOS to spell out the rest of the word,
parm<Tab> assuming that you have typed enough of the word so there is only one
option that begins with that string of characters.
command If a space is inserted before the question mark, the CLI lists all the next
parm1 ? parameters and gives a brief explanation of each.
CLI Help Features
When you enter the ?, Cisco IOS CLI reacts immediately; that is,
you don’t need to press
Enter key or any other keys. The device running Cisco IOS also
redisplays what you entered before the ?
To save you some keystrokes. If you press Enter immediately after
the ?,
Cisco IOS tries to execute the command with only parameters you
have entered so far.
CLI Help Features
The information supplied by using help depends on the CLI mode.
Example, when ? is entered in user mode, the commands allowed in user mode are displayed, but
commands available only in enable mode (not in user mode) are not displayed.
Also, help is available in configuration mode, which is the mode used to configure the switch.
In fact, configuration mode has many different sub configuration modes, as explained in the section
“Configuration Submodes and Contexts,” later in this chapter. So, you can get help for the
commands available in each configuration submode as well.
(Note that this might be a good time to use the free Sim Lite product on the companion website—
open any lab, use the question mark, and try some commands.)
CLI Help Features
Cisco IOS stores the commands that you enter in a history buffer,
storing ten commands by default.
The CLI allows you to move backward and forward in the historical
list of commands and then edit the command before reissuing it.
These key sequences can help you use the CLI more quickly on the
exams. Table 4-3 lists the commands used to manipulate previously
entered commands.
CLI Help Features
Table -3 Key Sequences for Command Edit and Recall
Keyboard Command What Happens
Up arrow or Ctrl+P This displays the most recently used command. If you press it again, the next most recent command
appears, until the history buffer is exhausted. (The P stands for previous.)
Down arrow or If you have gone too far back into the history buffer, these keys take you forward to the more
Ctrl+N recently entered commands. (The N stands for next.)
Left arrow or Ctrl+B This moves the cursor backward in the currently displayed command without deleting characters.
(The B stands for back.)
Right arrow or Ctrl+F This moves the cursor forward in the currently displayed command without deleting characters. (The
F stands for forward.)
Backspace This moves the cursor backward in the currently displayed command, deleting characters.
The debug and show Commands
By far, the single most popular Cisco IOS command is the show
command.
The show command has a large variety of options, and with those
options, you can find the status of almost every feature of Cisco IOS.
Essentially, the show command lists the currently known facts about the
switch’s operational status.
The only work the switch does in reaction to show commands is to find
the current status and list the information in messages sent to the user.
The debug and show Commands
For example, consider the output from the show mac
address-table dynamic command listed in Example -3.
This show command, issued from user mode, lists the
table the switch uses to make forwarding decisions.
A switch’s MAC address table basically lists the data a
switch uses to do its primary job.
The debug and show Commands
xample -3 Nondefault Basic Configuration
The debug and show Commands
The debug command also tells user details about operation of switch.
However, while the show command lists status information at one instant of time—
more like a photograph— debug command acts more like a live video camera feed.
Once you issue a debug command, IOS remembers, issuing messages that any switch
user can choose to see.
The console sees these messages by default. Most of the commands used throughout
To verify operation of switches and routers are show commands.
Configuring Cisco IOS Software
You will want to configure every switch in an Enterprise network, even
though switches will forward traffic even with default configuration.
This section covers basic configuration processes, including the concept of a
configuration file and the locations in which configuration files can be stored.
Although this section focuses on configuration process, and not on
configuration commands themselves, you should know all the commands
covered in this chapter for the exams, in addition to configuration processes
Configuring Cisco IOS Software
Configuration mode is another mode for the Cisco CLI, similar to user mode and
privileged mode.
User mode lets you issue non disruptive commands and displays some information.
Privileged mode supports a superset of commands compared to user mode,
including commands that might disrupt switch operations.
However, not one of the commands in user or privileged mode changes the
switch’s configuration.
Configuration mode accepts configuration commands—commands that tell the
switch the details of what to do and how to do it.
Figure -7 illustrates the relationships among configuration mode, user EXEC mode,
and privileged EXEC mode
Configuring Cisco IOS Software
Figure -7 CLI Configuration Mode Versus EXEC Modes
• Switch>
• Switch>
• Switch>enable
• Switch#
• Switch#disable
• Switch>enable
• Switch#configure terminal
• Enter configuration commands, one per line. End with CNTL/Z.
• Switch(config)#
• Switch(config)#hostname CS&IT
• CS&IT(config)#
• CS&IT#
Configuring Cisco IOS Software
These changes to
Commands entered the configuration
Be careful when
in configuration occur immediately
you enter a
mode update the each time you
configuration
active press the Enter key
command!
configuration file. at the end of a
command.
Configuration Sub-modes and
Contexts
These context-setting
Configuration mode itself contains a commands tell switch topic
multitude of commands. To help organize about which you will enter next
the configuration, IOS groups some kinds few configuration commands.
of configuration commands together.
To do that, when using configuration mode,
you move from initial mode—global More importantly, the context
configuration mode—into subcommand tells switch the topic you care
modes. Context-setting commands move about right now, so when you use
you from one configuration subcommand the ? to get help, the switch gives
mode, or context, to another. you help about that topic only.
Configuration Sub-modes and
Contexts
NOTE Context-setting is not a
Cisco term. It is just a description
used here to help make sense of
configuration mode.
Configuration Sub-modes and
Contexts
The best way to learn about configuration submodes is to use
them, but first, take a look at these upcoming examples.
For instance, the interface command is one of the most
commonly used context-setting configuration commands.
For example, the CLI user could enter interface configuration
mode by entering the interface FastEthernet 0/1 configuration
command.
Configuration Sub-modes and
Contexts
Asking for help in interface configuration mode displays only
commands that are useful when configuring Ethernet interfaces.
Commands used in this context are called subcommands— or, in
this specific case, interface subcommands.
When you begin practicing with the CLI with real equipment, the
navigation between modes can become natural.
Configuration Sub-modes and
Contexts
For now, consider Example -4, which shows the following:
• Movement from enable mode to global configuration mode by using the configure
terminal EXEC command
• Using a hostname Fred global configuration command to configure the switch’s
name
• Movement from global configuration mode to console line configuration mode (using
the line console 0 command)
• Setting the console’s simple password to hope (using the password hope line
subcommand)
• Movement from console configuration mode to interface configuration mode (using
the interface type number command)
• Setting the speed to 100 Mbps for interface Fa0/1 (using the speed 100 interface
subcommand)
• Movement from interface configuration mode back to global configuration mode
(using the exit command)
Configuration Submodes and
Contexts
Example -4 Navigating Between Different Configuration Modes
Configuration Sub-modes and
Contexts
Table -4 Common Switch Configuration Modes
Prompt Name of Context-Setting Command(s) to Reach
Mode This Mode
hostname(config)# Global None—first mode after configure
terminal
hostname(config-line)# Line Line line console 0
line vty 0 15
hostname(config-if)# Interface interface type number
hostname(vlan)# VLAN vlan number
Configuration Sub-modes and
Contexts
Figure -8 Navigation In and Out of Switch
Storing Switch Configuration
Files
When you configure a switch, it needs to use the configuration. It also needs to be able to
retain the configuration in case switch loses power.
Cisco switches contain random access memory (RAM) to store data while Cisco IOS is using it,
but RAM loses its contents when the switch loses power or is reloaded.
To store information that must be retained when the switch loses power or is reloaded, Cisco
switches use several types of more permanent memory, none of which has any moving parts.
By avoiding components with moving parts (such as traditional disk drives), switches can
maintain better uptime and availability.
The following list details four main types of memory found in Cisco switches, as well as the
most common use of each type:
Storing Switch Configuration
Files
■ RAM: Sometimes called DRAM, for dynamic random-access memory, RAM is used by the switch just as
it is used by any other computer: for working storage. The running (active) configuration file is stored here.
■ Flash memory: Either a chip inside the switch or a removable memory card, flash memory stores fully
functional Cisco IOS images and is the default location where the switch gets its Cisco IOS at boot time.
Flash memory also can be used to store any other files, including backup copies of configuration files.
■ ROM: Read-only memory (ROM) stores a bootstrap (or boothelper) program that is loaded when the
switch first powers on.
This bootstrap program then finds the full Cisco IOS image and manages the process of loading Cisco IOS
into RAM, at which point Cisco IOS takes over operation of the switch.
■ NVRAM: Nonvolatile RAM (NVRAM) stores the initial or startup configuration file that is used when the
switch is first powered on and when the switch is reloaded.
Storing Switch Configuration
Files
Figure -9 summarizes this same information in a briefer and more
convenient form for memorization and study.
RAM (Working
NVRAM
Memory and Flash (Cisco IOS ROM (Bootstrap
(Startup
Running Software) Program)
Configuration)
Configuration)
Figure -9 Cisco Switch Memory Types
Storing Switch Configuration
Files
Cisco IOS stores the collection of configuration commands in a
configuration file.
In fact, switches use multiple configuration files—one file for initial
configuration used when powering on, and another configuration file for
active, currently used running configuration as stored in RAM.
Table -5 lists names of these two files, their purpose, and their storage
location.
Storing Switch Configuration
Files
Table -5 Names and Purposes of the Two Main Cisco IOS
Configuration Files
Configuration Purpose Where It Is
Filename Stored
startup-config Stores the initial configuration used anytime NVRAM
the switch reloads Cisco IOS.
running-config Stores the currently used configuration RAM
commands. This file changes dynamically
when someone enters commands in
configuration mode.
Storing Switch Configuration
Files
The example shows the following concepts and steps:
Step 3. The show running-
config and show startup-config
Step 1. The example begins commands show the fact that
with both the running and the hostnames are now
startup-config having the same different, with the hostname
hostname, per the hostname harold command found only in
hannah command. the running-config.
Step 2. The hostname is
changed in configuration mode
using the hostname Harold
command.
Storing Switch Configuration
Files
Example -5 How Configuration Mode Commands Change the Running-Config File, Not the
Startup-Config File
!
line con 0
• spanning-tree mode pvst
password 2027
• ! !
• interface FastEthernet0/1 line vty 0 4
• speed 100
• ! login
• interface FastEthernet0/2 line vty 5 15
• !
login
• interface FastEthernet0/3
!
!
Copying and Erasing
Configuration Files
To do that,
you can erase •write erase
startup-
config file •erase startup-config
using three •erase nvram:
different
commands:
Copying and Erasing
Configuration Files
Once the startup-config file is erased, you can reload or power off/on the
switch, and it will boot with the now-empty startup configuration.
Note that Cisco IOS does not have a command that erases the contents
of the runningconfig file.
To clear out the running-config file, simply erase the startup-config file,
and then reload the switch, and the running-config will be empty at the
end of the process.
Copying and Erasing
Configuration Files
NOTE Cisco uses the term reload to refer to what
most PC operating systems call rebooting or
restarting. In each case, it is a re-initialization of
the software. The reload EXEC command causes a
switch to reload.
Key Terms You Should Know
Command-line interface (CLI), Telnet, Secure
Shell (SSH), enable mode, user mode,
configuration mode, startup-config file, running-
config file
Table -8 Chapter 4 Configuration Commands
Command Mode and Purpose
line console 0 Global command that changes the context to console
configuration mode.
login Line (console and vty) configuration mode. Tells IOS to prompt
for a password (no username).
password pass-value Line (console and virtual teletype( vty)) configuration mode. Sets the
password
required on that line for login if the login command (with no
other parameters) is also configured.
interface type port- Global command that changes the context to interface mode—
number for example, interface FastEthernet 0/1.
hostname name Global command that sets this switch’s hostname, which is also
used as the first part of the switch’s command prompt
exit Moves back to the next higher mode in configuration mode.
end Exits configuration mode and goes back to enable mode from
any of the configuration submodes.
Ctrl+Z This is not a command, but rather a two-key combination
(pressing the Ctrl key and the letter Z) that together do the
same thing as the end command.
Table -9 Chapter 4 EXEC Command Reference
Note
Using Telnet in a lab today makes sense, but Telnet poses a significant security risk in production networks.
Telnet sends all data (including any username and password for login to the switch) as clear-text data. SSH
gives us a much better option.
Table -9 Chapter 4 EXEC Command Reference
Command Purpose
no debug all undebug all Enable mode EXEC command to disable all currently enabled debugs.
reload Enable mode EXEC command that reboots the switch or router.
copy running-config startup- Enable mode EXEC command that saves the active config, replacing the startup-
config config file used when the switch initializes.
copy startup-config running- Enable mode EXEC command that merges the startup-config file with
config the currently active config file in RAM.
show running-config Lists the contents of the running-config file.
write erase erase startup-config These enable mode EXEC commands erase the startup-config file.
erase nvram:
quit EXEC command that disconnects the user from the CLI session.
show startup-config Lists the contents of the startup-config (initial config) file.
enable Moves the user from user mode to enable (privileged) mode and
prompts for a password if one is configured
disable Moves the user from enable mode to user mode.
configure terminal Enable mode command that moves the user into configuration mode.