Setting up the lab¶
We’ll set up a lab using VirtualBox and Vagrant, with a virtual Arista device, and get some sample files for the following steps.
Working directory¶
Create a directory for your files anywhere on your machine.
Arista vEOS¶
The Arista EOS image can be downloaded for free from the Arista site.
Create an account at https://www.arista.com/en/user-registration, and go to https://www.arista.com/en/support/software-download.
Download the latest “vEOS-lab-<version>-virtualbox.box” listed in the vEOS folder at the bottom of the page.
Add it to your vagrant box list, changing the <version>:
$ vagrant box add --name vEOS-lab-<version>-virtualbox ~/Downloads/vEOS-lab-<version>-virtualbox.box
$ vagrant box list
vEOS-lab-quickstart (virtualbox, 0)
You can delete the downloaded .box file once you have added it, as vagrant box add
copies downloaded file to a designated directory (e.g., for Mac OS X and Linux: ~/.vagrant.d/boxes
, Windows: C:/Users/USERNAME/.vagrant.d/boxes
).
Starting Vagrant¶
Create a file named Vagrantfile
(no file extension) in your working directory with the following content (replace VEOS_BOX by your downloaded EOS version):
# Vagrantfile for the quickstart tutorial
# Script configuration:
#
# Arista vEOS box.
# Please change this to match your installed version
# (use `vagrant box list` to see what you have installed).
VEOS_BOX = "vEOS-lab-4.15.5M-virtualbox"
Vagrant.configure(2) do |config|
config.vm.define "base" do |base|
# This box will be downloaded and added automatically if you don't
# have it already.
base.vm.box = "hashicorp/precise64"
base.vm.network :forwarded_port, guest: 22, host: 12200, id: 'ssh'
base.vm.network "private_network", virtualbox__intnet: "link_1", ip: "10.0.1.100"
base.vm.network "private_network", virtualbox__intnet: "link_2", ip: "10.0.2.100"
base.vm.provision "shell", inline: "apt-get update; apt-get install lldpd -y"
end
config.vm.define "eos" do |eos|
eos.vm.box = VEOS_BOX
eos.vm.network :forwarded_port, guest: 22, host: 12201, id: 'ssh'
eos.vm.network :forwarded_port, guest: 443, host: 12443, id: 'https'
eos.vm.network "private_network", virtualbox__intnet: "link_1", ip: "169.254.1.11", auto_config: false
eos.vm.network "private_network", virtualbox__intnet: "link_2", ip: "169.254.1.11", auto_config: false
end
end
The above content is also available on GitHub.
This Vagrantfile creates a base box and a vEOS box when you call vagrant up
:
$ vagrant up --provider virtualbox
... [output omitted] ...
$ vagrant status
Current machine states:
base running (virtualbox)
eos running (virtualbox)
You may see some errors when the eos box is getting created [1].
Troubleshooting¶
After running
vagrant up
, ensure that you can ssh to the box withvagrant ssh eos
.If you receive the warning “eos: Warning: Remote connection disconnect. Retrying…”, see this StackOverflow post.
Sample files¶
There are some sample Arista vEOS configuration files on GitHub. You can download them to your machine by copying them from GitHub, or using the commands below:
$ for f in new_good.conf merge_good.conf merge_typo.conf; do
$ wget https://raw.githubusercontent.com/napalm-automation/napalm/master/docs/tutorials/sample_configs/$f
$ done
(Note: please open a GitHub issue if these URLs are invalid.)