<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">David,<div><br></div><div>The problem is caused by an internal limitation of our switching code. It maintains several tables with MAC addresses used for “routing” unicast packets to proper destination. Our network devices never notify the switch about MAC address change. In fact, the devices barely aware of such changes themselves, although, at least virtio device is handling the case correctly, by storing the address in PCI configuration space and using it for filtering unicast packets. We are working on resolving this issue, but there is no ETA for it. Sorry for inconveniences.</div><div><br></div><div>Best regards,</div><div>Aleksey</div><div><br></div><div><div><div>On 19 Aug 2016, at 23:53, David Garrod <<a href="mailto:dgarrod@extremenetworks.com">dgarrod@extremenetworks.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div lang="EN-US" link="blue" vlink="purple" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><div class="WordSection1"><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;">I am running two Ubuntu Linux Guests on a Windows 7 Host.<br><br>I've set up Internal Networking between them. This all works fine if I let VirtualBox pick and use the MACs on the virtual interfaces.<br><br>But in my case my Linux Guests set the Hardware MAC address on the virtual interfaces.<br><br>The first Linux Guest (call it A) has the NIC configured as follows:<br><br>NIC 2: MAC: 080027823BE6, Attachment: Internal Network 'intnet1', Cable connected: on, Trace: on (file: foobar.pcap<br>), Type: virtio, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: allow-all, Bandwidth group: none<br><br>The second Linux Guest (call it B) has the NIC configured as follows:<br><br>NIC 2: MAC: 0800278B0F78, Attachment: Internal Network 'intnet1', Cable connected: on, Trace: on (<br>p), Type: virtio, Reported speed: 0 Mbps, Boot priority: 0, Promisc Policy: allow-all, Bandwidth group: none<br><br>In other words I'm using "virtio" and I've configured the promiscuous policy to "Allow All". (Allow VMs doesn't work either).<br><br>I set up IP addresses in this interface (it's called "eth1" in each of the Linux systems). As I said for reasons that I don't have to go into here the Linux system wants to set its own MAC on the interface. So for purposes of this discussion call it MACA on system A and MACB on system B.</span></div><p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;"> </span></p><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;">This is done from my Linux guest system using the ioctl() SIOCSIFHWADDR. Specifically:</span></div><p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;"> </span></p><p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;"> </span></p><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;">    if (ioctl(sock, SIOCSIFHWADDR, &ifr) < 0) {</span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;">        VLOG_ERR("netdev_set_macaddr (%s) MAC (%s) ioctl failed '%s'\n",</span></div><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;">                  intf, macaddr, strerror(errno));</span></div><p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;"> </span></p><p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;"> </span></p><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;">What I’m finding is that once this is done indeed the guest is now sending packets with an SRCMAC of the specified MAC</span></div><p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;"> </span></p><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;">If I now ping from system A to system B here is what happens.<br><br>System A sends a Broadcast ARP to resolve the MAC address for B. This packet is received by system B and of course a UNICAST reply is sent back with the resolution for MAC B.<br><br>System B then sends a unicast ARP packet (source MACB dest MACA) asking for the resolution of systemA's MAC.<br><br>The pcap trace file I've put on System B's NIC (foobar2.pcap) shows all of these packets. But the pcap trace file on system A (foobar.pcap) only shows the original ARP broadcast packet from system A to system B. It does NOT show either of the Unicast replies. So of course they don't make it into the System A Libux system and hence the ping doesn't work.<br><br>This is the behavior I'd expect had I not set promiscuous mode on the virtual NICs inside VirtualBox. But I have set promiscuous mode and I cannot understand why it is not working.<br><br>Various web searches led me to one post that said that PROMISC mode in VirtualBox has no effect unless the guest has set the interface into promiscuous mode. Indeed I found this to be true. Once I set promiscuous mode on the guest the Unicast packets got through.</span></div><p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;"> </span></p><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;">But this isn’t really the essence of my question. I would have expected that setting the MAC address from the guest would CHANGEW the MAC address inside VirtualBox. It appears that it doesn’t. Using VBoxManage shows that VirtualBox still thinks that the MAC is the original MAC that was set by VirtualBox. This is no doubt the reason why Unicast packets with a MACDA of MACA are not delivered to guest system A. Inside VirtualBox it no doubt still considers the MAC to address to be the original MAC address.</span></div><p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;"> </span></p><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;">What I’ve also found is weird is that if I “reboot” the guest by typing reboot the guest comes up thinking the MAC is MACA, i.e. the MAC that got set on the last run NOT the MAC that VirtualBox has internally. If instead I power off the guest or do a shutdown when it comes up again it comes up with a MAC of theMAC that VirtyalBox says it has.</span></div><p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;"> </span></p><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;">This says to me that VirtualBox is keeping the programmed MAC inside its simulated PCI through a guest reboot but that when the guest is powered off or shutdown this simulated PCI is also getting reset.</span></div><p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;"> </span></p><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;">But in NEITHER case is VirtualBox truly using the programmed MAC. I’m trying to understand if this is the desired behaviour for VirtualBox and if so why. Why can’t I program the MAC and have it used? If I could I’d expect I wouldn’t even need to set Promiscuous Mode inside VirtualBox.</span></div><p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;"> </span></p><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;">I’ve tried looking at the code but got rather lost. The best I can come up with is that programming of the virtual hardware in the host is not being read by the host driver inside VirtualBox when the guest programs the MAC value.</span></div><p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;"> </span></p><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;">Any comments would be most appreciated.</span></div><p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;"> </span></p><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;">Thanks,</span></div><p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;"> </span></p><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;">Dave</span></div><p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;"> </span></p><div style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;">PS I put an earlier version of this question in one of the forums.<span class="Apple-converted-space"> </span><a href="https://forums.virtualbox.org/viewtopic.php?f=6&t=79239" style="color: purple; text-decoration: underline;">https://forums.virtualbox.org/viewtopic.php?f=6&t=79239</a>, but I didn’t get any replies hence the real question here.</span></div><p class="MsoNormal" style="margin: 0in 0in 0.0001pt; font-size: 11pt; font-family: Calibri, sans-serif;"><span lang="EN-GB" style="font-size: 7.5pt;"> </span></p></div><br><hr><font face="Arial" color="Gray" size="2"><br>DISCLAIMER:<br>This e-mail and any attachments to it may contain confidential and proprietary material and is solely for the use of the intended recipient. Any review, use, disclosure, distribution or copying of this transmittal is prohibited except by or on behalf of the intended recipient. If you have received this transmittal in error, please notify the sender and destroy this e-mail and any attachments and all copies, whether electronic or printed.<br></font>_______________________________________________<br>vbox-dev mailing list<br><a href="mailto:vbox-dev@virtualbox.org" style="color: purple; text-decoration: underline;">vbox-dev@virtualbox.org</a><br><a href="https://www.virtualbox.org/mailman/listinfo/vbox-dev" style="color: purple; text-decoration: underline;">https://www.virtualbox.org/mailman/listinfo/vbox-dev</a></div></blockquote></div><br></div></body></html>