Basic Switch Configuration
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 15
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration : 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?
______________________________________________________________________
Examine the characteristics of the virtual interface VLAN1:
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 2 of 15
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Basic Switch Configuration
Switch#show vlan
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 3 of 15
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration 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
Let’s make one configuration change to the switch and then save it. Type the following commands:
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
!
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 4 of 15
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Basic Switch Configuration
<output omitted>
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 15
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Basic Switch Configuration
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(config)#interface range fa0/1 - 24
S1(config-if-range)#switchport access vlan 99
S1(config-if-range)#exit
S1(config)#
%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 15
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Basic Switch Configuration
Step 9: Configure the port speed and duplex settings for a FastEthernet interface.
Configure the duplex and speed settings on FastEthernet 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 FastEthernet interface.
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 7 of 15
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Basic Switch Configuration
S1#show startup-config
Are all the changes that were entered recorded in the file? ______________
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
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 8 of 15
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Basic Switch Configuration
Does the dynamic MAC address match the PC1 MAC address? _____________________
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
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 15
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Basic Switch Configuration
Set up a static MAC address on FastEthernet interface 0/18 using the address that was recorded for PC1
in Step 1 of this task. The MAC address 00e0.2917.1884 is used as an example only. You must use the
MAC address of your PC1, which is different than the one given here as an example.
S1#show mac-address-table
S1#show mac-address-table
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 10 of 15
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Basic Switch Configuration
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 11 of 15
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration 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 12 of 15
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Basic Switch Configuration
Note: Some IOS version may require a manual shutdown command before entering the no shutdown
command.
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 13 of 15
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Basic Switch Configuration
Appendix 1
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 14 of 15
CCNA Exploration
LAN Switching and Wireless: Basic Switch Concepts and Configuration Basic Switch Configuration
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 15 of 15