10-1 Securing Layer2 STUDENT
10-1 Securing Layer2 STUDENT
10-1 Securing Layer2 STUDENT
1 SWITCH
Objectives
Prepare the Network.
Implement Layer 2 network security features.
Prevent DHCP spoofing attacks.
Prevent unauthorized access to the network using AAA.
Background
A fellow network engineer that you have known and trusted for many years has invited you to lunch this week.
At lunch, he brings up the subject of network security and how two of his former co-workers had been
arrested for using different Layer 2 attack techniques to gather data from other users in the office for their own
personal gain in their careers and finances. The story shocks you because you have always known your
friend to be very cautious with security on his network. His story makes you realize that your business
network has been cautious with external threats, Layer 3–7 security, firewalls at the borders, and so on, but
insufficient at Layer 2 security and protection inside the local network.
When you get back to the office, you meet with your boss to discuss your concerns. After reviewing the
company’s security policies, you begin to work on a Layer 2 security policy.
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 1 of 20
CCNPv7.1 SWITCH: Lab 10-1, Securing Layer 2 Switches
First, you establish which network threats you are concerned about and then put together an action plan to
mitigate these threats. While researching these threats, you learn about other potential threats to Layer 2
switches that might not be malicious but could threaten network stability. You decide to include these threats
in the policies as well.
Other security measures need to be put in place to further secure the network, but you begin with configuring
the switches against a few specific types of attacks, including MAC flood attacks, DHCP spoofing attacks, and
unauthorized access to the local network. You plan to test the configurations in a lab environment before
placing them into production.
Note: This lab uses Cisco Catalyst 3560 and 2960 switches running Cisco IOS 15.0(2) IP Services and LAN
Base images, respectively. The 3560 and 2960 switches are configured with the SDM templates “dual-ipv4-
and-ipv6 routing” and “lanbase-routing”, respectively. Depending on the switch model and Cisco IOS Software
version, the commands available and output produced might vary from what is shown in this lab. Catalyst
3650 switches (running any Cisco IOS XE release) and Catalyst 2960-Plus switches (running any supported
Cisco IOS image) can be used in place of the Catalyst 3560 switches and the Catalyst 2960 switches.
Note: This lab uses the Cisco WS-C2960-24TT-L switch with the Cisco IOS image c2960-lanbasek9-mz.150-
2.SE6.bin and the Catalyst 3560V2-24PS switch with the Cisco IOS image c3560-ipservicesk9-mz.150-
2.SE6.bin. Other switches and Cisco IOS Software versions can be used if they have comparable capabilities
and features. Depending on the switch model and Cisco IOS Software version, the commands available and
output produced might vary from what is shown in this lab.
Required Resources
2 switches (Cisco 2960 with the Cisco IOS Release 15.0(2)SE6 C2960-LANBASEK9-M image or
comparable).
1 switches (Cisco 3560 with the Cisco IOS Release 15.0(2)SE6 C3560-IPSERVICESK9-M image or
comparable).
3 PC’s with Windows OS. One of the PCs should be equipped Wireshark, WinRadius, and Tftpd32
software.
Ethernet and console cables
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 2 of 20
CCNPv7.1 SWITCH: Lab 10-1, Securing Layer 2 Switches
f. Configure 802.1q trunking between the switches according to the diagram (Note that there are no
EtherChannels in this topology). Create and then use VLAN 666 as the native VLAN for all trunks. Also
turn off switchport negotiation on all trunks.
Configure all four switches. An example of DLS1 and ALS1 configuration follows:
DLS1# clock set 14:55:00 3 August 2015
DLS1# config t
DLS1(config)# clock timezone CST -6
DLS1(config)# clock summer-time CDT recurring
DLS1(config)# ntp master 10
DLS1(config)# enable secret class
DLS1(config)# enable secret class
DLS1(config)# line vty 0 15
DLS1(config-line)# password cisco
DLS1(config-line)# login
DLS1(config-line)# exit
DLS1(config)# interface vlan 99
DLS1(config-if)# ip address 172.16.99.3 255.255.255.0
DLS1(config-if)# no shutdown
DLS1(config-if)# exit
DLS1(config)# vlan 666
DLS1(config-vlan)# name NATIVE_DO_NOT_USE
DLS1(config-vlan)# exit
DLS1(config)# interface range fastethernet 0/7 - 12
DLS1(config-if-range)# switchport trunk encapsulation dot1q
DLS1(config-if-range)# switchport mode trunk
DLS1(config-if-range)# switchport trunk native vlan 666
DLS1(config-if-range)# switchport nonegotiate
DLS1(config-if-range)# no shut
DLS1(config-if-range)# exit
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 3 of 20
CCNPv7.1 SWITCH: Lab 10-1, Securing Layer 2 Switches
g. Verify trunking and spanning-tree operations using the show interfaces trunk and show spanning-tree
commands. Which switch is the root bridge?
____________________________________________________________________________________
____________________________________________________________________________________
h. For ALS1 and ALS2, which trunks have a role of designated (Desg), Alternate (Altn), and Root?
____________________________________________________________________________________
____________________________________________________________________________________
DLS1(config)# vlan 99
DLS1(config-vlan)# name Management
DLS1(config-vlan)# vlan 100
DLS1(config-vlan)# name STAFF
DLS1(config-vlan)# vlan 200
DLS1(config-vlan)# name STUDENTS
DLS1(config-vlan)# exit
DLS1(config)#
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 4 of 20
CCNPv7.1 SWITCH: Lab 10-1, Securing Layer 2 Switches
Verify the configuration using the show vlan brief, show vtp status, show standby brief, and show ip
route command on DLS1. Output from DLS1 is shown here.
DLS1# show vlan brief
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 5 of 20
CCNPv7.1 SWITCH: Lab 10-1, Securing Layer 2 Switches
Feature VLAN:
--------------
VTP Operating Mode : Server
Maximum VLANs supported locally : 1005
Number of existing VLANs : 9
Configuration Revision : 3
MD5 digest : 0xE2 0x62 0xBC 0xCE 0x16 0xF3 0xBC 0x0C
0x6D 0x84 0x63 0xF2 0x38 0x55 0xB9 0xB7
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 6 of 20
CCNPv7.1 SWITCH: Lab 10-1, Securing Layer 2 Switches
DHCP spoofing
To accurately configure these levels, you must know the amount of these traffic types flowing in your network
during peak hours.
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 7 of 20
CCNPv7.1 SWITCH: Lab 10-1, Securing Layer 2 Switches
When a traffic storm is detected and storm control is configured, the default response is to silently filter the
traffic. Storm control can optionally be configured to either shutdown the interface receiving the traffic storm or
to send an SNMP trap to the NMS.
a. Enable broadcast storm control on ports 0/6 and 0/15 - 0/24 on ALS1 with the parameters listed below. If
any storm is detected, an SNMP trap will be sent.
1) Unicast storms will be noted at 65% bandwidth usage, and abated at 35% bandwidth
2) Broadcast storms will be noted at 1000 pps and abated at 300pps
3) Multicast storms will be noted at 40% bandwidth usage and abated at 25% bandwidth
ALS1(config)# interface range FastEthernet 0/6, f0/15-24
ALS1(config-if-range)# storm-control unicast level 65 35
ALS1(config-if-range)# storm-control broadcast level pps 1k 300
ALS1(config-if-range)# storm-control multicast level 40 25
ALS1(config-if-range)# storm-control action trap
b. Verify the configuration with the show storm-control command. The output below is showing the
information for just f0/6; leaving the interface designation off would show configuration information for all
storm-control configured interfaces.
ALS1# show storm-control f0/6 unicast
Interface Filter State Upper Lower Current
--------- ------------- ----------- ----------- ----------
Fa0/6 Forwarding 65.00% 35.00% 0.00%
ALS1# show storm-control f0/6 broadcast
Interface Filter State Upper Lower Current
--------- ------------- ----------- ----------- ----------
Fa0/6 Forwarding 1k pps 300 pps 0 pps
ALS1# show storm-control f0/6 multicast
Interface Filter State Upper Lower Current
--------- ------------- ----------- ----------- ----------
Fa0/6 Forwarding 40.00% 25.00% 0.00%
ALS1#
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 8 of 20
CCNPv7.1 SWITCH: Lab 10-1, Securing Layer 2 Switches
e. Verify the configuration for ALS2 using the show port-security interface command.
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 9 of 20
CCNPv7.1 SWITCH: Lab 10-1, Securing Layer 2 Switches
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 10 of 20
CCNPv7.1 SWITCH: Lab 10-1, Securing Layer 2 Switches
Configure the switch to automatically recover an error disabled port caused from a port security violation.
Notice there are many different options for which you can configure error disable recovery. However, we will
configure it only for port-security violation.
Configure the recovery interval for 30 seconds. If no recovery interval is specified, the recovery time defaults
to 300 seconds.
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 11 of 20
CCNPv7.1 SWITCH: Lab 10-1, Securing Layer 2 Switches
arp-inspection Disabled
bpduguard Disabled
channel-misconfig (STP) Disabled
dhcp-rate-limit Disabled
dtp-flap Disabled
gbic-invalid Disabled
inline-power Disabled
link-flap Disabled
mac-limit Disabled
loopback Disabled
pagp-flap Disabled
port-mode-failure Disabled
pppoe-ia-rate-limit Disabled
psecure-violation Enabled
security-violation Disabled
sfp-config-mismatch Disabled
small-frame Disabled
storm-control Disabled
udld Disabled
vmps Disabled
psp Disabled
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 12 of 20
CCNPv7.1 SWITCH: Lab 10-1, Securing Layer 2 Switches
a. On DLS1, issue the ip helper-address 172.16.99.50 command under interface VLAN 200.
b. Reassign interface f0/6 on ALS1 to VLAN 200.
c. On Host A, run Wireshark and have it collect on its ethernet interface. In the filter bar, type bootp and
press enter (this filters the output to show only packets related to DHCP).
d. On Host B, reconfigure the network interface to use DHCP. You should see that Host B receives an IP
address and other DHCP information.
Ethernet adapter Local Area Connection:
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 13 of 20
CCNPv7.1 SWITCH: Lab 10-1, Securing Layer 2 Switches
If Host A were an attacker, it could craft DHCP server OFFER messages or other DHCP sever messages to
respond to Host B’ s DHCP request.
To help protect the network from such an attack, you can use DHCP snooping.
b. Configure ALS1 and ALS2 to trust DHCP information on the trunk ports only, and limit the rate that
requests are received on the access ports. Configuring DHCP snooping on the access layer switches
involves the following steps:
Turn snooping on globally using the ip dhcp snooping command.
Configure the trusted interfaces with the ip dhcp snooping trust command. By default, all ports
are considered untrusted unless statically configured to be trusted. * Very Important * : The topology
used for this lab is not using EtherChannels. Remember that when an EtherChannel created, the
virtual port channel interface is used by the switch to pass traffic; the physical interfaces (and
importantly their configuration) is not referenced by the switch. Therefore, if this topology was using
EtherChannels, the ip dhcp snooping trust command would need to be applied to the Port
Channel interfaces and not to the physical interfaces that make up the bundle.
Configure a DHCP request rate limit on the user access ports to limit the number of DHCP requests
that are allowed per second. This is configured using the ip dhcp snooping limit rate
rate_in_pps. This command prevents DHCP starvation attacks by limiting the rate of the DHCP
requests on untrusted ports.
Configure the VLANs that will use DHCP snooping. In this scenario, DHCP snooping will be used on
both the student and staff VLANs.
Configure this on ALS1 and ALS2. An example from ALS1 is below:
ALS1(config)# ip dhcp snooping
ALS1(config)# interface range fastethernet 0/7 - 12
ALS1(config-if-range)# ip dhcp snooping trust
ALS1(config-if-range)# exit
ALS1(config)# interface range fastethernet 0/6, f0/15 - 24
ALS1(config-if-range)# ip dhcp snooping limit rate 20
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 14 of 20
CCNPv7.1 SWITCH: Lab 10-1, Securing Layer 2 Switches
ALS1(config-if-range)# exit
ALS1(config)# ip dhcp snooping vlan 100,200
c. Verify the configurations on ALS1 and ALS2 using the show ip dhcp snooping command.
ALS2# show ip dhcp snooping
Switch DHCP snooping is enabled
DHCP snooping is configured on following VLANs:
100,200
DHCP snooping is operational on following VLANs:
100,200
DHCP snooping is configured on the following L3 Interfaces:
Will DHCP replies be allowed to ingress access ports assigned to VLAN 200?
_______________________________________________________________________________________
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 15 of 20
CCNPv7.1 SWITCH: Lab 10-1, Securing Layer 2 Switches
_______________________________________________________________________________________
How many DHCP packets will be allowed on Fast Ethernet 0/16 per second?
_______________________________________________________________________________________
_______________________________________________________________________________________
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 16 of 20
CCNPv7.1 SWITCH: Lab 10-1, Securing Layer 2 Switches
A WinRadius (or comparable) server should be installed on your host platform for this lab. If it is not, you can
use the following procedure to download and install it. Check with your instructor if you have questions
regarding the RADIUS server installation.
Please go to “Settings/Database and create the ODBC for your RADIUS database.
Launch ODBC failed.
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 17 of 20
CCNPv7.1 SWITCH: Lab 10-1, Securing Layer 2 Switches
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 18 of 20
CCNPv7.1 SWITCH: Lab 10-1, Securing Layer 2 Switches
d. When WinRadius starts again, you should see messages similar to the following:
Note: WinRadius listens for authentication on port 1812 and accounting on port 1813.
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 19 of 20
CCNPv7.1 SWITCH: Lab 10-1, Securing Layer 2 Switches
Step 9: Test the new user added using the WinRadius test utility.
a. a. A WinRadius testing utility is included in the downloaded zip file. Navigate to the folder where you
unzipped the WinRadius.zip file and locate the file named RadiusTest.exe.
b. b. Start the RadiusTest application, and enter the IP address of the RADIUS server. For this lab, the
RADIUS server is SRV1, and the IP address is 172.16.99.50.
c. c. Enter username remote and password cisco123. Do not change the default RADIUS port number of
1813 nor the RADIUS password of WinRadius.
d. Note: Be sure to use the IP address of PC-C in this lab (172.16.99.50) when testing.
e. d. Click Send and you should see a Send Access_Request message indicating that the server at
172.16.99.50, port number 1813, received 44 hexadecimal characters. On the WinRadius log display, you
should also see a message indicating that user remote was authenticated successfully.
© 2015 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public. Page 20 of 20