Page 1 of 1

No networking after spoofing mac address

Posted: 20. May 2014, 16:53
by TKreu
Hi,

I wasn't sure where to put this - i seems to be a rather general problem concerning networking with a linux guest on a windows host - so there are several possible boards. Sorry if I picked the wrong one.

Whenever I change the MAC address of my (Debian) Linux guest (Tiny Core Linux behaves the same way) with ifconfig, I cannot get networking back up / can no longer communicate with the host or other vms on the same host-only network. This does not occur if the MAC is spoofed at boot time (by editing /etc/network/interfaces).

The card with the fake physical address pulls a new ip address from DHCP just fine, but is not able to talk to anyone. Unfortunately, the project i'm working on requires a rather dynamic approach, which is why i don't want to "hardcode" my spoofed addresses into the interfaces-file nor use virtualbox to change the "real" mac address of the virtual nic.

I'm strongly suspecting myself of forgetting something, but for now I just can't wrap my head around this.

Thanks for any replys!

Re: No networking after spoofing mac address

Posted: 20. May 2014, 16:57
by mpack
What do you mean by "spoofing" a MAC address? The VM is already using a spoofed MAC address (*), why do you need to do it twice?

(*) That's assuming you're using bridged networking. If you're using NAT networking then the VM isn't actually using the external network at all, so any MAC address it uses is pretty much irrelevant.

I'm not Linux expert, but it's my understanding that Linux guests will not like you changing the MAC address. They'll regard it is a new card requiring a new config. The card will be given a new device ID (e.g. "eth(n+1)" ).

Re: No networking after spoofing mac address

Posted: 20. May 2014, 17:12
by TKreu
I'm using host-only networking. I do not spoof it for any networking purposes, I'm tricking a software component, which is using the mac address to make decisions on certain things. Think of those ancient copy protection methods binding software to the "unchangable" mac address to get the idea. Whether this is a stupid thing to do or not is off-limits for me in this case.

I would need a ton of vms for testing different scenarios if I couldn't chance the mac address on the fly. Which totally works like a charm, by the way, It only kills my network in the process.

Re: No networking after spoofing mac address

Posted: 20. May 2014, 17:18
by mpack
The first question remains: the VM is already using a spoofed MAC address which has nothing to do with any physical hardware on your host, so I don't see what you're trying to accomplish by changing it?

Also, we might be getting into dangerous territory: I can't help you defeat the license protection mechanism of a piece of software.

Re: No networking after spoofing mac address

Posted: 20. May 2014, 19:22
by TKreu
mpack wrote:I don't see what you're trying to accomplish by changing it?
I am accomplishing (please note: not "trying to", because this part works perfectly) to be able to load different testing environments by issueing a handful of shell commands as opposed to rebooting everytime and/or using a whole lot of vms/snapshots which only differ in mac address and a few files.

It really doesn't matter that much, I only brought it up because you asked.
I can't help you defeat the license protection mechanism of a piece of software.
As someone who makes a living out of copy protected software, I really appreciate that.

What I was hoping you or somebody else maybe could help me with, is the situation described in my original post:

I have a linux guest with host-only networking set up, the system gets an ip address from virtualbox' built-in dhcp server and can communicate with host and other vms fine.

When I set the guest's network adapter to a fake mac address in /etc/network/interfaces and boot it, it gets a (new) ip address from built-in dhcp and can communicate with host and other vms just fine.

When i just reload the network service (no reboot) or use shell commands dhclient and ifconfig to release ip, take adapter down, change mac address and bring adapter up again, it will get a new ip address, but will be unable to speak to other machines