You are on page 1of 18

Configuring a Catalyst switch via CLI (Basic)

Overview
CLI Command Line Interface Initial access is through the RJ-45 console port Equipment needed:
Rollover cable Terminal emulation program e.g. HyperTerminal, TeraTerm Serial connector

Know you UTP cables


Straight cable
In Malaysia, TIA/EIA 568B wiring is used Wires on both end must be in the same order Use when connecting:
Switch to router Switch to PC or server Hub to PC or server

Crossover cable
Some wires on both end are crossed Use when connecting:
Switch to Switch Switch to Hub Hub to Hub Router to Router PC to PC PC to Router

Rollover cable
Pinouts are reversed Used to connect to the console port of a cisco switch Need a DB-9 connector at one end to connect to PCs serial port

Setting up Console Connections to Cisco devices


PCs require an RJ-45 to DB-9 adapter COM port settings are 9600 bps, 8 data bits, no parity, 1 stop bit, no flow control This provides out-of-band console access

A Look at Cisco OIS


Stand for Internetwork Operating System, the OS used in most Cisco products Provides a standard way to configure/manage the device Common shared commands include show, debug, clear, copy etc. Users type or paste entries in the console command modes Enter key instructs device to parse and execute the command Two primary EXEC modes user mode and privileged mode Command modes have distinctive prompts

CICSO IOS Software ECEX Mode


2 main modes: First mode: User mode
Limited examination of switch Command prompt: hostname>

2nd mode: Privileged (enabled) mode


Detailed examination of switch Enables configuration and debugging Prerequisite for other configuration modes Command prompt: hostname#

Cisco switch startup


When a Catalyst switch starts up, several operations are performed:
An initial set of hardware checking routines called power-on self test (POST) is performed The Cisco IOS software image is found and loaded The device configurations is found and loaded

There is typically a sequence of fallback routines should anything failed Can observe the startup routines by connecting to the console port

Logging in to the switch and entering privileged mode


Switch> Switch> enable Password: Switch#
User-Mode Prompt

Privileged-Mode Prompt

When configuring a switch from scratch, the enable password is blank Must log into privileged mode before any configuration can be made

Switch Command-Line Help Facilities


IOS CLI offers context-sensitive help:
Enter ? To get word help for a list of commands that begin with a particular character sequence. E.g. typing sh? Would return show Enter ? To get command syntax help to see how to complete a command. E.g. typing enable ? Would return <0-15> Enable level <cr>

Using Enhanced Editing Commands


Certain key combinations allows for the manipulation fo the cursor position and command recall:
CTRL-P or UP arrow: Last(previous) command recall CTRL-N or DOWN arrow: More recent command recall CRTL-A: Move to beginning of the line CTRL-E: Move to end of the line CTRL-D: Delete a single character CTRL-U: Delete a single line TAB : (important) Completes a partially entered command if enough characters have been entered to make it unambiguous

Command short forms are accepted e.g. entering en is the same as typing enable

Cmmand to get Basic Switch Configuration


Show version to display:
System hardware Software version Device uptime Last reboot reason Base MAC address

Basic show commands (cont.) show run


Show run displays the current running device configuration Also shows the passwords, system name, the interface settings and many more Note that another command show configuration displays the saved device configuration

Basic show commands (cont.) show interfaces


Show interfaces displays statistics for the network interfaces Things to observe include:
Input/output rate Error statistics Queueing strategy

Configuring the Switch


Configuration Modes:
Global configuration mode
Switch#conf term Switch(config)#

Interface configuration mode


Switch(config)# interface fa0/1 Switch(config-if)#

To exit any configuration mode, type exit Press CTRL-Z to immediately exit configuration mode

Basic Configuration commands


Configuring switch name:
(config)# hostname sw_A Sw_A(config)#

Configuring switchs IP address


(config)# interface vlan x (config-if)# ip address {ip address} {mask} x is the vlan number usually 1 Example:
(config-if)# ip address 192.168.1.1 255.255.255.0

Basic Configuration commands (cont.)


Enter line configuration modew for virtual terminal:
(config)# line vty 0 15 (config-line)#

Enable password checking for vty:


(config-line)# login

Configuring vty password:


(config-line)# password {password}

Managing switch configuration files


There are generally 2 configuration files on the switch:
Startup-config, which is stored in the FLASH memory and retained after reload Running-config, which is stored in the NVRAM and is the configuration being used in the switch. It is NOT retained after a switch reload It is important therefore to save the running configuration to the startup configuration file when configuration changes are made, or else it will be lost after a switch reload IMPORTANT: Configuration changes are made in the config mode, but saving configuration changes are done in the privileged exec mode.

telnet, ping and traceroute


Can connect via telnet from one switch to another using the telnet command from EXEC mode Can test the ICMP connectivity using the ping command Cab check the hops connectivity the switch to another device using the traceroute command

You might also like