Chapter 4. Configuring and Implementing Switched Data Plane Security Solutions

This chapter covers the following subjects:

• Switched data plane attack types: This section reviews the different types of attacks that are focused on the data plane of switches.

• Switched data plane security technologies: This section goes over the specific technologies that can be used to mitigate the various attack types and describes how to configure them.

An attacker can attempt to exploit a network in numerous ways. This chapter looks at the ways that target the technologies that are used on switches and are aimed at those used on the data plane. These technologies include Content Addressable Memory (CAM) tables, Address Resolution Protocol (ARP), Spanning Tree, virtual local-area networks (VLAN), and Dynamic Host Configuration Protocol (DHCP). This chapter also covers the configuration of these technologies so that they can be configured in a way that offers the smallest risk of attack.

“Do I Know This Already?” Quiz

The “Do I Know This Already?” quiz helps you decide whether you really need to read the entire chapter. If you already intend to read the entire chapter, you do not necessarily need to answer these questions now.

The ten-question quiz, derived from the major sections in the “Foundation Topics” section of this chapter, helps you determine how to spend your limited study time.

Table 4-1 outlines the major topics discussed in this chapter and the “Do I Know This Already?” quiz questions that correspond to those topics.

Table 4-1. “Do I Know This Already?” Foundation Topics Section-to-Question Mapping

image

Caution

The goal of self-assessment is to gauge your mastery of the topics in this chapter. If you do not know the answer to a question or are only partially sure of the answer, you should mark this question wrong for purposes of the self-assessment. Giving yourself credit for an answer that you correctly guess skews your self-assessment results and might provide you with a false sense of security.

1. What is the default inactivity expire time period on a Cisco Catalyst switch CAM table?

a. 1 minute

b. 5 minutes

c. 10 minutes

d. 50 minutes

2. Which of the following attack types describes when an attacker tries to take over the root bridge functionality on a network?

a. STP spoofing

b. VLAN hopping

c. CAM flooding

d. ARP spoofing

3. Which command enables port security on an interface?

a. switchport mode port-security

b. switchport mode interface-security

c. switchport interface-security

d. switchport port-security

4. What is the default action mode for security violations?

a. Protect

b. Restrict

c. Shutdown

5. The DTP state on a trunk port can be set to what?

a. Auto, on, off, undesirable, or non-negotiate

b. Auto, on, off, desirable, or non-negotiate

c. Auto, on, off, desirable, or negotiate

d. Auto, on, off, undesirable, or negotiate

6. What are the two different types of VLAN hopping attacks?

a. Switch spoofing and double tagging

b. Switch goofing and double teaming

c. Switch impersonation and double grouping

d. Switch imitation and double alliance

7. Which features of Cisco IOS Software enable you to mitigate STP manipulation? (Select two.)

a. spanning-tree bpduguard

b. spanning-tree guard root

c. set spantree global-default loopguard enable

d. set udld enable

8. What are the three types of private VLAN ports?

a. Neighborhood, remote, and loose

b. Community, isolated, and promiscuous

c. Communal, remote, and licentious

d. Area, secluded, and wanton

9. Which of the following databases is used by Dynamic ARP inspection?

a. DAI group table

b. IPSG snooping table

c. DHCP snooping binding table

d. CAM filtering table

10. Which of the following PVLAN edge ports is unable to communicate with other PVLAN edge ports?

a. Isolated port

b. Nonprotected port

c. Secluded port

d. Protected port

The answers to the “Do I Know This Already?” quiz are found in Appendix A. The suggested choices for your next step are as follows:

• 8 or less overall score: Read the entire chapter. This includes the “Foundation Topics” and the “Exam Preparation” sections.

• 9 or 10 overall score: If you want more review on these topics, skip to the “Exam Preparation” section. Otherwise, move on to Chapter 5, “802.1X and Cisco Identity-Based Networking Services (IBNS).”

Foundation Topics

Switched Data Plane Attack Types

It is first important to understand the different types of attacks that are being used before really learning about the security technologies that are available to mitigate them. The switched infrastructure is every bit as vulnerable to attack as the traditional routed infrastructure. With modern switches taking over many of the duties that have been traditionally reserved for the routers on the network, it is even more of a target than before because they are now serving multiple layers.

image

The most common types of switched data plane attacks are as follows:

• VLAN hopping

• CAM flooding

• MAC address spoofing

• STP spoofing

• DHCP “starvation”

• DHCP server spoofing

• ARP spoofing

• IP spoofing

VLAN Hopping Attacks

