I want to create multiple servers that can communicate directly with each other without using public IPs. They\'ll still need internet access but nothing from outside the networ
Here's an example which creates two VMs:
From inside either VM you can reach the other by IP address, and can connect to the outside world.
Vagrantfile:
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrant multi-machine sample setup
Vagrant.configure("2") do |config|
config.vm.define :alpha do |alpha|
alpha.vm.box = "hashicorp/precise64"
alpha.vm.network :private_network, ip: "10.0.0.10"
alpha.vm.hostname = "alpha"
end
config.vm.define :beta do |beta|
beta.vm.box = "hashicorp/precise64"
beta.vm.network :private_network, ip: "10.0.0.11"
beta.vm.hostname = "beta"
end
end