Skip to content

Instantly share code, notes, and snippets.

@veysby
Last active December 10, 2015 16:33
Show Gist options
  • Save veysby/15f813a3b91d8ab801a2 to your computer and use it in GitHub Desktop.
Save veysby/15f813a3b91d8ab801a2 to your computer and use it in GitHub Desktop.
Vagrant: 3 machines in private network
Vagrant.configure("2") do |config|
config.vm.define "lb" do |lb|
lb.vm.box = "centos65"
lb.vm.host_name = "lb"
lb.vm.network "private_network", ip: "192.168.0.20"
lb.vm.network :forwarded_port, guest: 22, host: 2220, id: "ssh", auto_correct: true
lb.vm.network :forwarded_port, guest: 80, host: 9099, id: "web", auto_correct: true
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "512"]
end
end
config.vm.define "i1" do |i1|
i1.vm.box = "centos65"
i1.vm.host_name = "i1"
i1.vm.network "private_network", ip: "192.168.0.21"
i1.vm.network :forwarded_port, guest: 22, host: 2221, id: "ssh", auto_correct: true
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
end
end
config.vm.define "i2" do |i2|
i2.vm.box = "centos65"
i2.vm.host_name = "i2"
i2.vm.network "private_network", ip: "192.168.0.22"
i2.vm.network :forwarded_port, guest: 22, host: 2222, id: "ssh", auto_correct: true
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--memory", "1024"]
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment