What's the right way to configure multiple network interfaces with Vagrant? Here's the simple Vagrant file I'm testing with:
.
Vagrant.configure("2") do |config|
config.vm.provider :virtualbox do |vb|
# vb.gui = true
vb.memory = 512
vb.cpus = 1
end
config.vm.define "consumer" do |c|
c.vm.box = "vagrant-centos6.2-x64"
c.vm.network :private_network, ip: "192.168.100.12"
c.vm.network :private_network, ip: "172.16.100.12"
c.vm.hostname = "consumer.XXXXXX.XXX"
end
end
.
This behaves inconsistently. The 2 private_network interfaces always come up as eth1 and eth2 with distinct MAC's but sometimes both interfaces are assigned the same IP, sometimes neither is assigned an IP address, and sometimes it works correctly.
I'm using CentOS 6 on both the desktop and virtual image and VirtualBox 4.1. Is there a better way to accomplish this? Thanks!