VLANs are a simple way to segment the network within an enterprise to improve performance and simplify maintenance. Each VLAN consists of a single broadcast domain. Ports are restricted to receiving only packets that are part of their assigned VLAN. The VLAN information can also be carried between switches in a LAN using trunk ports by tagging packets with an identification header. Trunk ports have access to all VLANs by default. They route traffic for multiple VLANs across the same physical link. Two types of trunking protocols include 802.1Q and Inter-Switch Link (ISL), with 802.1Q being primarily used.

The switchport trunking mode (trunk or access) can be sensed using Dynamic Trunking Protocol (DTP), which automatically senses whether the adjacent device to the port is capable of trunking. If so, it synchronizes the trunking mode on the two ends. The DTP state on a trunk port can be set to auto, on, off, desirable, or non-negotiate.

One of the areas of concern with Layer 2 security is the variety of mechanisms by which packets that are sent from one VLAN can be intercepted or redirected to another VLAN, which is called VLAN hopping. VLAN hopping attacks are designed to allow attackers to bypass a Layer 3 device when communicating from one VLAN to another. The attack works by taking advantage of an incorrectly configured trunk port.

It is important to note that this type of attack does not work on a single switch because the frame will never be forwarded to the destination; however, in a multiswitch environment, a trunk link could be exploited to transmit the packet. There are two different types of VLAN hopping attacks:

image

• Switch spoofing: The network attacker configures a device to spoof a switch by emulating either ISL or 802.1Q, and DTP signaling. This makes the attacker device appear to be a switch with a trunk port and therefore a member of all VLANs.

• Double tagging: Another variation of the VLAN hopping attack involves tagging the transmitted frames with two 802.1Q headers, with the outer 802.1Q header matching the configured trunk native VLAN. When the first switch sees that the first tag on the double-tagged frame is equal to that of the native VLAN, it strips this first tag off the frame and then forwards it with the inner 802.1Q tag intact across the trunk. The second switch then forwards the packet based on the VLAN ID in the second 802.1Q header, as illustrated in Figure 4-1.

Figure 4-1. Double-Tagging VLAN Hopping Attack

image

CAM Flooding Attacks

The CAM table in a switch stores information, such as MAC addresses, switchport, and associated VLAN parameters. It is similar to a router’s routing table. CAM tables have a fixed size and are populated when devices connect to the switch.

When a Layer 2 switch receives a frame, the switch looks in the CAM table for the matching destination MAC address. If an entry exists for that MAC address, the switch forwards the frame to the port identified in the CAM table for that MAC address. If the MAC address is not in the CAM table, the switch forwards the frame out all ports on the switch. If the switch sees a response as a result of the forwarded frame, it updates the CAM table with the port on which the communication was received.

Figure 4-2 shows the CAM table operation.

image

Figure 4-2. CAM Table Operation

image

The CAM table has a limited size, and these entries expire after a certain inactivity period (the default CAM aging timer on the Cisco Catalyst switch is 5 minutes). If enough MAC addresses are flooded to a switch before existing entries expire, the CAM table fills up and new entries are not accepted. Keep in mind, however, that on modern large switches, the size of the tables is typically over 100,000 addresses. When the CAM table is full, the switch starts flooding the packets out all ports. This scenario is called a CAM table overflow or CAM flooding.

In a CAM flooding attack, an attacker sends thousands of bogus MAC addresses from one port, which looks, to the switch, like valid hosts’ communication. The goal is to flood the switch with traffic that fills the CAM table with false entries. When the CAM table is full, the switch broadcasts traffic without a CAM entry out all its ports; this broadcasting out all ports allows the attacker to see traffic not normally sent to their port. However, this flooding is limited to those ports that are configured into the same VLAN as the source attack port.

Figure 4-3 shows a CAM flooding attack.

image

Figure 4-3. CAM Flooding Attack

image

MAC Address Spoofing

MAC address spoofing involves the use of a known MAC address of another host that is authorized to access the network. The attacker attempts to make the target switch forward frames destined for the actual host to be forwarded to the attacker device instead. This is done by sending a frame with the other host’s source Ethernet address, with the objective to overwrite the CAM table entry. After the CAM is overwritten, all the packets destined for the actual host will be diverted to the attacker. If the original host sends out traffic, the CAM table will be rewritten again, moving the traffic back to the original host port.

Figure 4-4 shows how MAC spoofing works.

image

Figure 4-4. MAC Address Spoofing Attack

image

Spanning Tree Protocol (STP) Spoofing Attacks

STP prevents bridging loops in a redundant switched network environment. By avoiding loops, you can ensure that broadcast traffic does not become a traffic storm.

