Chapter
S Commands
switchport mode
To configure the interface as a nontrunking nontagged single-VLAN Ethernet or virtual Ethernet
interface, use the switchport mode command. To remove the configuration and restore the default, use
the no form of this command.
Syntax Description
access
trunk
vntag
Command Default
An access port carries traffic for VLAN 1.
Command Modes
Interface configuration mode
Virtual Ethernet interface configuration mode
Command History
Release
5.2(1)N1(1)
Usage Guidelines
An access port can carry traffic in one VLAN only. By default, an access port carries traffic for VLAN 1.
To set the access port to carry traffic for a different VLAN, use the switchport access vlan command.
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.
A virtual network tag (VNTag) port helps to identify the virtual interfaces on that physical port.
For a virtual Ethernet interface, use the no form of the command without the keywords.
Examples
This example shows how to set an interface as an Ethernet access port that carries traffic for a specific
VLAN only:
switch(config)# interface ethernet 2/1
switch(config-if)# switchport mode access
switch(config-if)# switchport access vlan 5
switch(config-if)#
This example shows how to set an interface as a VNTag port:
switch(config)# interface ethernet 1/5
OL-27880-02
switchport mode {access | trunk | vntag}
no switchport mode {access | trunk | vntag}
no switchport mode
Specifies that the interface is in access mode.
Specifies that the interface is in trunk mode.
Specifies that the interface is in port mode.
Note
Modification
This command was introduced.
This keyword does not apply to a virtual Ethernet interface.
Cisco Nexus 5500 Series NX-OS Layer 2 Interfaces Command Reference
switchport mode
1231