I have a Vagrantfile which starts up 3 vms. I need two of the VM's to not have any internet access, yet they should be on the same network as the 3rd vm which does have internet.
Desired state:
vm1 => NAT & 192.168.45.11
vm2 => 192.168.45.12
vm3 => 192.168.45.13
# -*- mode: ruby -*-
# vi: set ft=ruby :
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "Debian-7-2"
config.vm.box_url= "https://dl.dropboxusercontent.com/u/197673519/debian-7.2.0.box"
config.vm.synced_folder ".", "/vagrant_data"
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "512"]
end
config.vm.define "r", primary: true do |router|
router.vm.box = "Debian-7-2"
config.vm.network :private_network, ip: "192.168.45.11"
end
config.vm.define "r1" do |roomate1|
roomate1.vm.box = "Debian-7-2"
config.vm.network :private_network, ip: "192.168.45.12"
end
config.vm.define "r2" do |roomate2|
roomate2.vm.box = "Debian-7-2"
config.vm.network :private_network, ip: "192.168.45.13"
end
end
What I find is that even though I configured vm2 and vm3 to have only 1 network interface, they boot up with 2 network interfaces. (host-only & NAT). I don't want the NAT interface.
How would you configure vagrant to start a VM without nat, thus denying internet access to the VM?