VMware Cloud Community
lromagnoli
Contributor
Contributor
Jump to solution

vmware switch Vlan configuration

It's possible to have a vmware switch configuration that looks like

interface GigabitEthernet0/4

description Compute Node 1 eth1

switchport trunk native vlan 100

switchport trunk encapsulation dot1q

switchport trunk allowed vlan 100, 101 102

switchport mode trunk

spanning-tree portfast trunk

on the gigabitEthernet 0/4 I've got a linux machine that needs these config.

thank you!

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
VirtuallyMikeB
Jump to solution

Ah, very good. Sorry for my confusion!

Yes, you can do this.

interface GigabitEthernet0/4

Understand and document how this switchport is connected to your ESXi host.  During boot, your ESXi host will enumerate its physical NICs, known as vmnics.  Turn on CDP on your vSwitches (or LLDP if using a vDS) so you'll know how your ESXi host connects northbound.

description Compute Node 1 eth1

You can't configure descriptions on Standard vSwitches (you *can* configure them on a vDS). You can also, of course, name port groups however you like, with a few caveats.

switchport trunk native vlan 100

VMware virtual switches don't exactly have the concept of Native VLANs.  If you want packets to leave the ESXi host untagged, you simply don't assign a VLAN to that particular port group.


switchport trunk encapsulation dot1q

VMware only uses 802.1q tagging.  There's no need to configure it explicitly.  Also, you can't.


switchport trunk allowed vlan 100, 101 102

Create whatever VLANs you like on the ESXi hosts using port group VLAN settings.  Remember not to configure a VLAN for the port group which hosts the Native VLAN.


switchport mode trunk

ESXi hosts accept multiple VLANs on one vmnic out of the box.  There's no need to configure it.


spanning-tree portfast trunk

This option is strictly for switching devices, not end-hosts like ESXi.  Your ESXi NIC ports will come up as fast as possible.

-----------------------------------------

Please consider marking this answer "correct" or "helpful" if you found it useful.

Mike Brown

VMware, Cisco Data Center, and NetApp dude

Consulting Engineer

michael.b.brown3@gmail.com

Twitter: @VirtuallyMikeB

Blog: http://VirtuallyMikeBrown.com

LinkedIn: http://LinkedIn.com/in/michaelbbrown

----------------------------------------- Please consider marking this answer "correct" or "helpful" if you found it useful (you'll get points too). Mike Brown VMware, Cisco Data Center, and NetApp dude Sr. Systems Engineer michael.b.brown3@gmail.com Twitter: @VirtuallyMikeB Blog: http://VirtuallyMikeBrown.com LinkedIn: http://LinkedIn.com/in/michaelbbrown

View solution in original post

0 Kudos
5 Replies
scott28tt
VMware Employee
VMware Employee
Jump to solution

Moderator note: Moved to the vSphere vNetwork forum area.


-------------------------------------------------------------------------------------------------------------------------------------------------------------

Although I am a VMware employee I contribute to VMware Communities voluntarily (ie. not in any official capacity)
VMware Training & Certification blog
0 Kudos
VirtuallyMikeB
Jump to solution

That looks pretty good, except for the missing comma in "switchport trunk allow"

-----------------------------------------

Please consider marking this answer "correct" or "helpful" if you found it useful.

Mike Brown

VMware, Cisco Data Center, and NetApp dude

Consulting Engineer

michael.b.brown3@gmail.com

Twitter: @VirtuallyMikeB

Blog: http://VirtuallyMikeBrown.com

LinkedIn: http://LinkedIn.com/in/michaelbbrown

----------------------------------------- Please consider marking this answer "correct" or "helpful" if you found it useful (you'll get points too). Mike Brown VMware, Cisco Data Center, and NetApp dude Sr. Systems Engineer michael.b.brown3@gmail.com Twitter: @VirtuallyMikeB Blog: http://VirtuallyMikeBrown.com LinkedIn: http://LinkedIn.com/in/michaelbbrown
0 Kudos
lromagnoli
Contributor
Contributor
Jump to solution

the commands came from a cisco os how to do it on the vmware switch?

0 Kudos
VirtuallyMikeB
Jump to solution

Ah, very good. Sorry for my confusion!

Yes, you can do this.

interface GigabitEthernet0/4

Understand and document how this switchport is connected to your ESXi host.  During boot, your ESXi host will enumerate its physical NICs, known as vmnics.  Turn on CDP on your vSwitches (or LLDP if using a vDS) so you'll know how your ESXi host connects northbound.

description Compute Node 1 eth1

You can't configure descriptions on Standard vSwitches (you *can* configure them on a vDS). You can also, of course, name port groups however you like, with a few caveats.

switchport trunk native vlan 100

VMware virtual switches don't exactly have the concept of Native VLANs.  If you want packets to leave the ESXi host untagged, you simply don't assign a VLAN to that particular port group.


switchport trunk encapsulation dot1q

VMware only uses 802.1q tagging.  There's no need to configure it explicitly.  Also, you can't.


switchport trunk allowed vlan 100, 101 102

Create whatever VLANs you like on the ESXi hosts using port group VLAN settings.  Remember not to configure a VLAN for the port group which hosts the Native VLAN.


switchport mode trunk

ESXi hosts accept multiple VLANs on one vmnic out of the box.  There's no need to configure it.


spanning-tree portfast trunk

This option is strictly for switching devices, not end-hosts like ESXi.  Your ESXi NIC ports will come up as fast as possible.

-----------------------------------------

Please consider marking this answer "correct" or "helpful" if you found it useful.

Mike Brown

VMware, Cisco Data Center, and NetApp dude

Consulting Engineer

michael.b.brown3@gmail.com

Twitter: @VirtuallyMikeB

Blog: http://VirtuallyMikeBrown.com

LinkedIn: http://LinkedIn.com/in/michaelbbrown

----------------------------------------- Please consider marking this answer "correct" or "helpful" if you found it useful (you'll get points too). Mike Brown VMware, Cisco Data Center, and NetApp dude Sr. Systems Engineer michael.b.brown3@gmail.com Twitter: @VirtuallyMikeB Blog: http://VirtuallyMikeBrown.com LinkedIn: http://LinkedIn.com/in/michaelbbrown
0 Kudos
chriswahl
Virtuoso
Virtuoso
Jump to solution

It would look similar to this config.

dvp-config.jpg

VCDX #104 (DCV, NV) ஃ WahlNetwork.com ஃ @ChrisWahl ஃ Author, Networking for VMware Administrators