A Layer 2 port can be
configured as an access or a trunk port as follows:
-
An access port can
have only one VLAN configured on that port; it can carry traffic for only one
VLAN.
-
A trunk port can
have two or more VLANs configured on that port; it can carry traffic for
several VLANs simultaneously.
By default, all ports
on the device are Layer 3 ports.
You can make all ports
Layer 2 ports using the setup script or by entering the
system default
switchport command. See the
Cisco Nexus 9000
Series NX-OS Fundamentals Configuration Guide for information about
using the setup script. To configure the port as a Layer 2 port using the CLI,
use the
switchport
command.
All ports in the same
trunk must be in the same VDC, and trunk ports cannot carry VLANs from
different VDCs.
The following figure
shows how you can use trunk ports in the network. The trunk port carries
traffic for two or more VLANs.
Figure 1. Trunk and Access
Ports and VLAN Traffic
Note |
See the
Cisco Nexus
9000 Series NX-OS Layer 2 Switching Configuration Guide for information
about VLANs.
|
In order to correctly
deliver the traffic on a trunk port with several VLANs, the device uses the
IEEE 802.1Q encapsulation, or tagging, method (see the “IEEE 802.1Q
Encapsulation” section for more information).
Note |
See the
Cisco Nexus
9000 Series NX-OS Unicast Routing Configuration Guide for information
about subinterfaces on Layer 3 interfaces.
|
To optimize the
performance on access ports, you can configure the port as a host port. Once
the port is configured as a host port, it is automatically set as an access
port, and channel grouping is disabled. Use the host designation to decrease
the time that it takes the designated port to begin to forward packets.
Only an end station
can be set as a host port; you will receive an error message if you attempt to
configure other ports as hosts.
If an access port
receives a packet with an 802.1Q tag in the header other than the access VLAN
value, that port drops the packet without learning its MAC source address.
A Layer 2 interface
can function as either an access port or a trunk port; it cannot function as
both port types simultaneously.
When you change a
Layer 2 interface back to a Layer 3 interface, that interface loses all the
Layer 2 configuration and resumes the default VLAN configurations.