Lab 5 - Basic Switch Configuration
Lab 5 - Basic Switch Configuration
Topology
Addressing Table
Learning Objectives
Upon completion of this lab, you will be able to:
• Cable a network according to the topology diagram
• Clear an existing configuration on a switch
• Examine and verify the default configuration
• Create a basic switch configuration, including a name and an IP address
• Configure passwords to ensure that access to the CLI is secured
• Configure switch port speed and duplex properties for an interface
• Configure basic switch port security
• Manage the MAC address table
• Assign static MAC addresses
• Add and move hosts on a switch
Scenario
In this lab, you will examine and configure a standalone LAN switch. Although a switch performs basic
functions in its default out-of-the-box condition, there are a number of parameters that a network
administrator should modify to ensure a secure and optimized LAN. This lab introduces you to the basics
of switch configuration.
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 1 of 13
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Lab 2.5.1: Basic Switch Configuration
Notice that the prompt changed in the configuration to reflect privileged EXEC mode.
Switch#show startup-config
startup-config is not present
Why does the switch give this response?
______________________________________________________________________
Because we deleted the NVRAM
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 2 of 13
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Lab 2.5.1: Basic Switch Configuration
No
Is there an IP address set on the switch? __________________________________
No
What is the MAC address of this virtual switch interface? ______________________
No, it is down
Is this interface up? ___________________________________________________
Now view the IP properties of the interface:
up
Is the interface up or down? ______________________________________
connecting host
What event would make an interface go up? _________________________
What is the MAC address of the interface? __________________________
000b.be8b.bb12
What is the speed and duplex setting of the interface? _________________
full duplex, 100mbs
Step 5: Examine VLAN information.
Examine the default VLAN settings of the switch.
Switch#show vlan
default
What is the name of VLAN 1? ________________________________
Which ports are in this VLAN? __________________________
26
active
Is VLAN 1 active? _________________________________________________
enet
What type of VLAN is the default VLAN? ______________________________
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 3 of 13
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Lab 2.5.1: Basic Switch Configuration
Files have a file extension, such as .bin, at the end of the filename. Directories do not have a file
extension. To examine the files in a directory, issue the following command using the filename displayed
in the output of the previous command:
Switch#dir flash:c2960-lanbase-mz.122-25.SEE3
C2960-LANBASEK9-M
What is the name of the Cisco IOS image file? ______________________________________________
Switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname S1
S1(config)#exit
S1#
To save the contents of the running configuration file to non-volatile RAM (NVRAM), issue the the
command copy running-config startup-config.
Note: This command is easier to enter by using the copy run start abbreviation.
Now display the contents of NVRAM using the show startup-config command.
S1#show startup-config
Using 1170 out of 65536 bytes
!
version 12.2
no service pad
service timestamps debug uptime
service timestamps log uptime
no service password-encryption
!
hostname S1
!
<output omitted>
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 4 of 13
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Lab 2.5.1: Basic Switch Configuration
S1#configure terminal
Enter the configuration commands, one for each line. When you are finished,
return to global configuration mode by entering the exit command or pressing
Ctrl-Z.
S1(config)#line console 0
S1(config-line)#password cisco
S1(config-line)#login
S1(config-line)#line vty 0 15
S1(config-line)#password cisco
S1(config-line)#login
S1(config-line)#exit
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 5 of 13
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Lab 2.5.1: Basic Switch Configuration
S1(config-if)#exit
S1(config)#
Notice that the VLAN 99 interface is in the down state even though you entered the command no
shutdown. The interface is currently down because no switchports are assigned to VLAN 99.
Assign all user ports to VLAN 99.
S1#configure terminal
S1(config)#interface range fa0/1 - 24
S1(config-if-range)#switchport access vlan 99
S1(config-if-range)#exit
S1(config-if-range)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan99, changed state to up
It is beyond the scope of this lab to fully explore VLANs. This subject is discussed in greater detail in the
next chapter. However, to establish connectivity between the host and the switch, the ports used by the
host must be in the same VLAN as the switch. Notice in the above output that VLAN 1 interface goes
down because none of the ports are assigned to VLAN 1. After a few seconds, VLAN 99 will come up
because at least one port is now assigned to VLAN 99.
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 6 of 13
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Lab 2.5.1: Basic Switch Configuration
Step 9: Configure the port speed and duplex settings for a Fast Ethernet interface.
Configure the duplex and speed settings on Fast Ethernet 0/18. Use the end command to return to
privileged EXEC mode when finished.
S1#configure terminal
S1(config)#interface fastethernet 0/18
S1(config-if)#speed 100
S1(config-if)#duplex full
S1(config-if)#end
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/18, changed
state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan99, changed state to down
%LINK-3-UPDOWN: Interface FastEthernet0/18, changed state to down
%LINK-3-UPDOWN: Interface FastEthernet0/18, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/18, changed
state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan99, changed state to up
The line protocol for both interface FastEthernet 0/18 and interface VLAN 99 will temporarily go down.
The default on the Ethernet interface of the switch is auto-sensing, so it automatically negotiates optimal
settings. You should set duplex and speed manually only if a port must operate at a certain speed and
duplex mode. Manually configuring ports can lead to duplex mismatches, which can significantly degrade
performance.
Verify the new duplex and speed settings on the Fast Ethernet interface.
S1#show startup-config
Are all the changes that were entered recorded in the file? ______________
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 7 of 13
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Lab 2.5.1: Basic Switch Configuration
PC2: ___________________________________________________________________
Step 2: Determine the MAC addresses that the switch has learned.
Display the MAC addresses using the show mac-address-table command in privileged EXEC mode.
S1#show mac-address-table
How many dynamic addresses are there? _______________________________
How many MAC addresses are there in total? ____________________________
Do the dynamic MAC addresses match the host MAC addresses? _____________________
S1#show mac-address-table ?
How many options are available for the show mac-address-table command? ________
Show only the MAC addresses from the table that were learned dynamically.
S1#show mac-address-table
How many static MAC addresses are there? ___________________________________ How many
dynamic addresses are there? _____________________________________
S1#show mac-address-table
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 8 of 13
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Lab 2.5.1: Basic Switch Configuration
S1#show mac-address-table
How many total MAC addresses are there? ______________________________________ How many
static addresses are there? __________________________________________
S1#show mac-address-table
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 9 of 13
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Lab 2.5.1: Basic Switch Configuration
PC1____________________________________________________________________
PC2____________________________________________________________________
Step 4: Determine which MAC addresses that the switch has learned.
Display the learned MAC addresses using the show mac-address-table command in privileged EXEC
mode.
S1#show mac-address-table
S1(config-if)#switchport port-security
S1#show port-security
S1#show running-config
Are there statements listed that directly reflect the security implementation of the running configuration?
____________________________________________________
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 10 of 13
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Lab 2.5.1: Basic Switch Configuration
S1#show port-security
Have the port security settings changed to reflect the modifications in Step 9? ___________
Ping the VLAN 99 address of the switch from PC1 to verify connectivity and to refresh the MAC address
table. You should now see the MAC address for PC1 “stuck” to the running configuration.
S1#show run
Building configuration...
<output omitted>
!
interface FastEthernet0/18
switchport access vlan 99
switchport mode access
switchport port-security
switchport port-security mac-address sticky
switchport port-security mac-address sticky 00e0.2917.1884
speed 100
duplex full
!
<output omitted>
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 11 of 13
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Lab 2.5.1: Basic Switch Configuration
host disables the port. Reconnect PC1 to Fast Ethernet 0/18, and enter the following commands on the
switch:
Note: Some IOS version may require a manual shutdown command before entering the no shutdown
command.
Appendix 1
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 12 of 13
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Lab 2.5.1: Basic Switch Configuration
If previous VLAN configuration information is still present (other than the default management VLAN 1),
you must power-cycle the switch (hardware restart ) instead of issuing the reload command. To power-
cycle the switch, remove the power cord from the back of the switch or unplug it, and then plug it back in.
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 13 of 13