Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Is it possible to define multiple network interfaces for a box? #641
In the next version that will be coming out any day now (0.9.0), this is very easy:
config.vm.network :hostonly, "126.96.36.199" config.vm.network :bridged config.vm.network :hostonly, "188.8.131.52"
The above would create 3 network interfaces.
Note you can also specify specific adapters with
Again, reminder: 0.9.0 only.
Ah, yes, SCP is required because Vagrant actually has to do some file uploads in order to setup the network configuration. You can see where it used (in this example on Debian) here: https://github.com/mitchellh/vagrant/blob/master/lib/vagrant/guest/debian.rb#L35
@mitchellh I've tested, I added openssh-clients to my centos base box, but when I put this in the Vagrantfile:
config.vm.network :hostonly, "192.168.70.2", :adapter => 3
It fails :(
This is the output:
[fred@lefred percona-cluster]$ vagrant up percona1
/sbin/ifconfig eth1 down 2> /dev/null
on the virtualbox:
[vagrant@localhost ~]$ ifconfig -a
eth3 Link encap:Ethernet HWaddr 08:00:27:11:F1:F9
no idead why it's eth3 ;-) but it should work.
I even tried adding the :adapter in the Vagrantfile
Oh annoying. It looks like whatever guest OS you're using is recognizing that NIC as "eth3" while most I've tested have recognized them in order of being enabled (so even though it is adapter 3 it would be "eth1"). Vagrant has been programmed to expect the latter.
I may have to add another option for