11.6.2 Lab - Switch Security Configuration - ILM
11.6.2 Lab - Switch Security Configuration - ILM
Instructor Note: Red font color or gray highlights indicate text that appears in the instructor copy only.
Topology
Addressing Table
R1
Loopback 0 10.10.1.1 255.255.255.0
S1 VLAN 10 192.168.10.201 255.255.255.0
S2 VLAN 10 192.168.10.202 255.255.255.0
PC – A NIC DHCP 255.255.255.0
PC – B NIC DHCP 255.255.255.0
Objectives
Part 1: Configure the Network Devices.
Cable the network.
Configure R1.
Configure and verify basic switch settings.
Part 2: Configure VLANs on Switches.
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 1 of 19 www.netacad.com
Lab - Switch Security Configuration
Background / Scenario
This is a comprehensive lab to review previously covered Layer 2 security features.
Note: The routers used with CCNA hands-on labs are Cisco 4221 with Cisco IOS XE Release 16.9.3
(universalk9 image). The switches used in the labs are Cisco Catalyst 2960s with Cisco IOS Release 15.0(2)
(lanbasek9 image). Other routers, switches, and Cisco IOS versions can be used. Depending on the model
and Cisco IOS version, the commands available and the output produced might vary from what is shown in
the labs. Refer to the Router Interface Summary Table at the end of the lab for the correct interface identifiers.
Note: Make sure that the switches have been erased and have no startup configurations. If you are unsure,
contact your instructor.
Instructor Note: Refer to the Instructor Lab Manual for the procedures to initialize and reload devices.
Required Resources
1 Router (Cisco 4221 with Cisco IOS XE Release 16.9.3 universal image or comparable)
2 Switches (Cisco 2960 with Cisco IOS Release 15.0(2) lanbasek9 image or comparable)
2 PCs (Windows with a terminal emulation program, such as Tera Term)
Console cables to configure the Cisco IOS devices via the console ports
Ethernet cables as shown in the topology
Instructions
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 2 of 19 www.netacad.com
Lab - Switch Security Configuration
enable
configure terminal
hostname R1
no ip domain lookup
ip dhcp excluded-address 192.168.10.1 192.168.10.9
ip dhcp excluded-address 192.168.10.201 192.168.10.202
!
ip dhcp pool Students
network 192.168.10.0 255.255.255.0
default-router 192.168.10.1
domain-name CCNA2.Lab-11.6.1
!
interface Loopback0
ip address 10.10.1.1 255.255.255.0
!
interface GigabitEthernet0/0/1
description Link to S1 Port 5
ip dhcp relay information trusted
ip address 192.168.10.1 255.255.255.0
no shutdown
!
line con 0
logging synchronous
exec-timeout 0 0
b. Verify the running-configuration on R1 using the following command:
R1# show ip interface brief
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0/0 unassigned YES unset down down
GigabitEthernet0/0/1 192.168.10.1 YES manual up up
Loopback0 10.10.1.1 YES manual up up
Switch# config t
Switch(config)# hostname S2
d. Prevent unwanted DNS lookups on both switches.
S1(config)# no ip domain-lookup
S2(config)# no ip domain-lookup
e. Configure interface descriptions for the ports that are in use in S1 and S2.
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 3 of 19 www.netacad.com
Lab - Switch Security Configuration
S2(config)# vlan 10
S2(config-vlan)# name Management
Step 3: Configure VLAN 333 with the name Native on S1 and S2.
S1(config)# vlan 333
S1(config-vlan)# name Native
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 4 of 19 www.netacad.com
Lab - Switch Security Configuration
Step 4: Configure VLAN 999 with the name ParkingLot on S1 and S2.
S1(config-vlan)# vlan 999
S1(config-vlan)# name ParkingLot
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 5 of 19 www.netacad.com
Lab - Switch Security Configuration
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 6 of 19 www.netacad.com
Lab - Switch Security Configuration
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 7 of 19 www.netacad.com
Lab - Switch Security Configuration
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 8 of 19 www.netacad.com
Lab - Switch Security Configuration
d. Enable port security for F0/18 on S2. Configure the port to add MAC addresses learned on the port
automatically to the running configuration.
S2(config)# interface f0/18
S2(config-if)# switchport port-security
S2(config-if)# switchport port-security mac-address sticky
e. Configure the following port security settings on S2 F/18:
o Maximum number of MAC addresses: 2
o Violation type: Protect
o Aging time: 60 min
S2(config)# interface f0/18
S2(config-if)# switchport port-security aging time 60
S2(config-if)# switchport port-security maximum 2
S2(config-if)# switchport port-security violation protect
f. Verify port security on S2 F0/18.
S2# show port-security interface f0/18
Port Security : Enabled
Port Status : Secure-up
Violation Mode : Protect
Aging Time : 60 mins
Aging Type : Absolute
SecureStatic Address Aging : Disabled
Maximum MAC Addresses : 2
Total MAC Addresses : 1
Configured MAC Addresses : 0
Sticky MAC Addresses : 0
Last Source Address:Vlan : 0022.5646.3413:10
Security Violation Count : 0
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 9 of 19 www.netacad.com
Lab - Switch Security Configuration
e. From the command prompt on PC-B, release and then renew the IP address.
C:\Users\Student> ipconfig /release
C:\Users\Student> ipconfig /renew
f. Verify the DHCP snooping binding using the show ip dhcp snooping binding command.
S2# show ip dhcp snooping binding
MacAddress IpAddress Lease(sec) Type VLAN Interface
------------------ --------------- ---------- ------------- ----
--------------------
00:50:56:90:D0:8E 192.168.10.11 86213 dhcp-snooping 10 FastEthernet0/18
Total number of bindings: 1
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 10 of 19 www.netacad.com
Lab - Switch Security Configuration
Reflection Questions
1. In reference to Port Security on S2, why is there no timer value for the remaining age in minutes when sticky
learning was configured?
Type your answers here.
This switch does not support the port security aging of sticky secure addresses.
2. In reference to Port Security on S2, if you load the running-config script on S2, why will PC-B on port 18 never
get an IP address via DHCP?
Type your answers here.
Port security is set for only two MAC addresses and port 18 has two “sticky” MAC address bound to the port.
Additionally, the violation is protect, which will never send a console/syslog message or increment the
violation counter.
3. In reference to Port Security, what is the difference between the absolute aging type and inactivity aging
type?
Type your answers here.
If the inactivity type is set, then the secure addresses on the port will be removed only if there is no data traffic
from the secure source addresses for the specified time period.
If the absolute type is set, then all secure addresses on this port age out exactly after the time specified ends.
End of Document
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 11 of 19 www.netacad.com
Lab - Switch Security Configuration
Switch S1
S1# show running-config
Building configuration...
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 12 of 19 www.netacad.com
Lab - Switch Security Configuration
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 13 of 19 www.netacad.com
Lab - Switch Security Configuration
!
interface FastEthernet0/13
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/14
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/15
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/16
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/17
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/18
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/19
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/20
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/21
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/22
switchport access vlan 999
switchport mode access
shutdown
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 14 of 19 www.netacad.com
Lab - Switch Security Configuration
!
interface FastEthernet0/23
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/24
switchport access vlan 999
switchport mode access
shutdown
!
interface GigabitEthernet0/1
switchport access vlan 999
switchport mode access
shutdown
!
interface GigabitEthernet0/2
switchport access vlan 999
switchport mode access
shutdown
!
interface Vlan1
no ip address
!
interface Vlan10
description Management SVI
ip address 192.168.10.201 255.255.255.0
!
ip default-gateway 192.168.10.1
line con 0
exec-timeout 0 0
logging synchronous
line vty 0 4
login
line vty 5 15
login
!
end
Switch S2
S2# show running-config
Building configuration...
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 15 of 19 www.netacad.com
Lab - Switch Security Configuration
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 16 of 19 www.netacad.com
Lab - Switch Security Configuration
shutdown
!
interface FastEthernet0/7
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/8
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/9
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/10
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/11
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/12
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/13
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/14
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/15
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/16
switchport access vlan 999
switchport mode access
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 17 of 19 www.netacad.com
Lab - Switch Security Configuration
shutdown
!
interface FastEthernet0/17
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/18
description Link to PC-B
switchport access vlan 10
switchport mode access
switchport port-security maximum 2
switchport port-security violation protect
switchport port-security mac-address sticky
switchport port-security aging time 60
switchport port-security
spanning-tree portfast
spanning-tree bpduguard enable
ip dhcp snooping limit rate 5
!
interface FastEthernet0/19
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/20
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/21
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/22
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/23
switchport access vlan 999
switchport mode access
shutdown
!
interface FastEthernet0/24
switchport access vlan 999
switchport mode access
shutdown
!
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 18 of 19 www.netacad.com
Lab - Switch Security Configuration
interface GigabitEthernet0/1
switchport access vlan 999
switchport mode access
shutdown
!
interface GigabitEthernet0/2
switchport access vlan 999
switchport mode access
shutdown
!
interface Vlan1
no ip address
!
interface Vlan10
description Management SVI
ip address 192.168.10.202 255.255.255.0
!
ip default-gateway 192.168.10.1
!
line con 0
exec-timeout 0 0
logging synchronous
line vty 0 4
login
line vty 5 15
login
!
end
2019 - 2019 Cisco and/or its affiliates. All rights reserved. Cisco Public Page 19 of 19 www.netacad.com