Tuesday, August 11, 2015

VirtualBox Arista Emulation - when 4 ports are not enough

So, I was messing around with the 3 switch virtual model and found that the 4 network interfaces in Virtual Box really was insufficient to show off a spine and leaf architecture.

I've done a little research and came around to utilizing the 4 hidden NICs in VirtualBox in order to build out a 3 leaf architecture virtually.

Thanks to eanderalx.org for the tip...https://www.eanderalx.org/virtualization/8_network_card_vbox


Figure 1.  Spine and Leaf Architecture

The Architecture really needs to look like the figure above.  In order to do this, the Spine switches will have to have 7 total network interfaces, 1 management and 6 switch uplinks.

From the eanderalx documentation linked above, I created the table (as per the previous abusedbits blog 3 switch creation).

VM Adapter Network Type Net Name Description IP Address
Spine1 Adapter 1 Host-Only vboxnet0 Management Net 10.10.10.21/24
Adapter 2 Internal Network L1-1 to Leaf 1 sw01
Adapter 3 Internal Network L2-1 to Leaf 1 sw02
Adapter 4 Internal Network L3-1 to Leaf 2 sw03
Adapter 5 Internal Network L4-1 to Leaf 2 sw04
Adapter 6 Internal Network L5-1 to Leaf 3 sw05
Adapter 7 Internal Network L6-1 to Leaf 3 sw06
Adapter 8
Spine2 Adapter 1 Host-Only vboxnet0 Management Net 10.10.10.22/24
Adapter 2 Internal Network L1-2 to Leaf 1 sw01
Adapter 3 Internal Network L2-2 to Leaf 1 sw02
Adapter 4 Internal Network L3-2 to Leaf 2 sw03
Adapter 5 Internal Network L4-2 to Leaf 2 sw04
Adapter 6 Internal Network L5-2 to Leaf 3 sw05
Adapter 7 Internal Network L6-2 to Leaf 3 sw06
Adapter 8
Leaf 1 sw01 Adapter 1 Host-Only vboxnet0 Management Net 10.10.10.31/24
Adapter 2 Internal Network L1-1 to Spine1 Eth 1
Adapter 3 Internal Network L1-2 to Spine2 Eth 1
Adapter 4 Internal Network L1-L2 to Leaf 1 sw02
Leaf 1 sw02 Adapter 1 Host-Only vboxnet0 Management Net 10.10.10.32/24
Adapter 2 Internal Network L2-1 to Spine1 Eth 2
Adapter 3 Internal Network L2-2 to Spine2 Eth 2
Adapter 4 Internal Network L1-L2 to Leaf 1 sw01
Leaf 2 sw03 Adapter 1 Host-Only vboxnet0 Management Net 10.10.10.33/24
Adapter 2 Internal Network L3-1 to Spine1 Eth 3
Adapter 3 Internal Network L3-2 to Spine2 Eth 3
Adapter 4 Internal Network L3-L4 to Leaf 2 sw04
Leaf 2 sw04 Adapter 1 Host-Only vboxnet0 Management Net 10.10.10.34/24
Adapter 2 Internal Network L4-1 to Spine1 Eth 4
Adapter 3 Internal Network L4-2 to Spine2 Eth 4
Adapter 4 Internal Network L3-L4 to Leaf 2 sw03
Leaf 3 sw05 Adapter 1 Host-Only vboxnet0 Management Net 10.10.10.35/24
Adapter 2 Internal Network L5-1 to Spine1 Eth 5
Adapter 3 Internal Network L5-2 to Spine2 Eth 5
Adapter 4 Internal Network L5-L6 to Leaf 3 sw06
Leaf 3 sw06 Adapter 1 Host-Only vboxnet0 Management Net 10.10.10.36/24
Adapter 2 Internal Network L6-1 to Spine1 Eth 6
Adapter 3 Internal Network L6-2 to Spine2 Eth 6
Adapter 4 Internal Network L5-L6 to Leaf 3 sw03






