NX-OS – Configuring VLANs, Trunks, and VTP in the NX-OS LAN

By | July 2, 2014

Creating and Assigning VLANs:

Configuring VLANs in NX-OS is very similar to how it was configured in IOS.  VLANs are still used to limit the amount of Broadcast domains on your switched networks and segment subnets/networks.  Also, route processors are needed to route between the VLANS which a Nexus 5k and 7k can do.

To configure VLANs you run:

vlan 10
name 1stfloorbuilding

vlan 20,30,40-80
exit
exit

Would make VLANs active and allow you to name them.

show vlan brief

Lists all of the active VLANs as well as the ports they are assigned to.  To set a switchport as an access port on particular VLAN:

interface e2/1
switchport
switchport mode access
switchport access vlan 10

By running:

show int e2/1 switchport

You can see greater detail on the switchport.  If you have a bunch of ports to set on a VLAN you can use a range:

int e2/2,2/4,2/6-10

Which would take you into interface range configurations.

Configure 802.1Q Trunks in the Data Center:

Trunk links will allow you to carry VLANs between network devices.  The native VLAN will need to match on both devices and should change from the default which is 1.

vlan dot1Q tag native

Will by default tag the native VLAN which will do away with the native VLAN issue.  To create the trunk port on a particular interface run:

int e2/2
switchport
switchport mode trunk

Then run:

show interface trunk

To verify the trunk link.  The native should show as 1 and being automatically tagged.  The concept of dynamic desirable and other options has been eliminated in NX-OS due it them being unnecessary.

Configure VTP in the Data Center:

VTP is Cisco’s VLAN Trunking Protocol and may not be necessary in the NX-OS.  This is used to manage your VLANs across multiple data center devices.  It will allow you to propagate VLANs to other devices in the infrastructure automatically.   VTP will only be carried over trunk links.  The 3 modes in VTP are:

Server – sets the VLANs being used
Client – learns the VLANs being used
Transparent – will simply carry VTP messages across trunk links
Off – Turns VTP off (vtp mode off)

To ensure you don’t overwrite existing info, be sure to introduce VTP with a revision number of 0 when first enabling it.  In the NX-OS you need to first enable VTP:

feature vtp

Then:

show vtp status

To see what is running.  Until you have trunk links vtp config will not propagate.  Other configuration commands include:

vtp domain domain-name - sets the vtp domain name
vtp password vtp-pass - sets the vtp domain password
vtp version 2 - enables vtp version 2
vtp pruning - enables vtp pruning
vtp mode mode-type - will set the vtp mode (server/client/etc.)

Once you set your server and your trunks you can enable your VTP clients.  As you enable/add VLANs you will see the vtp revision numbers increment which will cause them to propagate.  When you add additional VTP servers, be sure to reset the VTP version number by renaming the vtp domain:

vtp domain temp
vtp domain vtp-domain