






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Ethernet interfaces can be configured either as access ports or trunk ports. Trunks carry the traffic of multiple VLANs over a single link and allow you to extend VLANs across the network.
Note Cisco NX-OS supports only IEEE 802.1Q-type VLAN trunk encapsulation.
This chapter describes the configuration of access or trunk ports on Cisco Nexus 5000 Series switches. It includes the following sections:
Ethernet interfaces can be configured either as access ports or a trunk ports, as follows:
Cisco Nexus 5000 Series NX-OS Software Configuration Guide
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: Devices in a Trunking Environment
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. 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 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.
Note
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.
An Ethernet interface can function as either an access port or a trunk port; it cannot function as both port types simultaneously.
Note
Related Topics
A trunk is a point-to-point link between the device and another networking device. Trunks carry the traffic of multiple VLANs over a single link and allow you to extend VLANs across an entire network.
Cisco Nexus 5000 Series NX-OS Software Configuration Guide
Understanding IEEE 802.1Q Encapsulation Information About Access and Trunk Interfaces
A trunk port can carry untagged packets simultaneously with the 802.1Q tagged packets. When you assign a default port VLAN ID to the trunk port, all untagged traffic travels on the default port VLAN ID for the trunk port, and all untagged traffic is assumed to belong to this VLAN. This VLAN is referred to as the native VLAN ID for a trunk port. The native VLAN ID is the VLAN that carries untagged traffic on trunk ports. The trunk port sends an egressing packet with a VLAN that is equal to the default port VLAN ID as untagged; all the other egressing packets are tagged by the trunk port. If you do not configure a native VLAN ID, the trunk port uses the default VLAN.
Note Native VLAN ID numbers must match on both ends of the trunk.
By default, a trunk port sends traffic to and receives traffic from all VLANs. All VLAN IDs are allowed on each trunk. However, you can remove VLANs from this inclusive list to prevent traffic from the specified VLANs from passing over the trunk. You can add any specific VLANs later that you may want the trunk to carry traffic for back to the list. To partition spanning tree protocol (STP) topology for the default VLAN, you can remove VLAN1 from the list of allowed VLANs. Otherwise, VLAN1, which is enabled on all ports by default, will have a very big STP topology, which can result in problems during STP convergence. When you remove VLAN1, all data traffic for VLAN1 on this port is blocked, but the control traffic continues to move on the port.
To provide additional security for traffic passing through an 802.1Q trunk port, the vlan dot1q tag native command was introduced. This feature provides a means to ensure that all packets going out of a 802.1Q trunk port are tagged and to prevent reception of untagged packets on the 802.1Q trunk port. Without this feature, all tagged ingress frames received on a 802.1Q trunk port are accepted as long as they fall inside the allowed VLAN list and their tags are preserved. Untagged frames are tagged with the native VLAN ID of the trunk port before further processing. Only those egress frames whose VLAN tags are inside the allowed range for that 802.1Q trunk port are received. If the VLAN tag on a frame happens to match that of the native VLAN on the trunk port, the tag is stripped off and the frame is sent untagged. This behavior will cause "VLAN hopping" in which it is possible for frames to jump to a different VLAN. It is also possible for traffic to become part of the native VLAN by sending untagged packets into an 802.1Q trunk port. To address the above issues, the vlan dot1q tag native command performs the following functions:
Cisco Nexus 5000 Series NX-OS Software Configuration Guide
Understanding the Native VLAN ID for Trunk Ports Information About Access and Trunk Interfaces
This feature is supported on all the directly connected Ethernet and EtherChannel interfaces of the Cisco Nexus 5000 Series switch. It is also supported on all the host interface ports of any attached Cisco Nexus 2000 Series Fabric Extender.
Note The vlan dot1q tag native command is enabled on global basis.
Configuring Access and Trunk Interfaces
You can configure an Ethernet interface as an access port. An access port transmits packets on only one, untagged VLAN. You specify which VLAN traffic that the interface carries. If you do not specify a VLAN for an access port, the interface carries traffic only on the default VLAN. The default VLAN is VLAN1. The VLAN must exist before you can specify that VLAN as an access VLAN. The system shuts down an access port that is assigned to an access VLAN that does not exist.
1. switch# configure terminal 2. switch(config)# interface {{ type slot / port } | { port-channel number }} 3. switch(config-if)# switchport mode { access | trunk } 4. switch(config-if)#^ switchport access vlan^ vlan-id
Command or Action Purpose
Step 1 switch#^ configure terminal^ Enters configuration mode.
Specifies an interface to configure, and enters interface configuration mode.
switch(config)# interface {{ type slot / port } | { port-channel number }}
Step 2
Sets the interface as a nontrunking nontagged single-VLAN Ethernet interface. An access port can carry traffic in one VLAN only. By default,
switch(config-if)# switchport mode { access | trunk }
Step 3
an access port carries traffic for VLAN1; to set the access port to carry traffic for a different VLAN, use the switchport access vlan command.
Specifies the VLAN for which this access port will carry traffic. If you do not enter this command, the access port carries traffic on VLAN1 only;
switch(config-if)# switchport access vlan vlan-id
Step 4
use this command to change the VLAN for which the access port carries traffic.
Cisco Nexus 5000 Series NX-OS Software Configuration Guide
Configuring a LAN Interface as an Ethernet Access Port Configuring Access and Trunk Interfaces
Note Cisco NX-OS supports only 802.1Q encapsulation.
To configure a trunk port, perform this task:
1. switch#^ configure terminal 2. switch(config)# interface { type slot / port | port-channel number } 3. switch(config-if)# switchport mode { access | trunk }
Command or Action Purpose
Step 1 switch# configure terminal Enters configuration mode.
Specifies an interface to configure, and enters interface configuration mode.
switch(config)# interface { type slot / port | port-channel number }
Step 2
Sets the interface as an Ethernet trunk port. A trunk port can carry traffic in one or more VLANs on the same physical link (VLANs are based on
switch(config-if)# switchport mode { access | trunk }
Step 3
the trunk-allowed VLANs list). By default, a trunk interface can carry traffic for all VLANs. To specify that only certain VLANs are allowed on the specified trunk, use the switchport trunk allowed vlan command.
This example shows how to set an interface as an Ethernet trunk port: switch# configure terminal switch(config)# interface ethernet 1/ switch(config-if)# switchport mode trunk
Related Topics
If you do not configure this parameter, the trunk port uses the default VLAN as the native VLAN ID.
1. switch# configure terminal 2. switch(config)#^ interface^ { type slot / port^ |^ port-channel^ number } 3. switch(config-if)# switchport trunk native vlan vlan-id
Cisco Nexus 5000 Series NX-OS Software Configuration Guide
Configuring the Native VLAN for 802.1Q Trunking Ports Configuring Access and Trunk Interfaces
Command or Action Purpose
Step 1 switch#^ configure terminal^ Enters configuration mode.
Specifies an interface to configure, and enters interface configuration mode.
switch(config)# interface { type slot / port | port-channel number }
Step 2
Sets the native VLAN for the 802.1Q trunk. Valid values are from 1 to 4094, except those VLANs reserved for internal use. The default value is VLAN1.
switch(config-if)# switchport trunk native vlan vlan-id
Step 3
This example shows how to set the native VLAN for an Ethernet trunk port: switch# configure terminal switch(config)# interface ethernet 1/ switch(config-if)# switchport trunk native vlan 5
You can specify the IDs for the VLANs that are allowed on the specific trunk port. Before you configure the allowed VLANs for the specified trunk ports, ensure that you are configuring the correct interfaces and that the interfaces are trunks.
1. switch# configure terminal 2. switch(config)# interface { type slot / port | port-channel number } 3. switch(config-if)# switchport trunk allowed vlan { vlan-list all | none [ add |except | none | remove { vlan-list }]}
Command or Action Purpose Step 1 switch# configure terminal Enters configuration mode.
Specifies an interface to configure, and enters interface configuration mode.
switch(config)# interface { type slot / port | port-channel number }
Step 2
Sets allowed VLANs for the trunk interface. The default is to allow all VLANs on the trunk interface: 1 to 3967 and 4048 to 4094. VLANs 3968
switch(config-if)# switchport trunk allowed vlan { vlan-list all | none [ add |except | none | remove { vlan-list }]}
Step 3
to 4047 are the default VLANs reserved for internal use by default; this group of VLANs is configurable. By default, all VLANs are allowed on all trunk interfaces. You cannot add internally allocated VLANs as allowed VLANs on trunk ports. The system returns a message if you attempt to list an internally allocated VLAN as an allowed VLAN.
Note
Cisco Nexus 5000 Series NX-OS Software Configuration Guide
Configuring the Allowed VLANs for Trunking Ports Configuring Access and Trunk Interfaces
The following example shows how to enable 802.1Q tagging on the switch: switch# configure terminal switch(config)# vlan dot1q tag native switch(config)# exit switch# show vlan dot1q tag native vlan dot1q native tag is enabled
Verifying Interface Configuration
To display access and trunk interface configuration information, perform one of these tasks:
Command Purpose
switch# show interface Displays the interface configuration
Displays information for all Ethernet interfaces, including access and trunk interfaces.
switch# show interface switchport
switch# show interface brief Displays interface configuration information.
Cisco Nexus 5000 Series NX-OS Software Configuration Guide
Configuring Access and Trunk Interfaces Verifying Interface Configuration