Table 1.  Layout of interfaces

As a note, I'm retaining the VM's created for the purpose of the previous blog exercise, and using the 10.10.10.10 linux server host as the jump box for the environment.

In order to get the 8 switches, I simply re-cloned 8 switches from the original switch from the Arista virtual lab (previous blog).

The table above leads to the following configurations for VBoxManage to get to the associated network interfaces enabled on the Spine switches.  You could do the same for the 1-4 interfaces, but I chose to use the GUI (mostly because I was experimenting).

Spine1 - nic5 config

$VBoxManage modifyvm vEOS-spine1 --nic5 intnet

$VBoxManage modifyvm vEOS-spine1 --intnet5 "L4-1"

$VBoxManage modifyvm vEOS-spine1 --nicpromisc5 allow-vms

$VBoxManage modifyvm vEOS-spine1 --nictype5 Am79C973

$VBoxManage modifyvm vEOS-spine1 --cableconnected5 on

Spine1 - nic6

$VBoxManage modifyvm vEOS-spine1 --nic6 intnet

$VBoxManage modifyvm vEOS-spine1 --intnet6 "L5-1"

$VBoxManage modifyvm vEOS-spine1 --nicpromisc6 allow-vms

$VBoxManage modifyvm vEOS-spine1 --nictype6 Am79C973

$VBoxManage modifyvm vEOS-spine1 --cableconnected6 on

Spine1 - nic7

$VBoxManage modifyvm vEOS-spine1 --nic7 intnet

$VBoxManage modifyvm vEOS-spine1 --intnet7 "L6-1"

$VBoxManage modifyvm vEOS-spine1 --nicpromisc7 allow-vms

$VBoxManage modifyvm vEOS-spine1 --nictype7 Am79C973


$VBoxManage modifyvm vEOS-spine1 --cableconnected7 on

Spine2 - nic5

$VBoxManage modifyvm vEOS-spine2 --nic5 intnet

$VBoxManage modifyvm vEOS-spine2 --intnet5 "L4-2"

$VBoxManage modifyvm vEOS-spine2 --nicpromisc5 allow-vms

$VBoxManage modifyvm vEOS-spine2 --nictype5 Am79C973

$VBoxManage modifyvm vEOS-spine2 --cableconnected5 on

Spine2 - nic6

$VBoxManage modifyvm vEOS-spine2 --nic6 intnet

$VBoxManage modifyvm vEOS-spine2 --intnet6 "L5-2"

$VBoxManage modifyvm vEOS-spine2 --nicpromisc6 allow-vms

$VBoxManage modifyvm vEOS-spine2 --nictype6 Am79C973

$VBoxManage modifyvm vEOS-spine2 --cableconnected6 on

Spine2 - nic7

$VBoxManage modifyvm vEOS-spine2 --nic7 intnet

$VBoxManage modifyvm vEOS-spine2 --intnet7 "L6-2"

$VBoxManage modifyvm vEOS-spine2 --nicpromisc7 allow-vms

$VBoxManage modifyvm vEOS-spine2 --nictype7 Am79C973

$VBoxManage modifyvm vEOS-spine2 --cableconnected7 on

Once completed, I followed the remaining instructions from 

https://eos.arista.com/building-a-virtual-lab-with-arista-veos-and-virtualbox/

using 8 switches instead of 3 and the table and NIC scripts from above.

Picture 1.  Arista Spine and Leaf in Virtual existence on VirtualBox

This is running with a fair penalty on the memory of the box though.  Mem watch shown below....  But it does work.....

$  watch -n 5 free -m

Every 5.0s: free -m                                     Tue Aug 11 15:07:51 2015

             total       used       free     shared    buffers     cached

Mem:         32038      31735        302        401        157      13337
-/+ buffers/cache:      18240      13797
Swap:        32627          0      32627

Good luck fellow bit abusers!



No comments:

Post a Comment