Page 1 of 1

Wrong host MAC address on guest bridge mode

Posted: 5. Oct 2020, 16:04
by alphanet
Hello,

I am using VirtualBox 6.1.12 on Debian GNU/Linux buster, and I installed a buster VM. In NAT networking mode, everything works like it should.

I just tried bridge mode, and funny things are happening (I bridged to a WiFi interface to a WPA2 Enterprise AP, logged on the host side, but not on the guest side).

1) v4 gets no address (obviously, I am not authenticated to the AP with the guest's MAC), that's normal

2) v6 gets an address and works ?!?

Observing the external wifi interface on the Linux host, I see that v6 traffic from the GUEST mostly uses the *HOST* MAC address. However, v4 and some of the v6 traffic (namely multicast group management and NDP) seem to use the guest MAC address.

This is bizarre. I started to look at the Linux side of things because on Microsoft Windows, in bridge mode of a WiFi adapter, v4 does not work, and v6 also works, I guess for the same reasons, but I did not debug more in depth on that proprietary platform.

Any idea why this is happening ?

All the details:

The host shows the MAC address for the guest v6 and for DHCP v4 (which is not answered, maybe because already HAS an address) is the one of the HOST.

The only cases where the GUEST MAC is seen is for v6 multicast group management and NDP:

and for v4 ARP requests (manual config for IP): (correct guest MAC)

15:46:41.069276 08:00:27:ad:a7:15 > ff:ff:ff:ff:ff:ff, ethertype ARP (0x0806), length 42: Ethernet (len 6), IPv4 (len 4), Request who-has 1.2.3.1 tell 1.2.3.4, length 28

and DHCP v4 queries:

15:47:42.804944 08:00:27:ad:a7:15 > ff:ff:ff:ff:ff:ff, ethertype IPv4 (0x0800), length 342: (tos 0x10, ttl 128, id 0, offset 0, flags [none], proto UDP (17), length 328)
0.0.0.0.68 > 255.255.255.255.67: BOOTP/DHCP, Request from 08:00:27:ad:a7:15, length 300, xid 0x78539403, Flags [Broadcast]
Client-Ethernet-Address 08:00:27:ad:a7:15
Vendor-rfc1048 Extensions
Magic Cookie 0x63825363
DHCP-Message Option 53, length 1: Discover
Hostname Option 12, length 6: "debian"
Parameter-Request Option 55, length 13:
Subnet-Mask, BR, Time-Zone, Default-Gateway
Domain-Name, Domain-Name-Server, Option 119, Hostname
Netbios-Name-Server, Netbios-Scope, MTU, Classless-Static-Route
NTP

In details:

- host with WiFi MAC ac:81:12:79:58:56 associated/authenticated to an AP, v6 and v4 traffic works (v4: 157.26.104.39, v6: 2001:620:417:20f1:82c4:dd36:57c6:5a74)

- guest in VirtualBox, in BRIDGE mode, MAC address is 08:00:27:ad:a7:15; no v4 address is obtained by DHCPv4 (that would be logical since no wpa_supplicant was configured on that separate MAC address), however he got a working v6 address 2001:620:417:20f1:bb1f:d0b3:6d2b:55c1

Excerpt from tcpdump on the HOST wifi interface: this is v6 traffic from the guest with the HOST MAC!
15:41:01.097342 ac:81:12:79:58:56 > 00:05:73:a0:00:3e, ethertype IPv6 (0x86dd), length 86: (flowlabel 0x2b37d, hlim 64, next-header TCP (6) payload length: 32) 2001:620:417:20f1:bb1f:d0b3:6d2b:55c1.47424 > 2001:620:0:ff::5c.80: Flags [.], cksum 0xaa8a (correct), ack 1, win 507, options [nop,nop,TS val 3360151750 ecr 4120471346], length 0

That's not the guest MAC address, however that's the guest's v6 address, so that's why it works through WPA2.

Funny.

Re: Wrong host MAC address on guest bridge mode

Posted: 5. Oct 2020, 16:14
by scottgus1
Bridged does not always work on Wi-F, see Virtualbox Networks: In Pictures: Bridged Adapter

Re: Wrong host MAC address on guest bridge mode

Posted: 5. Oct 2020, 19:30
by fth0
Regarding IPv4 using the host's MAC address, see the 2nd text box in 6.5. Bridged Networking.

Re: Wrong host MAC address on guest bridge mode

Posted: 7. Oct 2020, 16:35
by alphanet
fth0 wrote:Regarding IPv4 using the host's MAC address, see the 2nd text box in 6.5. Bridged Networking.
Yes, that's something. Except v4 is done with the guest's MAC address, and v6 with the host's MAC address.

And v4 doesn't work (probably WPA MAC different), and v6 works (WPA MAC the same as authenticated by the host).

I would have expected either both to use the guest's MAC, or both to use the host's MAC, but not this mixed setup.