Skip to content

Instantly share code, notes, and snippets.

@0xquad
Last active December 20, 2023 23:07
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 0xquad/6090af4fe2c5b5fc6299 to your computer and use it in GitHub Desktop.
Save 0xquad/6090af4fe2c5b5fc6299 to your computer and use it in GitHub Desktop.
Fixing VirtualBox IPv6 connectivity on bridged wireless adapter (issue 5503)

Fixing VirtualBox IPv6 connectivity on bridged wireless adapter

VirtualBox has a long standing issue about IPv6 connectivity over a bridged wireless adapter.

The current and easiest workaround I've found is to remove the neighbor entry corresponding to the IPv6 router in the neighbor table. This is on in Linux guest on a Windows host.

$ ping6 icanhazip.com
PING icanhazip.com(2606:4700::6812:7361) 56 data bytes
^C
--- icanhazip.com ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 0ms
rtt min/avg/max/mdev = 0.000/0.000/0.000/0.000 ms
$ ip -6 neigh
2001:db8:1::1 dev enp0s3 lladdr 00:11:95:ad:be:ef router STALE
2001:db8:1:211:95ff:dead:beef dev enp0s3  FAILED
fe80::211:95ff:dead:beef dev enp0s3  router FAILED
$ sudo ip -6 neigh del fe80::211:95ff:dead:beef dev enp0s3
$ ping6 -c 3 icanhazip.com
PING icanhazip.com(2606:4700::6812:7361) 56 data bytes
64 bytes from 2606:4700::6812:7361: icmp_seq=1 ttl=51 time=202 ms
64 bytes from 2606:4700::6812:7361: icmp_seq=2 ttl=51 time=213 ms
64 bytes from 2606:4700::6812:7361: icmp_seq=3 ttl=51 time=118 ms

--- icanhazip.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2004ms
rtt min/avg/max/mdev = 118.575/178.169/213.682/42.400 ms

The neighbor entry will become STALE again after every 30 seconds and will eventually expire and won't work anymore after some time. An option is to create a cron job that runs every 2 minutes and deletes the table entry.

*/2 * * * *    ip -6 neigh | while read line; do set -- $line; ip neigh del $1 dev $3; done; ping6 -n -c 2 $ipv6_gw &>/dev/null

where $ipv6_gw is the address of the local IPv6 gateway to the Internet.

@treysis
Copy link

treysis commented Sep 5, 2019

Is this on the host or on the guest? The command "ip -6 neigh del fe80::211:95ff:dead:beef" doesn't seem to work on the guest. It gives an error: "Device and destination are required arguments." If you add "dev " it does work, but IPv6 still doesn't work in Linux guest on Windows host.

@treysis
Copy link

treysis commented Mar 20, 2020

Weird thing: why is this workaround necessary? Why is it working with Windows 7 (didn't try 8.1 or 10) without problems?

@0xquad
Copy link
Author

0xquad commented Mar 20, 2020

Not sure. There has been many new versions of VBox since then, and I haven't tried to use v6 on the guest on a bridged adapter since then. I'd be curious to see how this works out nowadays. This was a Gentoo Linux guest on a Windows 10 host. With updates to Windows, the Linux kernel and VBox all in parallel since that time, I wonder if it's still an issue today.

@treysis
Copy link

treysis commented Mar 20, 2020

Yes, it is. Using Windows 10 host. Tried with VB 6.0 and 6.1. I think to remember that it worked for some time switching the network adapter from "Intel MT Desktop" to "Intel MT Server". But now also that doesn't work anymore. Your trick works, Windows 7 guests work out of the box. Linux Mint doesn't. I was more successful with another Linux distro (OpenMediaVault) where I had to add the global unicast IPv6 of the router as gateway in the routing table instead of the link-local address.

Copy link

ghost commented May 17, 2020

I've got the same issue with an OSX host with 2 x Win10 guest VMs.

Is there a Windows equivalent to run on the guests? @treysis how did you get it working?

@treysis
Copy link

treysis commented May 17, 2020

Windows guests never had a problem. I don't know of any equivalent command. I got it working by using ip -6 neigh del <addr> dev <dev>.

@treysis
Copy link

treysis commented Mar 6, 2021

Still an issue. Still this solution works. Don't know what Linux is doing here. Windows guests fine as always.

@0xquad
Copy link
Author

0xquad commented Jan 10, 2022

Original VBox ticket is now closed. However the issue (if it still exists) could still be related to https://www.virtualbox.org/ticket/14212.

Also, I'm not sure if this is related in any way, but if I start docker containers in the Linux VM (I'm now on a Win11 host), the containers can't reach the IPv6 internet, even though the same docker setup works on other non-VM Linux systems (globally routable IPv6 addresses; not using docker6-ipv6nat here and not in favor of using it). (Details: a Wireshark trace running on the Win11 host shows that Neighbor Discovery Solicitations are sent out, but ND Advertisements never reach the VM although I see them come in on the host.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment