Basic Management Commands for The Switch

Posted on July 23, 2009. Filed under: CCNA, ICND1 break down | Tags: , , , , |

In this section, we will talk about the basic management commands for the switch. After learning this material, you will be able to:

  • Change the switch’s name.
  • Assign an IP address, subnet mask and default gateway for the switch, so that remote login is possible.
  • View the MAC address table of the switch.

One of the basic switch management is to name it. The name of the switch is displayed as the host name at the system prompt. To Change it, we use command “hostnmae newname” under global configuration mode.

Switch#config terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname SW1

Command “config terminal” changes the switch from privileged mode to global configuration mode. Note that the prompt sign changes from “#” to “(config)#”.

Although switch is a Layer 2 device, it uses Layer 3 address for the purpose of management. This is because remote access applications such as Telnet and SSH access to the switch’s management interface using the Layer 3 protocol. By default, all the switch ports belong to VLAN 1 and VLAN 1 is the default management interface. We can assign an ip address to this virtual interface VLAN 1, so that all the ports on the switch share only one IP address and act as a single virtual Layer 3 host.

To assign an IP address and subnet mask to a switch, we must firstly be in vlan 1 interface configuration mode. The command “interface vlan 1” brings the switch from global configuration mode to interface configuration mode. The prompt sign also changes from “(config)#” to “(config-if)#” accordingly. We then issue command “ip address” to set the ip address, and issue command “ip default-gateway” to set the default gateway. Don’t forget the command “no shutdown“, since vlan 1 is also an interface.

Switch#config terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#interface vlan 1
Switch(config-if)#ip address
Switch(config-if)#no shutdown

%LINK-5-CHANGED: Interface Vlan1, changed state to up
Switch(config-if)#ip default-gateway

As a network administrator, we need to frequently verify the switch’s status. There are three show commands are are heavily used: show version, show running-config, and show interfaces.

The following is the result of command “show version” issued on a Cisco 2960-24TT switch:

Switch>show version
Cisco IOS Software, C2960 Software (C2960-LANBASE-M), Version 12.2(25)FX, RELEASE SOFTWARE (fc1)
Copyright (c) 1986-2005 by Cisco Systems, Inc.
Compiled Wed 12-Oct-05 22:05 by pt_team

ROM: C2960 Boot Loader (C2960-HBOOT-M) Version 12.2(25r)FX, RELEASE SOFTWARE (fc4)

System returned to ROM by power-on

Cisco WS-C2960-24TT (RC32300) processor (revision C0) with 21039K bytes of memory.
24 FastEthernet/IEEE 802.3 interface(s)
2 Gigabit Ethernet/IEEE 802.3 interface(s)

64K bytes of flash-simulated non-volatile configuration memory.
Base ethernet MAC Address       : 0002.1649.8D50
Motherboard assembly number     : 73-9832-06
Power supply part number        : 341-0097-02
Motherboard serial number       : FOC103248MJ
Power supply serial number      : DCA102133JA
Model revision number           : B0
Motherboard revision number     : C0
Model number                    : WS-C2960-24TT
System serial number            : FOC1033Z1EY
Top Assembly Part Number        : 800-26671-02
Top Assembly Revision Number    : B0
Version ID                      : V02
CLEI Code Number                : COM3K00BRA
Hardware Board Revision Number  : 0x01
Switch   Ports  Model              SW Version              SW Image
——   —–  —–              ———-              ———-
*    1   26     WS-C2960-24TT      12.2                    C2960-LANBASE-M

Configuration register is 0xF

As show above, show version displays many Cisco switch hardware related information such as processor and memory. IOS version are also displayed. Notice the last line “Configuration register is 0xF”. The Cisco Router use configuration register setting to determine how the router boots up. We will go into this topic in the later section.

The following is the result of command “show running-config” issued on a Cisco 2960-24TT switch:

Switch#show running-config
Building configuration…

Current configuration : 973 bytes
version 12.2
no service password-encryption
hostname Switch
interface FastEthernet0/1
interface FastEthernet0/2
interface FastEthernet0/3
interface FastEthernet0/4
interface FastEthernet0/5
interface FastEthernet0/6
interface FastEthernet0/7
interface FastEthernet0/8
interface FastEthernet0/9
interface FastEthernet0/10
interface FastEthernet0/11
interface FastEthernet0/12
interface FastEthernet0/13
interface FastEthernet0/14
interface FastEthernet0/15
interface FastEthernet0/16
interface FastEthernet0/17
interface FastEthernet0/18
interface FastEthernet0/19
interface FastEthernet0/20
interface FastEthernet0/21
interface FastEthernet0/22
interface FastEthernet0/23
interface FastEthernet0/24
interface GigabitEthernet1/1
interface GigabitEthernet1/2
interface Vlan1
 ip address

