Vagrant: how to configure multiple NICs within a Vagrantfile?

Using Vagrant 1.6.1 and private networking with Virtualbox you can create multiple private ips just by repeating the config.vm.network definition:

# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
  config.vm.box = "precise64"

  config.vm.network "private_network", ip: "192.168.50.4"
  config.vm.network "private_network", ip: "192.168.50.5"
  config.vm.network "private_network", ip: "192.168.50.6"
  config.vm.network "private_network", ip: "192.168.50.7"

end

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)