VLAN – Cisco Nexus 3000

 

How to Create VLANs and Add Ports, Cisco Nexus 3000 NX-OS

Creating a VLAN and name it:

sw# config t
sw(config)# vlan 10
sw(config-vlan)# name my-vlan 
sw(config-vlan)# exit

Removing vlan, example delete vlan 10:
sw(config)# no vlan 10

Adding Ports to a VLAN:

sw(config)# interface Eth1/1-6
sw(config-if-range)# switchport mode access
sw(config-if-range)# switchport access vlan 10

removing ports from a VLAN:

sw(config) #  interface Eth1/5-6
sw(config-if-range)# no switchport access vlan 10

 

Saving the running-config to the startup-config:

sw(config)# copy running-config startup-config

 

Interface in Multiple VLANs, trunk mode

switch# configure terminal 
switch(config)# interface ethernet 1/47-48
switch(config-if)# switchport mode trunk
switch(config-if)# switchport trunk native vlan 2
switch(config-if)# switchport trunk allow vlan 15-20

Trunk and access ports
There are two ways in which a node can be connected to a switch carrying 802.1Q VLAN traffic: Access port, where VLAN support is handled by the switch. or Trunk port, where VLAN support is handled by the attached node (which sees 802.1Q-tagged Ethernet frames).

Example Configuring a Trunk Port

switch# configure terminal
switch(config)# vlan dot1Q tag native
switch(config)# interface ethernet 1/47
switch(config-if)# switchport mode trunk
switch(config-if)# switchport trunk native vlan 2
switch(config-if)# switchport trunk allowed vlan all