Using Vagrant, I am currently trying to set up a private_network interface on my ubuntu/precise32 box and configure this interface with a MAC address of "5C:A1:AB:1E:00:01". I have not seen an explicit example of this use anywhere as all of the examples use public network (bridged) interfaces. However the documentation shows that the :mac
option is available for private network interfaces. I have tried the following combinations so far:
Syntax v1
config.vm.network :hostonly, "192.168.33.10", :mac => "5CA1AB1E0001"
Syntax v2
config.vm.network "private_network", ip: "192.168.33.11", :mac => "5CA1AB1E0001"
config.vm.network :private_network, ip: "192.168.33.11", :mac => "5CA1AB1E0001"
All three of the above lines successfully passes the Vagrant ruby parser, however none of these lines successfully change the mac address of the network adapter.
A similar question was asked here and actually works, but I can only apply it to public network setups (as shown in the answer). Specifying "private_network" in place of public network successfully launched the VM, but fails to change the mac address of the private interface (eth1).
This was a bug in the VirtualBox provider for vagrant. See issue #3588 for details. The syntax described in the above question is correct as I have built vagrant from the gitub master branch and tested myself.
config.vm.network "private_network", ip: "192.168.33.11", :mac => "5CA1AB1E0001"