STP is a hierarchical tree-like topology with a “root” switch at the top. A switch is elected as root based on the lowest configured priority of any switch (0 through 65,535). When a switch boots up, it begins a process of identifying other switches and determining the root bridge. After a root bridge is elected, the topology is then established from its perspective of the connectivity. The switches determine the path to the root bridge, and all redundant paths are blocked. STP sends configuration and topology change notifications and acknowledgments (TCN/TCA) using bridge protocol data units (BPDU).

An STP attack involves an attacker spoofing the root bridge in the topology. The attacker broadcasts out an STP configuration/topology change BPDU in an attempt to force an STP recalculation. The BPDU sent out announces that the attacker’s system has a lower bridge priority. This lower switch priority will prompt STP to perform a root election, resulting in the switch with the lower priority winning. The attacker (acting as the root switch) can then see a variety of frames forwarded from other switches to it. Besides the capability to take over the root switch, the capability to cause STP recalculation can also cause a denial of service (DoS) condition on the network by causing an interruption of 30 to 45 seconds each time the root bridge changes, depending on the version of STP implemented.

Figure 4-5 shows an attacker using STP network topology changes to force its host to be elected as the root bridge.

image

Figure 4-5. STP Spoofing Attack

image

DHCP Starvation Attacks

A DHCP server dynamically assigns IP addresses to hosts on a network. The administrator creates pools of addresses available for assignment, and then a lease time is associated with the addresses. A DHCP starvation attack works by broadcasting DHCP requests with spoofed MAC addresses; what this does, from the perspective of the DHCP server, is completely allocate the number of available IP addresses. If new clients are then unable to gain access to an IP address for the network, they will be unable to use network resources.

DHCP Server Spoofing

With DHCP server spoofing, the attacker can set up a rogue DHCP server and respond to DHCP requests from clients on the network. This type of attack can often be grouped with a DHCP starvation attack because the victim server will not have any new IP addresses to give out, which raises the chance of new clients using the rouge DHCP server. This information, which is given out by the rogue DHCP server, could send all the traffic through a rogue gateway, which can then capture the traffic for further analysis.

ARP Spoofing

Another method of spoofing MAC addresses is to use Address Resolution Protocol (ARP), which is used to map IP addresses to MAC addresses residing on one LAN segment. When a host sends out a broadcast ARP request to find a MAC address of a particular host, an ARP response comes from the host whose address matches the request. The ARP response is cached by the requesting host. An attacker can abuse this mechanism by responding as though they are the requested host. This method can be considered more threatening than MAC address spoofing because, while the CAM table stores these addresses for only 5 minutes (by default), most Cisco devices default to holding their ARP table associations for 4 hours.

ARP also has another method of identifying host IP-to-MAC associations, which is called Gratuitous ARP (GARP). With GARP, a broadcast packet is used by hosts to announce their IP address to the LAN to avoid duplicate IP addresses on the network. GARP can be exploited maliciously by an attacker to spoof the identity of the device by announcing a new IP-to-MAC association for the device on a LAN segment.

Figure 4-6 shows an attacker sending an altered GARP packet to have traffic to 192.168.1.3 rerouted to Host A.

image

Figure 4-6. ARP Spoofing Attack

image

IP Spoofing

With IP spoofing, an attacker attempts to send and receive traffic on the network using an IP address of another known host or known network. The attacker is then able to use network resources that are associated with that specific IP address. As with any of the other spoofing threats, an attacker can use this access for many purposes.

Switched Data Plane Security Technologies

The following sections review the different security technologies that can be used to mitigate the attacks discussed in the previous sections.

Port Configuration

With some basic configuration, a switchport can do a lot to improve the security of the network. Each switchport is configured to be in a specific mode; the default mode is dependent on the specific device.

image

The switchport modes are as follows:

• Access: This mode is used when a single host is attached to the switchport; no trunking of any kind is permitted.

image

• Trunk: This mode statically configures the switchport as a trunk.

• Dynamic auto: This mode allows the port to become a trunk should the other side of the connection request it; if no request is made, it leaves the port in access mode.

• Dynamic desirable: This mode allows the port to become a trunk and actively attempts to make it a trunk; if unsuccessful, the port remains in access mode.

When the switchport is in either of the dynamic modes available, it relies on the Dynamic Trunking Protocol (DTP) to negotiate the port into a trunk mode. Another way of securing the switchport is to disable DTP; when this is done, the switchport must be manually configured as a trunk on both sides of the connection for the trunk to work.

Table 4-2 displays some of the basic commands that can be used to change switchport configuration and to display switchport information.

image