ip default-gateway
line con 0
line vty 0 4
line vty 5 15

As show above, the command show running-config displays the currently running configuration of the switch, such as host name, ip address, default gateway. It also lists all the interfaces including FastEthernet, GigabitEthernet, vlan, con, vty. Note that this command requires privileged EXEC mode.

The following is the result of command “show interfaces FastEthernet0/1” issued on a Cisco 2960-24TT switch. (If we use command “show interfaces” instead, all the interfaces of the switch will be displayed, which is too long to be pasted here.)

Switch>show interfaces FastEthernet0/1
FastEthernet0/1 is down, line protocol is down (disabled)
  Hardware is Lance, address is 0001.63e3.a601 (bia 0001.63e3.a601)
  MTU 1500 bytes, BW 100000 Kbit, DLY 1000 usec,
     reliability 255/255, txload 1/255, rxload 1/255
  Encapsulation ARPA, loopback not set
  Keepalive set (10 sec)
  Half-duplex, 100Mb/s
  input flow-control is off, output flow-control is off
  ARP type: ARPA, ARP Timeout 04:00:00
  Last input 00:00:08, output 00:00:05, output hang never
  Last clearing of “show interface” counters never
  Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0
  Queueing strategy: fifo
  Output queue :0/40 (size/max)
  5 minute input rate 0 bits/sec, 0 packets/sec
  5 minute output rate 0 bits/sec, 0 packets/sec
     956 packets input, 193351 bytes, 0 no buffer
     Received 956 broadcasts, 0 runts, 0 giants, 0 throttles
     0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort
     0 watchdog, 0 multicast, 0 pause input
     0 input packets with dribble condition detected
     2357 packets output, 263570 bytes, 0 underruns
     0 output errors, 0 collisions, 10 interface resets
     0 babbles, 0 late collision, 0 deferred
     0 lost carrier, 0 no carrier
     0 output buffer failures, 0 output buffers swapped out

As shown above, the command “show ip interfaces FastEthernet0/1” displays some status information and statistics about the interface FastEthernet0/1. For example, “FastEthernet0/1 is down, line protocol is down (disabled)” means the interface is not functional at both Layer 1 and Layer 2; disabled indicates that we need to use command “no shutdown” to brings it up. For another example, “Half-duplex, 100Mb/s” tells us the port is using Half-duplex mode, the speed is 100Mbps.

The traditional shared LAN operates in half-duplex mode, which means only one communicating host can send or receive at any time, otherwise collision will happen. New LAN switch allows full-duplex mode, which means both communicating hosts can send and receive at the same time. It’s like how we communicate during a phone call. To support full-duplex mode, the LAN switch must creat the microsegmentations, though.

Microsegmentation in computer networking is a term used to describe the segmentation of a collision domain into as many segments as there are circuits, minus one (#segments = #circuits – 1). This microsegmentation performed by the switch cuts the collision domain down so that only two nodes coexist within each collision domain. This point-to-point arrangement is collision-free and only the two NICs which are directly connected via two separate UTP cable are contending for the medium. 

To Set Speed, Duplex mode for a network interface, use the following command under interface configuration mode:

  • speed 100 – also 100 | auto
  • duplex full – also half | auto | full-flow-control

The following is copy/paste from a CLI of a Cisco 2960-24TT switch.

Switch#config terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#interface FastEthernet0/1
Switch(config-if)#speed 10
Switch(config-if)#duplex full

After the configuration, we issue command “ip interfaces FastEthernet0/1” again, the duplex and speed should have changed accordingly.

ICND1 and ICND2 break down


Make a Comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

3 Responses to “Basic Management Commands for The Switch”

RSS Feed for IT Certifications Comments RSS Feed

[…] Cisco IOS software overview * Physical Side of Cisco Switches * User, Enable and Privilege Modes * Basic Switch managment commands * Switch/Router passwords configurations * Telnet and SSH * Switch Port Security Defaults, Options […]

[…] xxxxx http// […]

Where's The Comment Form?

Liked it here?
Why not try sites on the blogroll...

%d bloggers like this: