Cisco Nexus 5000 Series Switch CLI Software Configuration Guide (OL-16597-01, July 2009)
Adding Ports to a VLAN
After you have completed the configuration of a VLAN, assign ports to it. To add ports, perform this task:
Procedure
PurposeCommand or Action
Enters configuration mode.switch# configure terminal
Step 1
Specifies the interface to configure, and enters the
interface configuration mode. The interface can be
a physical Ethernet port or an EtherChannel.
switch(config)# interface {ethernet
slot/port | port-channel number}
Step 2
Sets the access mode of the interface to the
specified VLAN.
switch(config-if)# switchport access vlan
vlan-id
Step 3
This example shows how to configure an Ethernet interface to join VLAN 5:
switch# configure terminal
switch(config)# interface ethernet 1/13
switch(config-if)# switchport access vlan 5
Verifying VLAN Configuration
To display VLAN configuration information, perform one of these tasks:
PurposeCommand
Displays VLAN information.
switch# show running-config vlan [vlan_id |
vlan_range]
Displays selected configuration information for the
defined VLAN(s).
switch# show vlan [brief | id [vlan_id | vlan_range]
| name name | summary]
The following example shows all VLANs defined in the range of 1 to 21.
switch# show running-config vlan 1-21
version 4.0(1a)N1(1)
vlan 1
vlan 5
The following example shows the VLANs created on the switch and their status:
switch# show vlan
Cisco Nexus 5000 Series Switch CLI Software Configuration Guide
84 OL-16597-01
Configuring VLANs
Adding Ports to a VLAN