Page 1 of 1

Virtualbox, IPv6 + bridged Wireless (WiFi)

Posted: 24. Jun 2011, 09:53
by jsburwell
Hi,

The documentation says that IPv6 won't work from a guest OS from a bridged wireless interface from a Linux or Mac based host OS. Is this also true for Windows 7 64-bit?

I'm running VirtualBox on a Win 7 64-bit host. I have a Linux guest OS running with an interface bridged to the wireless interface of the Windows 7 host. I'm using a virtio type interface and drivers under the guest OS.

IPv4 works just fine, but IPv6 doesn't work. It configures an address via SLAAC just fine, but I can't ping6 anything but the host OS's own IPv6 address.

Is this a bug (or lack of feature) in the bridged networking driver, or is it some issue with Wifi itself? I haven't tried it on a wired interface yet, but I presume it works on that.

At first I thought the problem was failing neighbor discovery, but even if I manually add neighbor table entries for various IPv6 hosts on the LAN, I still can't ping6 them.

The only layer 2 difference between an IPv6 packet and an IPv4 packet should be the ethertype (0x86DD for IPv6 vs. 0x0800 for IPv4). Maybe the driver simply isn't passing this ethertype through?

Thanks,
Jim

Re: Virtualbox, IPv6 + bridged Wireless (WiFi)

Posted: 25. Jun 2011, 12:26
by Sasquatch
As you say, it doesn't specify Windows Host for this. But, if the wireless interface doesn't work well with bridged, and VB uses it's fallback option, then it makes sense that IPv6 doesn't work. Since IPv6 uses auto-discover and auto-configure based on part of the interface MAC address, this can prevent proper configuration on the Guest when in bridged fallback method. This method means that VB will identify the Guest using the Host's MAC address to get network access, instead of using the Guest's own MAC address. Since the Host has an IPv6 address based on it's MAC, the Guest won't configure itself with that same IP to avoid conflicts.
Have you tried assigning a static IPv6 address? I've never heard of requiring to configure the neighbour discovery on any OS other than the one providing the subnet and responds to auto-configure requests. And even there it's only configured to broadcast the subnet and routing information. Not much else to configure. IPv6 configures itself.

Re: Virtualbox, IPv6 + bridged Wireless (WiFi)

Posted: 27. Jul 2011, 01:52
by tjmerritt
Sasquatch wrote:As you say, it doesn't specify Windows Host for this. But, if the wireless interface doesn't work well with bridged, and VB uses it's fallback option, then it makes sense that IPv6 doesn't work. Since IPv6 uses auto-discover and auto-configure based on part of the interface MAC address, this can prevent proper configuration on the Guest when in bridged fallback method. This method means that VB will identify the Guest using the Host's MAC address to get network access, instead of using the Guest's own MAC address. Since the Host has an IPv6 address based on it's MAC, the Guest won't configure itself with that same IP to avoid conflicts.
I don't think that this is actually a problem. The guest will get its MAC from the virtual interface. And that interface specific guest MAC address will be used for autoconfiguration. The correct auto configured address is getting set in the guest OS and the packet makes it into the air with the correct IPv6 address. The problem is that the MAC address in the ethernet header get rewritten to the host wireless interface MAC address, and the neighbor announcement gets sent back not to the guest interface specific MAC address but to the host's wireless MAC address. VB picks up the packet and then should rewrite the correct guest iface MAC into the packet based upon the IPv6 address of the destination. VB doesn't do this yet, because the code hasn't yet been written to do this.
Have you tried assigning a static IPv6 address? I've never heard of requiring to configure the neighbour discovery on any OS other than the one providing the subnet and responds to auto-configure requests. And even there it's only configured to broadcast the subnet and routing information. Not much else to configure. IPv6 configures itself.
Indeed it does, and this works just fine. The problem is that VB does switching based upon IP address for wireless rather than the more normal switching based upon MAC address. The code for doing the switching for IPv6 has yet to be written.

I'm more than willing to help write it, but I don't have experience developing VirtualBox and don't currently have a way to build and test VB on my laptop.

Re: Virtualbox, IPv6 + bridged Wireless (WiFi)

Posted: 4. Apr 2013, 01:23
by simon_vetter
Old thread, but the issue is still present in 4.2.10.

I can confirm that it is not windows-specific and that some code has to be added for this to work.
I actually wrote a patch implementing the feature, it is attached to ticket #5503. It works as expected on Mac OSX, but the code is not OS-specific and should work on any platform.

It will hopefully make its way into the main distribution when reviewed by the vbox development team. In the meantime, your only option is to patch the source and compile it yourself.

Re: Virtualbox, IPv6 + bridged Wireless (WiFi)

Posted: 28. Mar 2015, 01:48
by fileinster
REALLY old post now, I know, but I'm still suffering this using 4.3.26

I found a workaround that works for me as I didn't want to compile the source, but seems to be persistent for the session only; I can cron it, though. I would be interested to hear how portable this workaround is. Try this bash script:

Code: Select all

#!/bin/bash

NET=$(ip -6 route|egrep "^[23]"|cut -d':' -f1-4)
EUI=$(ip -6 route|egrep "^default.*metric 1 "|cut -d':' -f3-6|cut -d' ' -f1)

ping6 $NET:$EUI -B -c 1 > /dev/null 2>&1

if [ $? -eq 0 ]; then
    echo OK
else
    echo FAIL
fi
Explanation:
First get the global address of the local router by looking in the routing table to grab the prefix and the host component of the EUI-64 router. It does rely on having the router configured to use EUI-64 to generate a host address. I haven't figured out how to find the router's address if not using EUI-64... yet.
We then ping the router address using the -B option to ensure we use our global address.
Everything else is just good housekeeping.