Table 4-2. Configuring Ports

image

Example 4-1 shows the configuration of a switchport into access mode; this would be the typical configuration of a port connecting to a single host device. Any potential attacker trying to gain access to information from multiple VLANs would be unable to get this information from this switchport.

Example 4-1. Configuring Switchport Mode (Access)


Switch# configure terminal
Switch(config)# interface fastethernet0/0
Switch(config-if)# switchport mode access


Example 4-2 shows the configuration of a switchport set to trunk mode. In this mode, the switchport is assumed to be connected to another trunk port of a neighboring switch. To quickly review, a trunk link is able to transport multiple VLANs from one switch to another so that VLANs can expand across multiple switches.

Example 4-2. Configuring Switchport Mode (Trunk)


Switch# configure terminal
Switch(config)# interface fastethernet0/0
Switch(config-if)# switchport mode trunk


Example 4-3 shows the configuration of two different switches, SwitchA and SwitchB. In this scenario, SwitchA would initiate a DTP negotiation with SwitchB to make the link between them a trunk. SwitchB would respond to this negotiation and form a trunk between them. In this case, SwitchA would always be the initiating switch.

Example 4-3. Configuring Switchport Mode (Dynamic)


SwitchA# configure terminal
SwitchA(config)# interface fastethernet0/0
SwitchA(config-if)# switchport mode dynamic desirable

SwitchB# configure terminal
SwitchB(config)# interface fastethernet0/0
SwitchB(config-if)# switchport mode dynamic auto


Example 4-4 shows the switchport being configured to not utilize DTP for trunk negotiation. An error will occur should this command be entered on a switchport that is configured in either of the dynamic modes. When using this command, the trunk must be statically configured.

Example 4-4. Configuring Switchport Nonegotiate


SwitchA# configure terminal
SwitchA(config)# interface fastethernet0/0
SwitchA(config-if)# switchport nonegotiate


The next part of the configuration involves the configuration of specific VLANs that are associated with specific ports. By default, all switchports are assigned into VLAN 1, and this includes the native VLAN on trunk links. A VLAN configured on an access port is assigned to all traffic coming from that specific switchport.

Example 4-5 shows an access switchport being configured into VLAN 100.

Example 4-5. Configuring Access Switchport VLAN


SwitchA# configure terminal
SwitchA(config)# interface fastethernet0/0
SwitchA(config-if)# switchport access vlan 100


A native VLAN on a trunk port is used to internally notate a VLAN for untagged traffic; the traffic on this native VLAN is transported across the link untagged. Traffic that comes into the switch to be transported across the trunk link with a VLAN tag number matching the native VLAN number has its tag stripped and goes across the trunk link untagged. This default behavior can be used by an attacker to perform a double-tagging VLAN hopping attack.

Three main methods can be used to eliminate this attack:

• Never have a native trunk VLAN number that matches any access VLAN number.

• Prune the native VLAN configured from being transported across the trunk (breaks native VLAN functionality).

• Configure the switch to always tag native VLAN traffic (thus, all traffic is given a VLAN tag across the trunk).

Example 4-6 shows the native VLAN of a trunk being configured into VLAN 555 and the various mitigation techniques.

Example 4-6. Configuring Native Trunk VLAN and Security Options


Switch# configure terminal
Switch(config)# interface fastethernet0/0
Switch(config-if)# switchport trunk native vlan 555

Removes the native VLAN 555 from being transported over the trunk
Switch(config-if)# switchport trunk allow vlan remove 555

Configures the switch or switchport to autmatically tag all traffic on the
native VLAN
Switch(config)# vlan dot1q vlan native

Or

Switch(config-if)# switchport trunk vlan native tag


When you put all of this together, you get a solution for mitigating VLAN hopping attacks. The following list includes good guidelines to follow when setting up a switch securely and avoiding VLAN hopping attack risks:

• Disable all unused ports and place them in an unused VLAN.

• Set all user ports to nontrunking mode by disabling DTP. (It is not a bad idea to set all ports by default to access mode and then reconfigure the trunking ports as needed.)

• For backbone switch-to-switch connections, explicitly configure trunking and disable DTP.

• Do not use VLAN 1 as the switch management VLAN.

Port Security

You can mitigate CAM flooding, MAC address spoofing, and DHCP starvation attacks using different features available with port security. It is important to explain and understand these features and describe how they work to properly implement them. Port security classifies MAC addresses into three different groups:

• Static secure MAC addresses: A switchport can be manually configured with the specific MAC address of the device that connects to it.

