Procedure
PurposeCommand or Action
Enters global configuration mode.switch# configure terminal
Step 1
Specifies the interface that you are configuring and places you
in interface configuration mode. The interface argument are
defined as follows:
switch(config)# interface
interface
Step 2
•
For an Ethernet port, use the ethernet slot/port command,
where slot is the module slot number and port is the port
number.
•
For a vEthernet port, use the vethernet interface-number
command, where interface-number is a number from 1
to 1048575.
Sets the interface as a nontrunking nontagged, single-VLAN
Layer 2 interface in the running configuration.
switch(config-if)# switchport
mode access
Step 3
(Optional)
Specifies the VLAN for which this access port will carry traffic
and saves the change in the running configuration. If you do
switch(config-if)# switchport
mode access vlan-id
Step 4
not enter this command, the access port carries traffic on
VLAN1 only for traffic.
(Optional)
Displays the interface status and information.
switch(config-if)# show
interface interface
Step 5
(Optional)
Saves the change persistently through reboots and restarts by
copying the running configuration to the startup configuration.
switch(config-if)# copy
running-config startup-config
Step 6
This example shows how to set Ethernet 3/1 as a Layer 2 access port that carries traffic for VLAN 5 only:
switch# configure terminal
switch(config)# interface ethernet 3/1
switch(config-if)# switchport mode access
switch(config-if)# switchport access vlan 5
switch(config-if)#
Configuring Trunk Ports
You can configure a Layer 2 port as a trunk port.
Before You Begin
•
Before you configure a trunk port, ensure that you are configuring a Layer 2 interface.
•
Know that the interface can be either Ethernet or vEthernet.
Cisco Nexus 1000V for VMware vSphere Interface Configuration Guide, Release 5.x
27
Configuring Layer 2 Interfaces
Configuring Trunk Ports