<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style>
<!--
@font-face
        {font-family:Wingdings}
@font-face
        {font-family:Wingdings}
@font-face
        {font-family:Calibri}
@font-face
        {font-family:Tahoma}
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri","sans-serif"}
h3
        {margin-right:0in;
        margin-left:0in;
        font-size:13.5pt;
        font-family:"Times New Roman","serif"}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:8.0pt;
        font-family:"Tahoma","sans-serif"}
span.EmailStyle17
        {font-family:"Calibri","sans-serif";
        color:windowtext}
span.Heading3Char
        {font-family:"Times New Roman","serif";
        font-weight:bold}
p.author, li.author, div.author
        {margin-right:0in;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman","serif"}
span.BalloonTextChar
        {font-family:"Tahoma","sans-serif"}
.MsoChpDefault
        {font-family:"Calibri","sans-serif"}
@page WordSection1
        {margin:1.0in 1.0in 1.0in 1.0in}
div.WordSection1
        {}
ol
        {margin-bottom:0in}
ul
        {margin-bottom:0in}
-->
</style>
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><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></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt"> </span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt">This is done from my Linux guest system using the ioctl() SIOCSIFHWADDR. Specifically:</span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt"> </span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt"> </span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt">    if (ioctl(sock, SIOCSIFHWADDR, &ifr) < 0) {</span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt">        VLOG_ERR("netdev_set_macaddr (%s) MAC (%s) ioctl failed '%s'\n",</span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt">                  intf, macaddr, strerror(errno));</span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt"> </span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt"> </span></p>
<p class="MsoNormal"><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></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt"> </span></p>
<p class="MsoNormal"><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></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt"> </span></p>
<p class="MsoNormal"><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></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt"> </span></p>
<p class="MsoNormal"><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></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt"> </span></p>
<p class="MsoNormal"><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></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt"> </span></p>
<p class="MsoNormal"><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></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt"> </span></p>
<p class="MsoNormal"><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></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt"> </span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt">Any comments would be most appreciated.</span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt"> </span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt">Thanks,</span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt"> </span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt">Dave</span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt"> </span></p>
<p class="MsoNormal"><span lang="EN-GB" style="font-size:7.5pt">PS I put an earlier version of this question in one of the forums.
<a href="https://forums.virtualbox.org/viewtopic.php?f=6&t=79239">https://forums.virtualbox.org/viewtopic.php?f=6&t=79239</a>, but I didn’t get any replies hence the real question here.</span></p>
<p class="MsoNormal"><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>
</body>
</html>