• Dynamic secure MAC addresses: The maximum number of MAC addresses that will be learned on a single switchport is specified. These MAC addresses are dynamically learned, stored only in the address table, and removed when the switch restarts.

• Sticky secure MAC addresses: The maximum number of MAC addresses on a given port can be dynamically learned or manually configured. Those addresses that are dynamically learned become sticky addresses that will be stored in the address table and added to the running configuration (as static entries). If the addresses are saved in the configuration file, the interface does not need to dynamically relearn them when the switch restarts.

A specific action is taken when a port security violation occurs. These actions include

• Protect: If the number of secure MAC addresses reaches the limit allowed on the port, frames with unknown source addresses are dropped until a number of MAC addresses are removed or the number of allowable addresses is increased; you receive no notification of the security violation.

• Restrict: If the number of secure MAC addresses reaches the limit allowed on the port, frames with unknown source addresses are dropped until some number of secure MAC addresses are removed or the maximum number of allowable addresses is increased. In this mode, a security notification is sent to the Simple Network Management Protocol (SNMP) server (if configured), a syslog message is logged, and the violation counter is incremented.

• Shutdown: If a port security violation occurs, the interface changes to error-disabled and the LED is turned off. It sends an SNMP trap, logs to a syslog message, and increments the violation counter. This is the default behavior.

Table 4-3 displays some of the basic commands that can be used to change port security configuration and to display port security information.

image

Table 4-3. Configuring Port Security

image

image

Note

When a secure port is in the error-disabled state, you can bring it out of this state automatically by using the errdisable recovery global configuration command, or you can manually reenable it by entering the shutdown and no shutdown interface configuration commands.

Both CAM flooding and DHCP starvation attacks can be mitigated by limiting the total number of allowed MAC addresses for an individual port. This eliminates the threat of CAM flooding because the maximum number of MAC addresses assigned would typically be much lower than what is available in the switch’s CAM table. DHCP starvation attacks can be mitigated with this same feature because it limits the number of falsified clients on an individual port. The DHCP starvation attack could still happen but be limited in its scope.

MAC address spoofing attacks can be mitigated with port security by locking down which specific MAC addresses are allowed on an individual port. The attacker is then unable to plug into another port on the switch and utilize the spoofed MAC address.

The following example configures a switchport as an access port and sets dynamic port security with maximum number of addresses learned to 20. The violation mode is the default shutdown mode, sticky learning is enabled, and no static MAC addresses are configured. In the scenario where a twenty-first computer tries to connect, the port will be placed in error-disabled state and will send out an SNMP trap notification.

With the configuration shown in Example 4-7, both CAM flooding and DHCP starvation would be limited to 20 total CAM entries coming from interface fastethernet 0/0.

Example 4-7. Configuring Dynamic Port Security (Maximum Addresses)


Switch# configure terminal
Switch(config)# interface fastethernet0/0
Switch(config-if)# switchport mode access
Switch(config-if)# switchport port-security
Switch(config-if)# switchport port-security maximum 20
Switch(config-if)# switchport port-security mac-address sticky


With the configuration shown in Example 4-8, the port is configured with one specific MAC address. If any other device plugs into this interface not using that specific MAC address, the port will go into an err-disabled state that must be cleared by an administrator.

Example 4-8. Configuring Static Port Security


Switch# configure terminal
Switch(config)# interface fastethernet0/0
Switch(config-if)# switchport mode access
Switch(config-if)# switchport port-security
Switch(config-if)# switchport port-security mac-address 0123.4567.8910


Root Guard, BPDU Guard, and PortFast

To mitigate STP manipulation, two different features can be used. The Root Guard feature is configured on a switchport that should never become a root port, or in other words, the port that forwards traffic going toward the root bridge. A good example of this would be a connection between a distribution layer switch and an access layer switch. In this scenario, the port on the distribution switch going toward the access layer should never become a root port because the access layer switch should never become the root switch. If the switchport does receive a superior BPDU, the port will go into root-inconsistent state, indicating that another switch is attempting to become the root switch.

The other feature is BPDU Guard; this feature is typically implemented with PortFast. The PortFast feature is used on access ports to speed the transition of the port into STP forwarding state. PortFast and BPDU Guard are implemented on a switchport or interface. BPDU Guard should be implemented on a switchport or interface that should never receive a BPDU packet. Should the port be configured with BPDU Guard and receive a BPDU, the port will go into the error-disable state. All access ports should never receive a BPDU and can be configured with BPDU Guard to eliminate an attacker plugging into an access port and acting as a superior switch.

Table 4-4 displays some of the basic commands that can be used to configure the Root Guard, PortFast, and BPDU Guard features and to display feature information.

