Created
December 10, 2019 07:22
-
-
Save wardenlym/d9c847dc1cab5063b935af00f8ec5d06 to your computer and use it in GitHub Desktop.
macvlan test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
config.vm.box = "ubuntu/bionic64" | |
config.vm.provider "virtualbox" do |vb| | |
vb.memory = "2048" | |
vb.customize ["modifyvm", :id, "--nicpromisc3", "allow-all"] | |
vb.customize ["modifyvm", :id, "--nicpromisc4", "allow-all"] | |
end | |
config.vm.provision "shell", inline: <<-SHELL | |
sudo apt-get update | |
sudo apt-get install -y git make | |
sudo apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo apt-key fingerprint 0EBFCD88 | |
sudo add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
sudo apt-get update | |
sudo apt-get install -y docker-ce | |
sudo usermod -aG docker vagrant | |
sudo swapoff -a | |
sudo modprobe macvlan | |
SHELL | |
config.vm.define "vm1" do |vm1| | |
vm1.vm.hostname = "vm1" | |
vm1.vm.network "public_network", bridge: "en0: Wi-Fi (AirPort)" | |
vm1.vm.network "private_network", ip: "192.168.100.11" | |
end | |
config.vm.define "vm2" do |vm2| | |
vm2.vm.hostname = "vm2" | |
vm2.vm.network "public_network", bridge: "en0: Wi-Fi (AirPort)" | |
vm2.vm.network "private_network", ip: "192.168.100.12" | |
vm2.vm.network "private_network", ip: "192.168.101.12" | |
end | |
config.vm.define "vm3" do |vm3| | |
vm3.vm.hostname = "vm3" | |
vm3.vm.network "public_network", bridge: "en0: Wi-Fi (AirPort)" | |
vm3.vm.network "private_network", ip: "192.168.101.13" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment