VMware Cloud Community
ccie4481
Contributor
Contributor

virtual machine VLAN trunking

Hello

I have a machine that has two virtual adapters. But i need to trunk 2 VLANS to each adapter.

IE

virtual adapter 1: needs vlan 100, 101

virtual adapter 2: needs vlan 150, 151

is this possible??? how do i configure it?

TIA

0 Kudos
15 Replies
RParker
Immortal
Immortal

Did you try the knowledgebase? They put many documents for setting up the servers, networking, datastorage, etc.. in pdf files.

0 Kudos
Randy_B
Enthusiast
Enthusiast

You can't use more than one vlan ID per port group. Can you just add a couple more virtual nics and assign each a different port group/vlan id?

0 Kudos
ccie4481
Contributor
Contributor

No the VM image i am using is a network appliance....it has to be able to see multiple vlans on two nics...it can only have two "phsyical nics"....e0 and e1....

so there is no way to add multiple vlans without adding nics? the vswitch itself doesnt support trunking? that seems like a pain if you want to have 4 networks on your box to setup 4 seperate NICs instead of doing trunking on one....

0 Kudos
VirtualNoitall
Virtuoso
Virtuoso

Hello,

thought this doc might help: http://www.vmware.com/pdf/esx3_vlan_wp.pdf

0 Kudos
ccie4481
Contributor
Contributor

That doc is good, but they all show one vlan per virtual adapter...i need to know if there is a way around this limitation? Can i get more then 1 vlan on a virtual adapter?

example is Ethernet0/virtualadapter0 is part of/belongs to vlans 100 AND 101.

0 Kudos
Randy_B
Enthusiast
Enthusiast

So, I'm guessing here but it sounds like perhaps your appliance is handling the vlan tagging that the vSwitch usually would do via the port group vlan id entry. What if you create a port group and leave the vlan ID blank and use this for the NICs on your appliance this way letting the appliance do the vlan tagging?

Good luck,

Randy

0 Kudos
ccie4481
Contributor
Contributor

I tried that suggestion and it didnt solve my issue....my appliance receives tagged packets and reads them, its not sending tagged packets.....i need like a virtual trunk from the vswitch if that makes sense...

0 Kudos
mike_laspina
Champion
Champion

Hi,

They only way I can see this happening is by using VGT.

If traffic is going to the external switch then it must support 802.1q which almost all do.

If your appliance is using linux kernel 2.6.22 and up then the e1000 vNIC will handle 802.1q tags.

Your port group needs to be set up as vlan 4095.

You must load the 802.1q driver module

modprobe 8021q

You will need to configure the vlans on the e1000 aliases eth0 and eth1

e.g. add vlan tag 100 to eth0

vconfig add eth0 100

vconfig add eth1 101

Then you would bind the IP address

ifconfig -i eth0.100 10.1.1.1 broadcast 10.1.1.0 netmask 255.255.255.0 up

Thats your only chance that I can see.

http://blog.laspina.ca/ vExpert 2009
0 Kudos
ccie4481
Contributor
Contributor

Mike

Thanks that worked...the issue i now face, is that 4095 as the vlan on two NICs will trunk all vlans on both NICs, which creates a spanning tree loop...do you know is there a way to say trunk all vlans from vswitch one to e0 and all vlans from vswitch2 to e1??

Thanks

0 Kudos
mike_laspina
Champion
Champion

How have you configured the physical switch.

With 802.1q you really don't need to trunk the ESX physical connection ports.

You just need to add the tags to the participating switch port connections.

Make sure you set any teams to route by port ID

Nice to hear it works, I was only working by pure theory.

I don't have that method implemented any where yet.

http://blog.laspina.ca/ vExpert 2009
0 Kudos
ccie4481
Contributor
Contributor

The physical switch is trunking vlans 1-100 on Nic1s port, and 101-200 on Nic2s port...

Then in the virtual machine, e0 would get three vlans from Nic1 and e1 would get 2vlans from nic2....when you use the 4095 it sends all vlan group vlans to the NIC from what i can tell...so i would have all vlans going to e0 and e1....id like all vlans from vswitch1 (nic1) to go to e0 and all vlans from vswitch2(nic2) to go to e1...

0 Kudos
mike_laspina
Champion
Champion

Well thats not going to work because 100 and 101 come from the same mac and are on different ports of two ISL trunks and will loop. It is a cisco switch isn't it?

I think you will need to setup the physical switch trunking as 802.1ad static mode with vlans 1-200 on the trunk group.

http://blog.laspina.ca/ vExpert 2009
0 Kudos
ccie4481
Contributor
Contributor

Mike

Im doing vlan pruning on the trunk...so physical NIC 1 goes to port 1 on the catalyst switch, which only allows vlans 1-100 and is on ESX vswitch1. Physical NIC 2 goes to port 2 on the catalyst switch which only allows vlans 101-200 ESX vswitch2. So there wont be a loop since im statically configuring my trunks. But the desired affect i need is to say 4095 port group on e0 of my virtual an trunk all vlans from vswitch 1, then do a 4095 port group on e1 an trunk all vlans from vswitch2

Thanks

0 Kudos
mike_laspina
Champion
Champion

I didn't think you could prune vlan 1

Are you using it.

I would normally remove it from the picture.

http://blog.laspina.ca/ vExpert 2009
0 Kudos
ccie4481
Contributor
Contributor

Yes if you change the native vlan of the trunk to someting other then 1 and only allow say 2-10 on the trunk, then youll never see vlan 1

0 Kudos