image

Table 4-4. Configuring Root Guard and BPDU Guard

image

Example 4-9 demonstrates enabling Root Guard and BPDU Guard. The switchport fastethernet0/0 is configured to not accept superior BPDUs and is configured to not use BPDU Guard, while all other ports are enabled by default.

Example 4-9. Configuring Root Guard and BPDU Guard


Switch# configure terminal
Switch(config)# spanning-tree portfast bpduguard default
Switch(config)# interface fastethernet 0/0
Switch(config-if)# spanning-tree guard root
Switch(config-if)# spanning-tree bpdu-guard disable


DHCP Snooping

One main feature can be used to mitigate DHCP server spoofing and offer additional protection from DHCP starvation attacks: DHCP snooping. DHCP snooping is a DHCP security feature that provides network security by filtering untrusted DHCP messages using a DHCP snooping binding database that it builds and maintains (referred to as the DHCP snooping binding table). This binding table includes the client MAC address, IP address, DHCP lease time, binding type, VLAN number, and interface information on each untrusted switchport or interface. An untrusted switchport or interface should be configured when it comes from an untrusted part of the network that should not contain a DHCP server; by default, all switchports are untrusted. A trusted switchport or interface should be configured to receive messages only from a trusted DHCP source or a network that contains a trusted DHCP source.

When a switch receives a packet on an untrusted switchport or interface and DHCP snooping is enabled on that interface or VLAN, the switch compares the source packet information with that held in the DHCP snooping binding table. In certain situations, the switch will permit or deny the packet based on this information. The following situations dictate when a packet is denied:

• A packet from a DHCP server is received on an untrusted switchport or interface.

• A packet is received on an untrusted switchport or interface that does not match the contents of the DHCP snooping binding table.

• A packet is received from a DHCP relay-agent that does not match 0.0.0.0, or the DHCP relay agent forwards a packet that includes option-82 information on an untrusted switchport or interface.

DHCP snooping also has a rate-limiting function that limits the number of DHCP messages allowed on a switchport or interface per second. This capability can be used to further mitigate the risk of DHCP starvation attacks.

Table 4-5 displays some of the basic commands that can be used to configure DHCP snooping and display DHCP snooping information.

image

Table 4-5. Configuring DHCP Snooping

image

Example 4-10 shows the configuration for enabling DHCP snooping globally on the switch, enabling it on VLAN 34, and configuring a rate limit of 70 packets per second on the fastethernet0/0 interface.

Example 4-10. Configuring DHCP Snooping


Switch# configure terminal
Switch(config)# ip dhcp snooping
Switch(config)# ip dhcp snooping vlan 34
Switch(config)# interface fastethernet0/0
Switch(config-if)# ip dhcp snooping limit rate 70


Dynamic ARP Inspection (DAI)

The feature that can be used to mitigate ARP spoofing attacks is Dynamic ARP Inspection (DAI). DAI is a security feature that intercepts and verifies IP-to-MAC address bindings and discards invalid ARP packets. DAI uses the DHCP snooping database to validate bindings. It associates a trust state with each switchport or interface on the switch. Packets arriving on trusted interfaces bypass all DAI validation checks, and those arriving on untrusted interfaces undergo the DAI validation process. In a typical network, all ports on the switch connected to the host are configured as untrusted, and switchports or interfaces connected to other switches are considered trusted.

Table 4-6 displays some of the basic commands that can be used to configure DAI and to display DAI information.

image

Table 4-6. Configuring Dynamic ARP Inspection

image

image

Example 4-11 shows a basic DAI configuration that enables DAI on VLAN 34 and configures the fastethernet0/0 switchport/interface as trusted.

Example 4-11. Configuring Dynamic ARP Inspection


Switch# configure terminal
Switch(config)# ip arp inspection vlan 34
Switch(config)# interface fastethernet0/0
Switch(config-if)# ip arp inspection trust


DAI has the capability to perform additional checks on the ARP packets received. These additional validation checks enable further verification of the proper ARP use. The three additional checks that can be configured are as follows:

• Source MAC address: This validation check verifies that the source MAC address in the Ethernet header matches the sender MAC address in the ARP body.

• Destination MAC address: This validation check verifies that the destination MAC address in the Ethernet header matches the target MAC address in the ARP body.

• IP address: This validation check verifies that the address used is not invalid or unexpected.

Example 4-12 shows a DAI configuration that is enabled on VLAN 55 and performs additional validation of the source MAC address.

Example 4-12. Configuring Dynamic ARP Inspection (Validation)


