Page 1 of 1

vlan problem with vbox 3.2.6

Posted: 10. Jul 2010, 14:05
by mful
I want to set up a virtual machine that has an interface for network 192.168.90.0/24 and vlan interfaces for 192.168.92,94,98.0/24

I have tried this 2 ways:
* a vhost with interfaces bridged to host vlans. This works
* a guest with vlans attached to eth0 on the guest which in turn is bridged to eth0 on host. - this does not work

Unfortunately, method 1 is limited to the maximum adapters on a guest (currently 8 ).

To test the 1st method:
I configured eth0 on the host as 192.168.90.1, then added vlan92:eth0 (192.168.92.1)
I configured another pc with eth0 (192.168.90.10) and vlan92 (192.168/92.10)
I configured a managed switch with ports untagged on subnet 90 and tagged on subnet 92.
ie host -- switch -- pc

test results from host:
ping -c1 192.168.90.10 - success
ping -c1 192.168.92.10 - success

I created a guest with 2 adapters
#1 bridged to eth0
#2 bridged to vlan92

Started the guest and configured:
eth0 as 192.168.90.2
eth1 as 192.168.92.2

test results from guest:
ping -c1 192.90.1 - success
ping -c1 192.92.1 - success
ping -c1 192.90.10 - success
ping -c1 192.92.10 - success

I changed the pc to use dhcp and used wireshark on guest:vlan92 to see the dhcp requests. Success.

To test the 2nd method:
I configured eth0 on the host as 90.1 with no vlans.

test results from host:
ping -c1 192.90.10 - success
ping -c1 192.92.10 - fail (ok as packet has no vlan tag for 92)

I configured the guest with 1 adapter and bridged it to eth0
I configured the following devices on the guest:
eth0 (192.168.90.2)
vlan92:eth0 (192.168.92.2)

Test results from guest:
ping -c1 192.90.1 - success
ping -c1 192.92.1 - fail (ok it does not exist)
ping -c1 192.90.10 - success
ping -c1 192.92.10 - fail (why?)

I found the reason by running wireshark on the guest and looking at eth0. The packet arrives at eth0 with an 802.1q header (as it should).
I did the same on the host and found that the 802.1q header had been stripped off. The packet was then dropped by the switch as it did not have a vlan tag.

I found a recent article on the virtualbox forum http://forums.virtualbox.org/viewtopic.php?f=3&t=32453.
It was suggested that vlans on the guest should work fine.

If someone can point out my error(s), I would be grateful. Maybe, there is another way of making multiple (>8) vlans on a guest?

If there is no answer, then I trust others will find my results interesting.

ps I used dhcp for my test. If I only wanted dhcp requests to be answered, I could use dhcrelay. This post is addressing the problem of accessing many vlans on one guest, not dhcp.