Hi everybody,
I have been searching for a solution for this matter for a while now and count not get any definitive answer.
I need to test some code that depends on MAC addresses. So I need to create a stream of requests with new MAC addresses each.
The problem is that I do not know how to tell the host system (an Ubuntu 14.04) that my guest system (also Ubuntu 14.04) has a new MAC address during runtime.
I am using bridged networking with the Intel PRO/1000 card.
I know how to change MAC while the guest is off, but I need to do it during runtime.
When tracing the packets, I can see them coming from the guest with the new MAC address, reaching the destination, coming back to the host and then are probably silently dropped, because they never reach the guest.
I am guessing that the virtual network driver on the host does not know that the guest changed the MAC address and so the packet with the new MAC address does not belong to any known virtual network card.
Is there a way to update the MAC address information on the host? I used to do this with VMware and it worked out of the box. Is there some way to also do this with VirtualBox?
.David
Changing MAC address during runtime
Re: Changing MAC address during runtime
Code: Select all
# ifconfig eth0 down
# ifconfig eth0 hw ether NEWMACADDRESSHERE
# ifconfig eth0 up-
David (Garderos)
- Posts: 2
- Joined: 18. Jun 2015, 08:59
Re: Changing MAC address during runtime
Thank you RaMp6,
I knew this part. But my problem did lie elsewhere. Once I changed the MAC address, no more packets would arrive at my guest.
Just now I found the solution by sheer luck. I was actually trying to prepare some logs for this post with tcpdump when I all of a sudden got all the packets coming to my guest like I wanted. So I stopped cpdump - and so did the packets.
So that was my answer, tcpdump always sets the interface to promiscuous mode:
From here on out it worked. I am guessing it is some kind of security feature or something that changed inside the default kernel/network settings to prevent MAC spoofing. I have no time right now to further investigate. I have my solution.
Thank you for listening.
.David
I knew this part. But my problem did lie elsewhere. Once I changed the MAC address, no more packets would arrive at my guest.
RaMp6 wrote:Code: Select all
# ifconfig eth0 down # ifconfig eth0 hw ether NEWMACADDRESSHERE # ifconfig eth0 up
Just now I found the solution by sheer luck. I was actually trying to prepare some logs for this post with tcpdump when I all of a sudden got all the packets coming to my guest like I wanted. So I stopped cpdump - and so did the packets.
So that was my answer, tcpdump always sets the interface to promiscuous mode:
Code: Select all
# sudo ifconfig eth1 promisc
Thank you for listening.
.David