Switch# configure terminal
Switch(config)# ip arp inspection vlan 55
Switch(config)# ip arp inspection validate src-mac


DAI can also perform rate limiting of ARP packets. This is useful if an attacker is trying to perform DoS attacks on a switchport or interface.

Example 4-13 shows a DAI configuration that limits the speed of ARP packets to 50 packets per second (pps).

Example 4-13. Configuring Dynamic ARP Inspection (Rate Limit)


Switch# configure terminal
Switch(config)# ip arp inspection rate 50


In situations where DHCP is not used or where some devices are statically configured, DAI must be configured using ARP access lists. These access lists define specific MAC/IP pairs that are allowed.

Example 4-14 shows a DAI configuration where the MAC/IP pair 192.168.1.50/ABCD.EF01.1234 is enabled on VLAN 100 as valid.

Example 4-14. Configuring Dynamic ARP Inspection (Static ARP)


Switch# configure terminal
Switch(config)# arp access-list DAI_example
Switch(config-arp-acl)# permit ip host 192.168.1.50 mac host abcd.ef01.1234
Switch(config-arp-acl)# exit
Switch(config)# ip arp inspection filter DAI_example vlan 100


IP Source Guard

The IP Source Guard (IPSG) feature mitigates the chances of IP spoofing. The IPSG feature works on Layer 2 ports by restricting IP traffic based on the entries that exist in the DHCP snooping binding table. When enabled, IPSG will not allow any IP traffic over the switchport except for that traffic coming from the entry listed in the DHCP snooping table. A port access list will then be dynamically created based on the DHCP binding. IPSG also offers the capability to configure a static IP source binding that can be used in situations without the use of the DHCP snooping binding table.

The behavior of IP Source Guard depends on how it is enabled; the two available options include

• Source IP address filtering: When using this type of filtering, IPSG allows packets with an IP source address that is in the DHCP snooping binding database.

• Source IP and MAC address filtering: When using this type of filtering, IPSG allows packets whose IP address and MAC address match the DHCP snooping binding table.

Table 4-7 displays some of the basic commands that can be used to configure IPSG and display IPSG information.

image

Table 4-7. Configuring IPSG

image

Example 4-15 shows IPSG configuration on interface fastethernet0/0 using source IP address filtering and a static source binding with a MAC address of 0123.4567.890a, an IP address of 192.168.1.200, and using VLAN 200 and interface fastethernet0/0. With this configuration, traffic will only be allowed from addresses with matching entries in the DHCP snooping binding table or matching the statically configured entry.

Example 4-15. Configuring IPSG


Switch# configure terminal
Switch(config)# interface fastethernet0/0
Switch(config-if)# ip verify source
Switch(config-if)# exit
Switch(config)# ip source binding 0123.4567.890a vlan 200 192.168.1.200 interface fastethernet 0/0


Private VLANs (PVLAN)

The use of VLANs is common in many modern networks to isolate the various parts of the network. These parts are typically separated by administrative use or by the type of endpoint device. Each of these VLANs must be assigned a separate IP subnet, with a common Layer 3 device performing the routing between them and providing any security filtering. In situations where the number of different VLANs becomes excessive because of traffic isolation requirements, there is another alternative. The private VLAN feature offers the ability to isolate different devices within the same VLAN and IP subnet. This works by defining ports into three different classifications, which are as follows:

image

• Promiscuous ports: Communicate with all other port types. Configured in a primary VLAN.

• Community ports: Communicate with other devices inside the same community and with all promiscuous ports. Configured in a secondary VLAN that is tiered to a primary VLAN.

• Isolated ports: Communicate only with other promiscuous ports. Configured in a secondary VLAN that is tiered to a primary VLAN.

The private VLAN feature can also be used across switches as long as the trunks between the switches support the 802.1Q trunking standard; however, the private VLAN feature is not supported by Cisco VLAN Trunking Protocol (VTP). All devices using the private VLAN feature must be configured as VTP transparent.

Table 4-8 displays some of the basic commands that can be used to configure private VLANs and display private VLAN information.

image

Table 4-8. Configuring Private VLANs

image

The configuration process to implement the private VLAN feature involves the creation of the primary and secondary VLANs, associating these VLANs to each other, and then associating these VLANs to switchports or interfaces. Only one isolated secondary VLAN can be associated with a single primary VLAN, but multiple community VLANs can be assigned to a single primary VLAN.

Example 4-16 shows the configuration of private VLANs, with a primary VLAN 100 being configured on interface fastetherent0/0, a community secondary VLAN 200 being configured on interface fastethernet0/1, and an isolated secondary VLAN 300 being configured on interface fastethernet0/2.

