Home > Computers > VMware Server 2.0 and Vlans…

VMware Server 2.0 and Vlans…

September 1st, 2009 bdk Leave a comment Go to comments

One of the steps I needed to take to virtualize servers was to setup vlan trunking between a Linux server and my switch and then have VMware Server bridge to those vlan interfaces.

Here are the steps involved:

Problem 1. Vlans and linux.

Install vconfig
aptitude install vlan

Configure /etc/network/interfaces

auto eth0
allow-hotplug eth0

# VLAN for 100 network
auto eth0.100
iface eth0.100 inet static
address 192.168.100.2
netmask 255.255.255.0
gateway 192.168.100.1
vlan_raw_device eth0

# VLAN for 200 network
auto eth0.200
iface eth0.200 inet static
address 192.168..200.1
netmask 255.255.255.0
vlan_raw_device eth0

Reload your networks and check that you now have 2 sub-interfaces. Since I'm not using a native vlan, there is no reason to assign an ip address to the physical interface:

root@host:# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0f:20:aa:aa:aa
inet6 addr: fe80::20f:20ff:feaa:aaa/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:94315 errors:0 dropped:0 overruns:0 frame:0
TX packets:68513 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:44509389 (42.4 MiB) TX bytes:27319149 (26.0 MiB)
Interrupt:11 Base address:0x2000
.
eth0.100 Link encap:Ethernet HWaddr 00:0f:20:aa:aa:aa
inet addr:192.168.100.2 Bcast:192.168.100.255 Mask:255.255.255.0
inet6 addr: fe80::20f:20ff:feaa:aaaa/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:82619 errors:0 dropped:0 overruns:0 frame:0
TX packets:64849 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:39601713 (37.7 MiB) TX bytes:26639719 (25.4 MiB)
.
eth0.200 Link encap:Ethernet HWaddr 00:0f:20:aa:aa:aa
inet addr:192.168.200.1 Bcast:192.168.200.255 Mask:255.255.255.0
inet6 addr: fe80::20f:20ff:feaa:aaaa/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:11181 errors:0 dropped:0 overruns:0 frame:0
TX packets:3658 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3544253 (3.3 MiB) TX bytes:678962 (663.0 KiB)

Now try and ping devices on those respective vlans from your host OS. Also the default route is currently setup to vlan100, so any traffic not destined for vlan100 or vlan200 will be routed to 192.168.100.1.

Now came the hard part. After hours of trouble shooting I discovered that traffic coming into a VMware server’s bridged interface gets discarded if it is bigger then 1500 bytes. It appears that VMware is able to grab those frames before the dot1q tagging gets removed, see that they are bigger then 1500 bytes and promptly discards them.

Solution: Edit vmwre’s source code to allow 1504 byte frames. It appears that this was an issue back in 2006 as well per a thread on VMware’s forums. As of VMware Server 2.0.1-156745, the problem still exists though the code to edit is now on line 969.

Quoting from the post -

unpack /usr/lib/vmware/modules/source/vmnet.tar to a working directory
in vmnet-only edit bridge.c
on line 969 change line:

if (bridge->dev->hard_header_len != ETH_HLEN) {

to:

if (bridge->dev->hard_header_len != ETH_HLEN && bridge->dev->hard_header_len != ETH_HLEN +4) {

save, pack vmnet-only to vmnet.tar and put back in /usr/lib/vmware/modules/source
re-run vmware-config.pl to rebuild the kernel modules.

When you rerun vmware-config.pl, tell it that you want to edit your network settings and create new vmnets and bridge them to your new sub-interfaces. You may want to remove bridging from your physical interface if you are no longer using it.

All of this will work assuming you have a switch capable of supporting 802.1q trunking.

Categories: Computers Tags: , , ,
  1. February 11th, 2011 at 06:00 | #1

    Hello dear, as a rule I never post comments on personal blogs however now I am afraid I must do it. Recently I wanted to install the newer version of the Firefox browser and your Internet blog doesn’t load properly ever since. Right now your footer overlaps part of the text and I am unable read it. I had the same problem with my herbal incense reviews site and I was able to fix it by changing the PHP code. Can you fix it? Thank you! Please excuse my crappy English, it’s not my mother language as you can see. I am French

  2. October 20th, 2014 at 02:52 | #2

    Every weekend i used to visit this web page, because i want enjoyment, for the reason that this
    this web site conations really fastidious funny stuff
    too.

  1. No trackbacks yet.