Create a folder to contain the Vagrant environment, then change directories into that folder.
local@host:~$ mkdir vagrant local@host:~$ cd vagrant
Initialize the Vagrant environment to create a file called Vagrantfile in the folder you just created.
local@host:~/vagrant$ vagrant init A `Vagrantfile` has been placed in this directory. You are now ready to `vagrant up` your first virtual environment! Please read the comments in the Vagrantfile as well as documentation on `vagrantup.com` for more information on using Vagrant.
Edit the Vagrantfile. Add the following section under Vagrant.configure("2") do |config| to create leaf01, leaf02 and spine01, and the network connections between them.
local@host:~/vagrant$ vi Vagrantfile
Vagrant.configure("2") do |config|
config.vm.define "leaf01" do |leaf01|
leaf01.vm.box = "CumulusCommunity/cumulus-vx"
# Internal network for swp* interfaces.
leaf01.vm.network "private_network", virtualbox__intnet: "intnet-1", auto_config: false
leaf01.vm.network "private_network", virtualbox__intnet: "intnet-3", auto_config: false
leaf01.vm.network "private_network", virtualbox__intnet: "intnet-4", auto_config: false
leaf01.vm.provider "virtualbox" do |vbox|
vbox.customize ['modifyvm', :id, '--nicpromisc2', 'allow-vms']
vbox.customize ['modifyvm', :id, '--nicpromisc3', 'allow-vms']
vbox.customize ['modifyvm', :id, '--nicpromisc4', 'allow-vms']
end
end
config.vm.define "leaf02" do |leaf02|
leaf02.vm.box = "CumulusCommunity/cumulus-vx"
# Internal network for swp* interfaces.
leaf02.vm.network "private_network", virtualbox__intnet: "intnet-2", auto_config: false
leaf02.vm.network "private_network", virtualbox__intnet: "intnet-3", auto_config: false
leaf02.vm.network "private_network", virtualbox__intnet: "intnet-4", auto_config: false
leaf02.vm.provider "virtualbox" do |vbox|
vbox.customize ['modifyvm', :id, '--nicpromisc2', 'allow-vms']
vbox.customize ['modifyvm', :id, '--nicpromisc3', 'allow-vms']
vbox.customize ['modifyvm', :id, '--nicpromisc4', 'allow-vms']
end
end
config.vm.define "spine01" do |spine01|
spine01.vm.box = "CumulusCommunity/cumulus-vx"
# Internal network for swp* interfaces.
spine01.vm.network "private_network", virtualbox__intnet: "intnet-1", auto_config: false
spine01.vm.network "private_network", virtualbox__intnet: "intnet-2", auto_config: false
spine01.vm.provider "virtualbox" do |vbox|
vbox.customize ['modifyvm', :id, '--nicpromisc2', 'allow-vms']
vbox.customize ['modifyvm', :id, '--nicpromisc3', 'allow-vms']
end
end
endRun vagrant up to start the VMs:
local@host:~/vagrant$ vagrant up Bringing machine 'leaf01' up with 'virtualbox' provider... Bringing machine 'leaf02' up with 'virtualbox' provider... Bringing machine 'spine01' up with 'virtualbox' provider... ...