[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How to set a vLAN on a Virtual Machine without Distributed Switches ...

Posted on 2011-10-02
42
Medium Priority
?
1,146 Views
Last Modified: 2012-05-12
Hi Experts,

I have a vmware HA environment setup, i want to enable vLANs on my virtual machines, but i dont have vDS (Distributed Switches) on my vmware server. How can i use my vLANs that i create on my router and access them from my Virtual Machines.

Thanks in advance.



Trevor
0
Comment
Question by:trevsoft
  • 22
  • 17
  • +2
42 Comments
 
LVL 42

Expert Comment

by:Paul Solovyovsky
ID: 36899234
1.  Create a standard vswitch
2.  Create a port channel group on the switch
3.  Create trunk on the port channel group and assign the nic ports assigned to your vswitch
4.  Configure vswitch for IP Hash
5.  Create port groups that correspond to your VLANs
6.  Ensure that the trunk is passing the appropriate VLANs
0
 
LVL 15

Expert Comment

by:Jaroslav Mraz
ID: 36899237
ltle coverastion is here about it

http://communities.vmware.com/thread/307008
0
 
LVL 24

Expert Comment

by:Luciano Patrão
ID: 36899251
Hi

You do not need vDS to create VLANs.

Here ares some examples how to build VLANs with normal vSwitch/Portgroup

http://kb.vmware.com/kb/1004074

http://kb.vmware.com/kb/1003806

How to create with command line

http://www.youtube.com/watch?v=zKedL_Sp31s

Also be attention on paulsolov information, regarding point 5 and 6. Its important.

Hope this can help

Jail
0
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
LVL 1

Author Comment

by:trevsoft
ID: 36901004
Hi Experts,

Im a bit lost, ive tried a bit from all these documents and i cant seem to get the vLAN working, am i missing something. I successful have vLANs working on my other servers in my core network. But im struggling to get this concept in my head.

Also, if i tell the the ESXi host to be on vLAN 0 (None) how do the virtual machines get set their vLAN or 2.

Another thing i cant find anything about trunking in the start vSwitch .. is this just terminology?

Thanks in advance for your help.



Trevor
0
 
LVL 124
ID: 36901034
1. Firstly, you must use a physical switch that can be configured for VLANs.

2. Create a TRUNK, port, and ensure that you have the Tagged VLANs run on that TRUNK port which is connected to your ESXi physical NICs.

3. For each VLAN you create a Virtual Machine Network Portgroup with the Tagged (VLAN) Required for that VLAN as in the screenshot above 36899367, in that example a VLAN 12 has been created for virtual machines to use. VMs connected to this Network (by selecting this Network in the Virtual Machine Properties, select the Network next to the VM NIC) will have their network packets tagged to use VLAN 12, so packets entering the virtual switch will be Tagged with VLAN 12, flow up the physical Uplink to the Physical Switch, which will detect the Tag in the packet, and send to VLAN 12.
0
 
LVL 124
ID: 36901036
TRUNKing is performed on the physical switch (external to ESXi).
0
 
LVL 1

Author Comment

by:trevsoft
ID: 36901066
Hi Experts,

I have Trunked the connect from the router (where the vLANs are being created) and tagged a port on the switch to do this. With this i can vLAN my physical equipment fine.

So you are say, i need to tag also the the ports where the ESXi servers are connected too on the physical switch so the vLANs are then trunked into the ESXi servers allowing the VMs see the vLAN?

Is this right?


Trevor
0
 
LVL 1

Author Comment

by:trevsoft
ID: 36901195
Hi Experts,

I have managed to get the vLANs working but i dont think its the way i want it to work.

Once i tagged the physical network cards for all the physical vm servers, and set teh vLAN ID on the vSwitch i created. The DHCP server for that vLAN brought the VM online and on the internet. First step achieved.

Now im thinking about it, does this mean everytime i was to create a vLAN for a new network, im going to have to use a port on my physical network card in hte vm server.

If so, have i configured this wrong and is there another way to do this?


Trevor
0
 
LVL 124
ID: 36902393
Normally, you would create a trunked network of one or more physical network ports, and ALL the VLANs would run over this trunk.

So, if you required another VLAN, you would add the Tag to the Trunk, and Create a Network Portgroup on the ESXi vSwitch for the virtual machines.
0
 
LVL 1

Author Comment

by:trevsoft
ID: 36903283
Hi Experts,

Ok now why would i have vLANs working on one vm server but no the other. Both Intel servers with the same NICs, version of ESXi, same vSwitch Setup, but when i vMotion from one server to the other i loose network connectivity.

Any ideas?



Trevor
0
 
LVL 124
ID: 36903298
You've not got the same vLAN setup on the other Server?

The other server does not have the a trunk with the same VLANs?
0
 
LVL 124
ID: 36903308
Can you provide screenshots of both Server's Network Configuration?
0
 
LVL 1

Author Comment

by:trevsoft
ID: 36906839
Hi hancocka,

Do you have an email address i can send them too?

I dont really want to put my production servers here online for everyone to see.



Trevor
0
 
LVL 124
ID: 36906852
I'm sorry, EE forbids comminication outside of EE.

Screenshot them, and remove the server names, or just partially obscure them.
0
 
LVL 1

Author Comment

by:trevsoft
ID: 36906898
Ok cool give me a few minutes.
0
 
LVL 124
ID: 36906901
no worries
0
 
LVL 1

Author Comment

by:trevsoft
ID: 36907003
Ok here we go ... This is the server thats working This is the server thats not working
0
 
LVL 124
ID: 36907021
why are you using a VLAN ID of 4095?

this is a special type of VLAN for Internal Use on ESXi vSwitches?

See here

http://www.yellow-bricks.com/2010/06/10/vlan-id-4095/

Normally, we allocate VLAN Tags, and reserve 0,1 and 4095, and use other numbers.
0
 
LVL 124
ID: 36907027
It is also probably worth noting that the IEEE 802.1Q standard states that VLAN ID 4095 is reserved and should not be used for VLAN assignments. This is why VMware utilised ID 4095 to provide VGT.
0
 
LVL 1

Author Comment

by:trevsoft
ID: 36907094
Does vLAN 4095 mean that all vLANs are passed through to the vm Servers ?
0
 
LVL 124
ID: 36907112
It basically means that the VLAN ID is stripped off at the Guest OS layer and not at the portgroup layer. In other words the VLAN trunk (multiple VLANs on a single wire) is extended to the virtual machine and the virtual machine will need to deal with it.

If you saw my original picture, and saw the VLAN ID of 4095, I'm using it for special debugging in my VM, looking at all traffic into the vSwitch!

Use standard VLAN Tags for your networks, (not 0, 1 or 4095)
0
 
LVL 1

Author Comment

by:trevsoft
ID: 36907143
But thats why i thought that if i used the new NIC in the vm's. VMXNET 3 cards i can set the vLANs in the guest OS.

0
 
LVL 124
ID: 36907169
well you could, but its not normal!
0
 
LVL 1

Author Comment

by:trevsoft
ID: 36907181
ok fair enough. but its the only way i could get it working.

How should i be setting it up then, becausei tried all the previous documents above and couldnt get one to work for me.
0
 
LVL 124
ID: 36907191
use a tag on a port group.

add the tag to the trunk on the switch.

does your switch support vlan tagging?
0
 
LVL 124
ID: 36907197
what router do you have, does it support vlans correctly?
0
 
LVL 1

Author Comment

by:trevsoft
ID: 36907283
Router = Netgear Quad WAN SRX5308 (meant to be a layer 3 router)
Switch = Netgear GS748TS Stackable Smart Switch (meant to be Layer 3 also)

What i have done ...

I have setup the vLANs on LAN port # 1 on the router, i then plugged the router (LAN port # 1) into LAN port # 48 on the network switch and tagged that port. i have also tagged ports 21-28 (where the vm servers are connected too).

From this point, my vLANs on my physical network work fine.

What i want to do is create a vSwitch that i can use for any network that i want to vLAN, or do i have this all wrong?


Trevor
0
 
LVL 124
ID: 36907308
is lan port 1 a trunk port, tagged with all your vlans?

lan port 48 also trunk port, tagged with all your vlans?

how many vlans? and what vlan nos?

ports 21 to 28 are all a trunk? with the same vlans running on them?
0
 
LVL 124
ID: 36907310
you should have a network port group per vLAN on the vSwitch.

traffic from the vm will be tagged on the vswitch into your physical trunk port.
0
 
LVL 1

Author Comment

by:trevsoft
ID: 36907335
this is what i dont understand, can you tell me step by step what i need to do. Up till a week ago i never needed to setup vLANs. :( and im stuggling to get my head around how it all works.
0
 
LVL 124
ID: 36907352
Why do you need to setup vLANs?
0
 
LVL 1

Author Comment

by:trevsoft
ID: 36907369
I have two physical networks i wanted to run on the same switch, so i dont have to connect over a wan and vpn connect to each network.

This is now done.


What i want to do, is my test lab, and the clients whos servers im hosting, i want them all to be on a seperate vLAN like this they can see each other.

Trevor
0
 
LVL 1

Author Comment

by:trevsoft
ID: 36907435
Ok what i have done now is removed the 4095 vLANs from all the vSwitches and i noticed an add button so i added a vm network and gave that vLAN # 2, but i still cant get it working.

Where am i going wrong?




Trevor
0
 
LVL 124
ID: 36907499
Okay, so if hosting different clients, that is good reason to use VLANs.

that's all the config that is required on ESXi.

The rest is completed on the physical switches.

Have you setup TRUNKED ports to the ESX servers? carrying the VLAN 2 TAGGED!
0
 
LVL 1

Author Comment

by:trevsoft
ID: 36907513
This is the problem, there is nothin about trunking in this switch its just Tag, Untag or None.

I think this is where im confused ...
0
 
LVL 124
ID: 36907516
Okay, maybe it does not call it trunk

normally, you have Access ports, and trunk ports, trunks carry multiple VLANs.

how many VLANs do you want?
0
 
LVL 124
ID: 36907519
normally, you trunk (bond)(group) multiple ports together.
0
 
LVL 124
ID: 36907524
states in manual on Page 3-2

When one port is assigned to multiple VLANs, the port is used as a trunk port to connect to
another switch or router.


ftp://downloads.netgear.com/files/SRX5308_RM_29Apr10.pdf
0
 
LVL 1

Author Comment

by:trevsoft
ID: 36907590
Yes i have done that already, all vLANs are configured to be on Port # 1 (on the router) which is then connected to the switch on port # 48. That port is then Tagged (im assuming TRUNKED) on the switch.

So what should i be doing on the switch to get the vLANs to go into the vm servers.



Trevor
0
 
LVL 124

Accepted Solution

by:
Andrew Hancock (VMware vExpert / EE MVE^2) earned 2000 total points
ID: 36907617
yes, if it has more than 1 VLAN it's a trunk!

Both Ports, need to have the same VLANs running on them.

I would work on the switch first, and then later add the router.

But at the switch, add 2 VLANs to 2-Ports, connect one to ESX Server A, and ESX Server B, connect up Network Portgroup with same Tag, to a VM, and you should be able to ping.

(we do not use NetGear products, the last time we had NetGear products, the VLANs did not work with HP Procurve Kit, so we scrapped them.)
0
 
LVL 1

Author Comment

by:trevsoft
ID: 36928634
Hi,

You were right .. im sorry.

Once i got my head around the way you were trying to explain how the vLANs should work it all came together.

Thank you for all your help :)
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I will show you HOW TO: Suppress Configuration Issues and Warnings Alert displayed in Summary status for ESXi 6.5 after enabling SSH or ESXi Shell.
In this article, I will show you HOW TO: Install VMware Tools for Windows on a VMware Windows virtual machine on a VMware vSphere Hypervisor 6.5 (ESXi 6.5) Host Server, using the VMware Host Client. The virtual machine has Windows Server 2016 instal…
Teach the user how to edit .vmx files to add advanced configuration options Open vSphere Web Client: Edit Settings for a VM: Choose VM Options -> Advanced: Add Configuration Parameters:
Teach the user how to join ESXi hosts to Active Directory domains Open vSphere Client: Join ESXi host to AD domain: Verify ESXi computer account in AD: Configure permissions for domain user in ESXi: Test domain user login to ESXi host:
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question