Example 4-16. Configuring Private VLANs


Switch# configure terminal
Switch(config)# vtp mode transparent
Switch(config)# vlan 200

Switch(config-vlan)# private-vlan community
Switch(config-vlan)# vlan 300
Switch(config-vlan)# private-vlan isolated
Switch(config-vlan)# vlan 100
Switch(config-vlan)# private-vlan primary
Switch(config-vlan)# private-vlan association 200,300
Switch(config-vlan)# exit
Switch(config)# interface fastethernet0/0
Switch(config-if)# switchport mode private-vlan promiscuous 100 200,300
Switch(config-if)# interface fastetherent0/1
Switch(config-if)# switchport mode private-vlan host-association 100 200
Switch(config-if)# interface fastethernet0/2
Switch(config-if)# switchport mode private-vlan host-association 100 300


When trying to configure Layer 3 switching for private VLAN ingress traffic, the secondary VLANs must be mapped with the primary VLAN’s switched virtual interface (SVI).

Example 4-17 shows the configuration that would be required to perform this mapping.

Example 4-17. Configuring Private VLANs


Switch# configure terminal
Switch(config)# interface vlan 200
Switch(config-if)# private-vlan mapping add 200,300


PVLAN Edge

Although private VLANs can be used in a variety of situations, they are not supported on all Catalyst switches. On the lower-end switches that do not support private VLANs, an alternative can be used called PVLAN Edge. This feature mimics the functionality of a private isolated VLAN. Each port that you want to be isolated is configured as a protected port. Protected ports are unable to exchange traffic directly between each other without a Layer 3 device. They can, however, exchange traffic normally with any unprotected ports.

Table 4-9 displays some of the basic commands that can be used to configure PVLAN Edge and to display PVLAN Edge information.

image

Table 4-9. Configuring Private Edge Ports

image

Example 4-18 shows the configuration of PVLAN Edge protected ports. In this example, switchports fastethernet0/0 and 0/1 would be unable to exchange traffic directly but could exchange traffic directly with all other switchports.

Example 4-18. Configuring PVLAN Edge


Switch# configure terminal
Switch(config)# interface fastetherent0/0
Switch(config-if)# switchport protected
Switch(config-if)# interface fastethernet0/1
Switch(config-if)# switchport protected


Exam Preparation

As mentioned in the section, “How to Use This Book,” in the Introduction, you have several choices for exam preparation: the exercises here, the memory tables in Appendix D, the final exam preparation chapter, and the exam simulation questions on the CD-ROM. The following questions present a bigger challenge than the exam itself because they use an open-ended question format. By using this more difficult format, you exercise your memory better and prove your conceptual and factual knowledge of this chapter. You can find the answers to these questions in Appendix A, “Answers to the DIKTA Quizzes and Fill in the Blanks Questions.”

Review All Key Topics

Review the most important topics in this chapter, noted with the Key Topics icon in the margin of the page. Table 4-10 lists a reference of these key topics and the page numbers on which each is found.

Table 4-10. Key Topics

image

Complete Tables and Lists from Memory

Print a copy of Appendix C, “Memory Tables” (found on the CD), or at least the section for this chapter, and complete the tables and lists from memory. Appendix D, “Memory Table Answers,” also on the CD, includes completed tables and lists to check your work.

Define Key Terms

Define the following key terms from this chapter, and check your answers in the Glossary:

CAM table

ARP

VLAN

DHCP

STP

BPDU

DTP

Use Command Reference to Check Your Memory

Table 4-16 and Table 4-17 list the important commands from this chapter. To test your memory, cover the right side of the table with a piece of paper, read the description on the left side, and see how much of the command you can remember.

Table 4-16. Command Reference

image

image

image

image

image

Table 4-17. show Command Reference

image

Fill in the Blanks

  1. The trunking mode on a switchport can be sensed using _____.
  2. The _____ in a switch stores information, such as MAC addresses, switchport, and associated VLAN parameters.
  3. The default CAM aging timer on the Cisco Catalyst switch is _____.
  4. _____ prevents bridging loops in a redundant switched network environment.
  5. A _____ server dynamically assigns IP addresses to hosts on a network.
  6. ARP also has another method of identifying host IP-to-MAC associations, which is called _____.
  7. The switchport mode that actively attempts to make a switchport a trunk is _____.
  8. The _____ switchport security classification includes dynamically learned addresses that are automatically added to the running configuration.
  9. The _____ includes the client MAC address, IP address, lease time, binding type, VLAN number, and interface information.
  10. The three different private VLAN classifications are _____, _____, and _____.