2 - 1 - Basic Switch LAB
2 - 1 - Basic Switch LAB
2 - 1 - Basic Switch LAB
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?
_ _
All contents are Copyright © 1992–2007 Cisco Systems, Inc. All rights reserved. This document is Cisco Public Information. Page 2 of 13
Is there an IP address set on the switch? None
What is the MAC address of this virtual switch interface?
0001.c781.119c
Is this interface up? No
Now view the IP properties of the interface:
What output do you see? Vlan1 is administratively down, line protocol is down
Internet protocol processing disabled
Switch#show vlan
Switch#dir flash:c2960-lanbase-mz.122-25.SEE3
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>
The current configuration has been written to NVRAM.
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
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.
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?
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
S1#show mac-address-table
S1#show mac-address-table
How many total MAC addresses are there? ________________________________________ How many
static addresses are there?
S1#show mac-address-table
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 11 of 13
Step 9: Modify the port security settings on a port.
On interface Fast Ethernet 0/18, change the port security maximum MAC address count to 1 and to shut down if a
violation occurs.
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>
Note: Some IOS version may require a manual shutdown command before entering the no shutdown
command.
Appendix 1