Activity 2.5.1: Basic Switch Configuration: Addressing Table
Activity 2.5.1: Basic Switch Configuration: Addressing Table
1:
Basic Switch Configuration
Addressing Table
Default
Device Interface IP Address Subnet Mask
Gateway
Learning Objectives
Introduction
In this activity, 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 activity introduces you to the
basics of switch configuration.
Step 1
Switch>enable
Switch#
Step 2
Switch#delete flash:vlan.dat
Step 3
Switch#erase startup-config
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OK]
Switch#
Switch#show vlan
Gig1/1, Gig1/2
10 VLAN10 active
30 VLAN30 active
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
------------------------------------------------------------------------------
[OK]
Step 4
Switch#reload
Cisco WS-C2960-24TT (RC32300) processor (revision C0) with 21039K bytes of memory.
2960-24TT starting...
Initializing Flash...
Loading "flash:/c2960-lanbase-mz.122-25.FX.bin"...
########################################################################## [OK]
Cisco WS-C2960-24TT (RC32300) processor (revision C0) with 21039K bytes of memory.
Version ID : V02
CLEI Code Number : COM3K00BRA
Cisco IOS Software, C2960 Software (C2960-LANBASE-M), Version 12.2(25)FX, RELEASE SOFTWARE
(fc1)
Task 2
Step1
Switch>enable
Switch#
Step2
Switch#show running-config
Building configuration...
Current configuration : 1009 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
no ip address
shutdown
line con 0
line vty 0 4
login
line vty 5 15
login
End
24
ii. How many Gigabit Ethernet interfaces does the switch have?
2
iii. What is the range of values shown for the vty lines?
0-15
Examine the characteristics of the virtual interface VLAN1 by issuing the show interface vlan1 command.
NO
Now view the IP properties of the interface using the show ip interface vlan1 command.
Switch#show version
Cisco IOS Software, C2960 Software (C2960-LANBASE-M), Version 12.2(25)FX, RELEASE SOFTWARE
(fc1)
ROM: C2960 Boot Loader (C2960-HBOOT-M) Version 12.2(25r)FX, RELEASE SOFTWARE (fc4)
Cisco WS-C2960-24TT (RC32300) processor (revision C0) with 21039K bytes of memory.
24 FastEthernet/IEEE 802.3 interface(s)
Version ID : V02
C2960-LANBASE-M
0060.47AC.1EB8
a. Examine the default properties of the Fast Ethernet interface used by PC1 using the show
interface fastethernet 0/18 command.
100 mb/s
a. Examine the default VLAN settings of the switch using the show vlan command.
Switch#show vlan
Gig1/1, Gig1/2
VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
------------------------------------------------------------------------------
default
YES
Switch#show flash
Directory of flash:/
rw- 4414921
ii. Files have a file extension, such as .bin, at the end of the filename. Directories do not
have a file extension. What is the name of the Cisco IOS image file?
c2960-lanbase-mz.122-25.FX.bin
Switch#configure terminal
Switch(config)#hostname kuldeepl
kuldeep(config)#exit
kuldeep#
kuldeep#
To save the contents of the running configuration file to non-volatile RAM (NVRAM), issue the copy
running-config startup-config command.
Building configuration...
[OK]
kuldeep#
Enter global configuration mode. Configuration mode allows you to manage the switch. Enter the
configuration commands, one on each line. Notice that the command line prompt changes to reflect the
current prompt and switch name. In the last step of the previous task, you configured the hostname. Here's
a review of the commands used.
kuldeep#configure terminal
kuldeep(config)#exit
kuldeep#
Enter config-line mode for the console. Set the login password to cisco. Also configure the vty lines 0 to
15 with the password cisco.
kuldeep#configure terminal
kuldeep(config)#line console 0
kuldeep(config-line)#password cisco
kuldeepl(config-line)#login
kuldeep(config-line)#line vty 0 15
kuldeep(config-line)#password cisco
kuldeep(config-line)#login
kuldeep(config-line)#exit
kuldeep(config)#
Set the IP address of the switch to 172.17.99.11 with a subnet mask of 255.255.255.0 on the internal virtual
interface VLAN 99. The VLAN must first be created on the switch before the address can be assigned.
kuldeep(config)#vlan 99
kuldeep(config-vlan)#exit
kuldeep(config)#interface vlan99
kuldeep(config-if)#
kuldeep(config-if)#no shutdown
kuldeepl(config-if)#exit
kuldeep(config)#
kuldeep(config)#interface fa0/1
kuldeep(config-if)#exit
kuldeep(config)#interface fa0/8
kuldeep(config-if)#exit
kuldeep(config)#interface fa0/18
kuldeep(config-if)#exit
kuldeep(config)#
Step 6. Set the switch default gateway.
S1 is a layer 2 switch, so it makes forwarding decisions based on the Layer 2 header. If multiple networks
are connected to a switch, you need to specify how the switch forwards the internetwork frames, because
the path must be determined at Layer three. This is done by specifying a default gateway address that
points to a router or Layer 3 switch. Although this activity does not include an external IP gateway, assume
that you will eventually connect the LAN to a router for external access. Assuming that the LAN interface on
the router is 172.17.99.1, set the default gateway for the switch.
kuldeep(config)#exit
kuldeep#
Verify the interface settings on VLAN 99 with the show interface vlan 99 command.
100000 K/bit
Fifo
Set the IP address of PC1 to 172.17.99.21, with a subnet mask of 255.255.255.0. Configure a default
gateway of 172.17.99.11. Click PC1 and its Desktop tab then IP configuration to input the addressing
parameters.
To verify the host and switch are correctly configured, ping the switch from PC1.
If the ping is not successful, troubleshoot the switch and host configuration. Note that this may take a
couple of tries for the pings to succeed.
Step 10. 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.
kuldeep#configure terminal
kuldeep(config-if)#speed 100
kuldeep(config-if)#duplex full
kuldeep(config-if)#
kuldeep(config-if)#end
Notice how the link between PC1 and S1 went down. Remove the speed 100 and duplex full commands.
Now verify the settings on the Fast Ethernet interface with the show interface fa0/18 command.
kuldeep#configure terminal
kuldeep(config)#interface fa0/18
kuldeep(config-if)#
Full-duplex, 100Mb/s
You have completed the basic configuration of the switch. Now back up the running configuration file to
NVRAM to ensure that the changes made will not be lost if the system is rebooted or loses power.
Building configuration...
[OK]
kuldeep#
To see the configuration that is stored in NVRAM, issue the show startup-config command from
privileged EXEC (enable mode).
Are all the changes that were entered recorded in the file?
YES
Building configuration...
[OK]
kuldeep#show startup-config
version 12.2
no service password-encryption
hostname kuldeep
!
enable secret 5 $1$mERr$9cTjUIEqNGurQiFU.ZeCi1
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
no ip address
shutdown
interface Vlan99
ip default-gateway 172.17.99.1
line con 0
password cisco
login
line vty 0 4
password cisco
login
line vty 5 15
password cisco
login
end
Task 4: Managing the MAC Address Table
Determine and record the Layer 2 (physical) addresses of the PC network interface cards using the
following steps:
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. If
there are no MAC addresses, ping from PC1 to S1 then check again.
To remove the existing MAC addresses, use the clear mac-address-table dynamic command from
privileged EXEC mode.
-------------------------------------------
kuldeep#show mac-address-table
-------------------------------------------
To specify which ports a host can connect to, one option is to create a static mapping of the host MAC
address to a port.
Set up a static MAC address on Fast Ethernet interface 0/18 using the address that was recorded for PC1
in Step 1 of this task, 0002.16E8.C285.
kuldeep#configure terminal
kuldeep(config)#end
kuldeep#show mac-address-table
Mac Address Table
-------------------------------------------
Enter configuration mode and remove the static MAC by putting a no in front of the command string.
kuldeep#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
kuldeep(config)#no mac-address-table static 0002.16E8.c285 vlan 99
interface fastethernet 0/18
kuldeep(config)#end
kuldeep#
%SYS-5-CONFIG_I: Configured from console by console
Verify that the static MAC address has been cleared with the show mac-address-table static command.
A second host is needed for this task. Set the IP address of PC2 to 172.17.99.22, with a subnet mask of
255.255.255.0 and a default gateway of 172.17.99.11. Do not connect this PC to the switch yet.
Verify that PC1 and the switch are still correctly configured by pinging the VLAN 99 IP address of the
switch from the host. If the pings were not successful, troubleshoot the host and switch configurations.
Step 3. 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.
-------------------------------------------
kuldeep#show mac-address-table
-------------------------------------------
Vlan Mac Address Type Ports
Explore the options for setting port security on interface Fast Ethernet 0/18.
kuldeep#configure terminal
kuldeep(config-if)#switchport port-security ?
<cr>
Configure switch port Fast Ethernet 0/18 to accept only two devices, to learn the MAC addresses of those
devices dynamically, and to shutdown the port if a violation occurs.
kuldeep(config-if)#switchport port-security
kuldeep(config-if)#end
Show the port security settings with the show port-security interface fa0/18 command.
kuldeep#show running-config
Building configuration...
version 12.2
no service timestamps log datetime msec
no service password-encryption
hostname kuldeep
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
switchport port-security
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
no ip address
shutdown
interface Vlan99
ip default-gateway 172.17.99.1
line con 0
password cisco
login
line vty 0 4
password cisco
login
line vty 5 15
password cisco
login
end
Are there statements listed that directly reflect the security implementation of the running configuration?
YES
On interface Fast Ethernet 0/18, change the port security maximum MAC address count to 1.
kuldeepl#configure terminal
kuldeep(config)#interface switchport
kuldeep(config-if)#end
Show the port security settings with the show port-security interface fa0/18 command.
Have the port security settings changed to reflect the modifications in Step 8?
Ping the VLAN 99 address of the switch from PC1 to verify connectivity and to refresh the MAC address
table.
Disconnect the PC attached to Fast Ethernet 0/18 from the switch. Connect PC2, which has been given the
IP address 172.17.99.22 to port Fast Ethernet 0/18. Ping the VLAN 99 address 172.17.99.11 from the new
host.
As long as the rogue host is attached to Fast Ethernet 0/18, no traffic can pass between the host and
switch. Reconnect PC1 to Fast Ethernet 0/18, and enter the following commands on the switch to
reactivate the port:
kuldeep#
kuldeep#configure terminal
kuldeep(config-if)#no shutdown
kuldeep(config-if)#end