Allow two or more mobile virtual machines to communicate on their own network

I want to create multiple servers that can communicate directly without using public IP They still need internet access, but nothing outside the network needs to be connected to them Creating a box usually works, but when I add other servers, the network fails

MacOS:10.8. five Virtual@R_676_2419 @:4.3. 12 guestos: Ubuntu "precise64" uses version 2 vagrant configuration

Most of the time, if I use a private network, I get:

saltminion01: Warning: Connection timeout. retrying...
saltminion01: Warning: Connection timeout. retrying...
saltminion01: Warning: Connection timeout. retrying...
saltminion01: Warning: Connection timeout. retrying...
saltminion01: Warning: Connection timeout. retrying...
saltminion01: Warning: Connection timeout. retrying...
saltminion01: Warning: Connection timeout. retrying...
saltminion01: Warning: Connection timeout. retrying...
saltminion01: Warning: Connection timeout. retrying...

Does anyone have a sample vagrantfile to do this?

Solution

The following is an example of creating two virtual machines:

> alpha 10.0. 0.10 > beta 10.0. zero point one one

From inside the virtual machine, you can reach another through IP address and 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.@R_676_2419@ = "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.@R_676_2419@ = "hashicorp/precise64"
    beta.vm.network :private_network,ip: "10.0.0.11"
    beta.vm.hostname = "beta"
  end
end
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>