Table Of Contents
Configuring Layer 2 Switching
Information About Layer 2 Switching
Layer 2 Switching
Layer 2 Ethernet Switching Overview
Switching Frames Between Segments
Building the Address Table and Address Table Changes
Virtualization Support
Licensing Requirements for Layer 2 Switching
Prerequisites for Configuring MAC Addresses
Guidelines and Limitations
Configuring Layer 2 Switching
Configuring a Static MAC Address
Configuring the Aging Time for the MAC Table
Clearing Dynamic Addresses from the MAC Table
Verifying Layer 2 Switching Configuration
Layer 2 Switching Example Configuration
Default Setting
Additional References
Related Documents
Standards
Configuring Layer 2 Switching
This chapter discusses Layer 2 switching on NX-OS devices.
This chapter includes the following topics:
•
Information About Layer 2 Switching
•
Licensing Requirements for Layer 2 Switching
•
Prerequisites for Configuring MAC Addresses
•
Guidelines and Limitations
•
Configuring Layer 2 Switching
•
Verifying Layer 2 Switching Configuration
•
Layer 2 Switching Example Configuration
•
Default Setting
•
Additional References
Information About Layer 2 Switching
Note
See the Cisco Nexus 7000 Series NX-OS Interfaces Configuration Guide, Release 4.0 for information on creating interfaces.
You can configure Layer 2 switching ports as access or trunk ports. Trunks carry the traffic of multiple VLANs over a single link and allow you to extend VLANs across an entire network. All Layer 2 switching ports maintain MAC address tables.
Note
See the Cisco Nexus 7000 Series NX-OS High Availability and Redundancy Guide, Release 4.0 for complete information on high-availability features.
This section includes the following topics:
•
Layer 2 Switching
•
Virtualization Support
Layer 2 Switching
This section includes Layer 2 Ethernet switching and covers the following topics:
•
Layer 2 Ethernet Switching Overview
•
Switching Frames Between Segments
•
Building the Address Table and Address Table Changes
Layer 2 Ethernet Switching Overview
The device supports simultaneous, parallel connections between Layer 2 Ethernet segments. Switched connections between Ethernet segments last only for the duration of the packet. New connections can be made between different segments for the next packet.
The device solves congestion problems caused by high-bandwidth devices and a large number of users by assigning each device (for example, a server) to its own 10-, 100-, 1000-Mbps, or 10-Gigabit collision domain. Because each LAN port connects to a separate Ethernet collision domain, servers in a switched environment achieve full access to the bandwidth.
Because collisions cause significant congestion in Ethernet networks, an effective solution is full-duplex communication. Typically, 10/100-Mbps Ethernet operates in half-duplex mode, which means that stations can either receive or transmit. In full-duplex mode, which is configurable on these interfaces, two stations can transmit and receive at the same time. When packets can flow in both directions simultaneously, the effective Ethernet bandwidth doubles. 1/10-Gigabit Ethernet operates in full-duplex only.
Switching Frames Between Segments
Each LAN port on a device can connect to a single workstation, server, or to another device through which workstations or servers connect to the network.
To reduce signal degradation, the device considers each LAN port to be an individual segment. When stations connected to different LAN ports need to communicate, the device forwards frames from one LAN port to the other at wire speed to ensure that each session receives full bandwidth.
To switch frames between LAN ports efficiently, the device maintains an address table. When a frame enters the device, it associates the media access control (MAC) address of the sending network device with the LAN port on which it was received.
Building the Address Table and Address Table Changes
The device dynamically builds the address table by using the MAC source address of the frames received. When the device receives a frame for a MAC destination address not listed in its address table, it floods the frame to all LAN ports of the same VLAN except the port that received the frame. When the destination station replies, the device adds its relevant MAC source address and port ID to the address table. The device then forwards subsequent frames to a single LAN port without flooding all LAN ports.
You can configure MAC addresses, which are called static MAC addresses, to statically point to specified interfaces on the device. These static MAC addresses override any dynamically learned MAC addresses on those interfaces. You cannot configure broadcast or multicast addresses as static MAC addresses. The static MAC entries are retained across a reboot of the device.
The address table can store up to 128,000 address entries. The device uses an aging mechanism, defined by a configurable aging timer, so if an address remains inactive for a specified number of seconds, it is removed from the address table.
Note
See the Cisco Nexus 7000 Series NX-OS Security Configuration Guide, Release 4.0 for information on MAC port security.
Virtualization Support
The software supports virtual device contexts (VDCs), and the configuration and operation of the MAC address table are local to the VDC.
Note
See the Cisco Nexus 7000 Series NX-OS Virtual Device Context Configuration Guide, Release 4.0 for complete information on VDCs and assigning resources.
Licensing Requirements for Layer 2 Switching
The following table shows the licensing requirements for this feature:
Product
|
License Requirement
|
NX-OS
|
Layer 2 switching require no license. Any feature not included in a license package is bundled with the Cisco NX-OS system images and is provided at no extra charge to you. For a complete explanation of the NX-OS licensing scheme, see the Cisco Nexus 7000 Series NX-OS Licensing Guide, Release 4.0.
|
However, using VDCs requires an Advanced Services license.
Prerequisites for Configuring MAC Addresses
The following are prerequisites for configuring MAC addresses:
•
You must be logged onto the device.
•
If necessary, install the Advanced Services license and enter the desired VDC.
Guidelines and Limitations
Follow these guidelines and limitations for configuring MAC addresses:
•
The MAC address table stores up to 128,000 entries.
•
You can configure up to 14 different aging times on the device.
Configuring Layer 2 Switching
This section includes the following topics:
•
Configuring a Static MAC Address
•
Configuring the Aging Time for the MAC Table
•
Clearing Dynamic Addresses from the MAC Table
Note
If you are familiar with the Cisco IOS CLI, be aware that the Cisco NX-OS commands for this feature might differ from the Cisco IOS commands that you would use.
Configuring a Static MAC Address
You can configure MAC addresses, which are called static MAC addresses, to statically point to specified interfaces on the device. These static MAC addresses override any dynamically learned MAC addresses on those interfaces. You cannot configure broadcast or multicast addresses as static MAC addresses.
BEFORE YOU BEGIN
Before you configure static MAC addresses, ensure that you are in the correct VDC (or enter the switchto vdc command.
SUMMARY STEPS
1.
config t
2.
mac address-table static mac-address vlan vlan-id {[drop | interface {type slot/port | | port-channel number]}
3.
exit
4.
show mac address-table static
5.
copy running-config startup-config
DETAILED STEPS
| |
Command
|
Purpose
|
Step 1
|
config t
Example:
switch# config t
switch(config)#
|
Enters configuration mode.
|
Step 2
|
mac address-table static mac-address
vlan vlan-id {[drop | interface {type
slot/port} | port-channel number]}
Example:
switch(config)# mac-address static
12ab.47dd.ff89 vlan 3 interface ethernet
2/1
|
Specifies a static MAC address to add to the Layer 2 MAC address table.
|
Step 3
|
exit
Example:
switch(config)# exit
switch#
|
Exits the configuration mode.
|
Step 4
|
show mac address-table static
Example:
switch# show mac address-table static
|
(Optional) Displays the static MAC addresses.
|
Step 5
|
copy running-config startup-config
Example:
switch# copy running-config
startup-config
|
(Optional) Copies the running configuration to the startup configuration.
|
This example shows how to put a static entry in the Layer 2 MAC address table:
switch(config)# mac-address static 12ab.47dd.ff89 vlan 3 interface ethernet 2/1
Configuring the Aging Time for the MAC Table
You can configure the amount of time that a MAC address entry (the packet source MAC address and port on which that packet was learned) remains in the MAC table, which contains the Layer 2 information.
Note
You can also configure MAC aging time in interface configuration mode or VLAN configuration mode.
BEFORE YOU BEGIN
Before you configure the aging time for the MAC table, ensure that you are in the correct VDC (or enter the switchto vdc command.:
SUMMARY STEPS
1.
config t
2.
mac address-table aging-time seconds [vlan vlan_id]
3.
exit
4.
show mac address-table aging-time
5.
copy running-config startup-config
DETAILED STEPS
| |
Command
|
Purpose
|
Step 1
|
config t
Example:
switch# config t
switch(config)#
|
Enters configuration mode.
|
Step 2
|
mac address-table aging-time seconds
[vlan vlan_id]
Example:
switch(config)# mac address-table
aging-time 600
|
Specifies the time before an entry ages out and is discarded from the Layer 2 MAC address table. The range is from 120 to 918000; the default is 1800 seconds. Entering the value 0 disables the MAC aging.
|
Step 3
|
exit
Example:
switch(config)# exit
switch#
|
Exits the configuration mode.
|
Step 4
|
show mac address-table aging-time
Example:
switch# show mac address-table
aging-time
|
(Optional) Displays the aging time configuration for MAC address retention.
|
Step 5
|
copy running-config startup-config
Example:
switch# copy running-config
startup-config
|
(Optional) Copies the running configuration to the startup configuration.
|
This example shows how to set the ageout time for entries in the Layer 2 MAC address table to 600 seconds (10 minutes):
switch(config)# mac address-table aging-time 600
Clearing Dynamic Addresses from the MAC Table
You can clear all dynamic Layer 2 entries in the MAC address table.
BEFORE YOU BEGIN
Before you clear the dynamic MAC table, ensure that you are in the correct VDC (or enter the switchto vdc command.
SUMMARY STEPS
1.
clear mac address-table dynamic {address mac_addr} {interface [ethernet slot/port | loopback number | port-channel number} {vlan vlan_id}
2.
show mac address-table
DETAILED STEPS
| |
Command
|
Purpose
|
Step 1
|
clear mac address-table dynamic {address
mac_addr} {interface [ethernet slot/port
| loopback number | port-channel number}
{vlan vlan_id}
Example #1:
switch# clear mac address-table dynamic
Example #2:
switch# clear mac address-table dynamic
vlan 5
|
Clears the dynamic address entries from the MAC address table in Layer 2.
Example 1 demonstrates clearing the entire MAC address table of all dynamic entries.
Example 2 demonstrates clearing only those dynamic MAC addresses learned on VLAN 5 from the MAC address table
|
Step 2
|
show mac address-table
Example:
switch# show mac address-table
|
(Optional) Displays the MAC address table.
|
This example shows how to clear the dynamic entries in the Layer 2 MAC address table:
switch# clear mac address-table dynamic
Verifying Layer 2 Switching Configuration
To display Layer 2 switching configuration information, perform one of the following tasks:
Command
|
Purpose
|
show mac address-table
|
Displays information about the MAC address table.
|
show mac address-table aging-time
|
Displays information about the aging time set for the MAC address entries.
|
show mac address-table static
|
Displays information about the static entries on the MAC address table.
|
show interface [<interface>] mac-address
|
Displays the MAC addresses and the burn-in MAC address for the interfaces.
|
For detailed information about these commands, see the Cisco NX-OS Layer 2 Switching Command Reference.
Layer 2 Switching Example Configuration
The following example shows how to add a static MAC address and how to modify the default global aging time for MAC addresses:
switch# configure terminal
switch(config)# mac address-table static 0000.0000.1234 vlan 10 interface ethernet 2/15
switch(config)# mac address-table aging-time 120
Default Setting
Table 2-1 lists the default setting for Layer 2 switching parameters.
Table 2-1 Default Layer 2 Switching Parameters
Parameters
|
Default
|
Aging time
|
1800 seconds
|
Additional References
For additional information related to implementing Layer 2 switching, see the following sections:
•
Related Documents
•
Standards
Related Documents
Related Topic
|
Document Title
|
Port security, static MAC addresses
|
Cisco Nexus 7000 Series NX-OS Security Configuration Guide, Release 4.0e
|
Interfaces
|
Cisco Nexus 7000 Series NX-OS Interfaces Configuration Guide, Release 4.0
|
Command reference
|
Cisco Nexus 7000 Series NX-OS Layer 2 Switching Command Reference, Release 4.0
|
High availability
|
Cisco Nexus 7000 Series NX-OS High Availability and Redundancy Guide, Release 4.0
|
VDCs
|
Cisco Nexus 7000 Series NX-OS Virtual Device Context Configuration Guide, Release 4.0
|
System management
|
Cisco Nexus 7000 Series NX-OS System Management Command Reference, Release 4.0
|
Licensing
|
Cisco Nexus 7000 Series NX-OS Licensing Guide, Release 4.0
|
Release Notes
|
Cisco Nexus 7000 Series NX-OS Release Notes, Release 4.0
|
Standards
Standards
|
Title
|
No new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature.
|
—
|