Installing Arista vEOS in VirtualBox and GNS3

Something that I have been looking for, for a while, has been a nice software switch that I can use that support not just switching but VLANs as well. Yes, there is Open vSwitch, but I was looking for something more traditional, if that’s the right way to say it. I heard about Arista’s vEOS switch a while back, but back then you could only download it if you were already an Arista customer. But recently I ran across another great blog post at Radovan Brezula’s blog again that shows how to setup Arista’s vEOS and that’s when I found out that I could download vEOS to try without being an already Arista customer. I swear, this guy likes playing with virtual networking as much as I do.

So below I’ll walk through my steps for setting up vEOS in VirtualBox and then putting it into GNS3 to do some basic VLAN tests.

1. Download vEOS from https://www.arista.com/en/support/software-download . You will need to create an account.
Aboot-veos-serial-2.1.0.iso
vEOS-4.14.2F.vmdk

2. Create a base vEOS VM in VirtualBox

  • General:
    • Name: base-vEOS
    • Type: Linux
    • Version: Other Linux (64bit)
  • System:
    • Memory: 1024MB
    • CPU: 1
  • Hard Drive:
    • IDE Controller
      • HD: Use downloaded vmdk
      • CD: Use downloaded iso
  • Network:
    • Enable all 4 adapters and set the ‘Adapter Type’ to ‘PCNet-FAST III’
  • Audio:
    • Off
  • Serial Ports:
    • Enable Serial Port 1
    • Port Number: COM1
    • Port Mode: Disconnected

3. Boot it up.
The boot is a little slow to start the first time. Just wait a minute or so. When it finishes and you have the Login: prompt and you can login with ‘admin’ with no password.

Now that we have vEOS able to boot up into VirtualBox, lets add it into GNS3 for testing,

4. Make two vEOS VMs for use in GNS3

  • Make sure the base-vEOS is shutdown and remove the Aboot-veos-serial-2.1.0.iso from the CD. I had issues cloning while the CD was still attached.
  • My test is going to use two switches, so I cloned(linked clone) base-vEOS two times. vEOS-1 and vEOS-2.
  • Add Aboot-veos-serial-2.1.0.iso back in to each cloned VM.

5. Add to GNS3
Add both new vEOS clones to GNS3 VirtualBox list following
GNS3->Edit->Preferences->VirtualBox->VirtualBox VMs->New

6. After adding both VMs, choose the each VM one at a time in the VM list in the preferences and click on the Edit button to set the following.

  • General settings:
    • Start VM in headless mode
  • Network:
    • Adapters: 4 (Adapter0 will be used for the Management1 interface. So when you set the number of adapter you need, add one extra.)
    • Start at: 0
    • Type: ‘PCNet-FAST III’

7. Add both switches to the GNS3 canvas along with four VPCS.
Create links between them
PC1 — vEOS-1 e2
PC2 — vEOS-1 e3
PC3 — vEOS-2 e2
PC4 — vEOS-2 e3
vEOS-2 e1 — vEOS-1 e1

vEOS-GNS3

8. Startup and configure

Now start up all the VPCS and vEOS switches.  After they start up, configure the switches to have a trunk between them and set the interfaces to the VPCS to be access.  To test VLANs, I’ll put PC1 and PC3 in one VLAN and I’ll put PC2 and PC4 in another.
vEOS-1:

hostname vEOS-1
enable secret arista
username admin secret arista
!
vlan 10
exit
vlan 20
exit
!
interface Ethernet1
switchport mode trunk
switchport trunk allowed vlan 10,20
no shutdown
exit
!
interface Ethernet2
switchport mode access
switchport access vlan 10
no shutdown
exit
!
interface Ethernet3
switchport mode access
switchport access vlan 20
no shutdown
exit

vEOS-2:

hostname vEOS-2
enable secret arista
username admin secret arista
!
vlan 10
exit
vlan 20
exit
!
interface Ethernet1
switchport mode trunk
switchport trunk allowed vlan 10,20
no shutdown
exit
!
interface Ethernet2
switchport mode access
switchport access vlan 10
no shutdown
exit
!
interface Ethernet3
switchport mode access
switchport access vlan 20
no shutdown
exit

PC1:

ip 192.168.1.2 /24

PC3:

ip 192.168.1.3 /24

PC2:

ip 192.168.2.2 /24

PC4:

ip 192.168.2.3 /24

9. Test it out
PC1 ping PC3

PC1> ping 192.168.1.3
192.168.1.3 icmp_seq=1 ttl=64 time=59.008 ms
192.168.1.3 icmp_seq=2 ttl=64 time=26.003 ms
192.168.1.3 icmp_seq=3 ttl=64 time=28.504 ms
192.168.1.3 icmp_seq=4 ttl=64 time=27.003 ms
192.168.1.3 icmp_seq=5 ttl=64 time=26.504 ms

PC2 ping PC4

PC2> ping 192.168.2.3
192.168.2.3 icmp_seq=1 ttl=64 time=26.004 ms
192.168.2.3 icmp_seq=2 ttl=64 time=26.503 ms
192.168.2.3 icmp_seq=3 ttl=64 time=26.004 ms
192.168.2.3 icmp_seq=4 ttl=64 time=26.003 ms
192.168.2.3 icmp_seq=5 ttl=64 time=25.503 ms

Well, it works great and does what I need it to do for a special test I want to try out, which I hope to post within the next month.

Enjoy everyone and thanks again to Radovan Brezula.

This post ‘Installing Arista vEOS in VirtualBox and GNS3’ first appeared on https://techandtrains.com/.

Advertisement

Creating OpenVSwitch for GNS3

I’ve had some notes that I made about how to create an OpenVSwitch device for use within GNS3 on Windows.  Other platforms should be similar for these instructions.  So I thought I’d pass it along.

Prerequisites:

==================

Once you have the TAP driver installed, create a tap interface.

  •   Run the following as adminitrator
Start->All Programs->OpenVPN->Utilities
->Add a new TAP virtual ethernet adapter
  • In the Control Panel\Network and Internet\Network Connections, rename the new interface to ‘tap0’.

Tiny core howto
==================
Now that the software is ready, let’s create the OpenVSwitch device for GNS3.  To do this, we are going to create a very small Qemu VM that will be the OpenVSwitch device.  Open a command prompt window and ‘cd’ to the directory where we are going to create the VM.  Copy the TinyCore ISO file to that directory as well.  Then run the following commands to create the disk and start the VM installation.

"c:\Program Files\GNS3\qemu-img.exe" create -f qcow2 ./ovs171.img 200M
"c:\Program Files\GNS3\qemu.exe" -boot d -hda ovs171.img -cdrom .\CorePlus-current.iso -net nic -net tap,ifname=tap0

Install TinyCore into the VM

  • click on TC_Install
    • Start screen
      • Frugal
      • Whole Disk
      • choose sda
      • Install boot loader
      • Click Next arrow button
    • Formatting Options
      • choose default ext4
      • Next
    • Boot Options
      • nothing to choose
      • Next
    • Install Type
      • Core Only
      • Next
    • Review
      • Proceed
    • Done
      • Click the X to close the window
  • Shutdown the VM

Your initial TinyCore VM is now created, so let’s start it up.

"c:\Program Files\GNS3\qemu.exe" -boot c -hda ovs171.img -net nic -net tap,ifname=tap0

OpenVSwitch howto
==================

For the next part, I got several great tips from Brezular’s Technical Blog.

First, using the console window that is open lets’ install OpenSSH and OpenVSwitch packages.

tce-load -w -i openssh.tcz openvswitch.tcz

Start up the SSHd so we can use a remote login session to continue instead of trying to use the console.

sudo -s
cd /usr/local/etc/ssh

mv ssh_config.example ssh_config
mv sshd_config.example sshd_config
/usr/local/etc/init.d/openssh start

Remember to set a password for the ‘tc’ account.

passwd tc

Using the console is painful. Let’s login using SSH.

  • Run ‘ifconfig’ to see what IP you have.
  • SSH into your VM

Now that we are in, let’s initialize the ovsdb.

sudo ovsdb-tool create \
/usr/local/etc/openvswitch/conf.db \
/usr/local/etc/openvswitch/vswitchd/vswitch.ovsschema

The only parts remaining of the installation is the configuration of the tinycore startup and config.

Edit the bootlocal.sh for the service you want to start.

sudo vi /opt/bootlocal.sh

#!/bin/sh
# put other system startup commands here

/usr/local/etc/init.d/openssh start

modprobe openvswitch
modprobe 8021q
modprobe ipv6

ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock --remote=db:Open_vSwitch,manager_options --private-key=db:SSL,private_key --certificate=db:SSL,certificate --bootstrap-ca-cert=db:SSL,ca_cert --pidfile --detach

ovs-vsctl --no-wait init

ovs-vswitchd --pidfile --detach

sysctl -w net.ipv4.ip_forward=1
sysctl -w net.ipv6.conf.all.forwarding=1

 

Edit the .filetool.lst to let tinycore know what directories to preserve changes after a reboot.

sudo vi /opt/.filetool.lst

opt
home
etc/passwd
etc/shadow
usr/local/etc/ssh
usr/local/etc/openvswitch

Commit any file system changes to CORE.

/usr/bin/filetool.sh -b
sudo reboot

You now have a base OVS install where the drive is only about 27MB is sise. From here you can add you VM to the QEMU Guest list.
GNS3->Edit->Preferences->Qemu->Qemu Guest

Adding the Qemu Guest into a topology will start it with 6 ethernet interfaces. In GNS3, I connected eth0 to my local network and kept eth1-eth5 for OVS. When first creating the Qemu Guest in the preferences, this is when you specify how many interface it will have. Going forward, my host PC IP is 192.168.10.235.

Once you add the VM into the GNS3 canvas, start it up and login to it. Configure the OVS with the 5 interfaces.

sudo ovs-vsctl add-br br0
sudo ovs-vsctl add-port br0 eth1
sudo ovs-vsctl add-port br0 eth2
sudo ovs-vsctl add-port br0 eth3
sudo ovs-vsctl add-port br0 eth4
sudo ovs-vsctl add-port br0 eth5
/usr/bin/filetool.sh -b

If you want to use an SDN controller, you can use the following to configure the switch’s controller location.

sudo ovs-vsctl set-controller br0 \
    tcp:192.168.10.235:6633
/usr/bin/filetool.sh -b

Now, the OVS should look something like this.

tc@box:~$ sudo ovs-vsctl show
370eda01-cfdc-4d3e-a160-ef5381409bd1
    Bridge "br0"
        Controller "tcp:192.168.10.235:6633"
        Port "eth1"
            Interface "eth1"
        Port "eth2"
            Interface "eth2"
        Port "eth3"
            Interface "eth3"
        Port "eth5"
            Interface "eth5"
        Port "eth4"
            Interface "eth4"
        Port "br0"
            Interface "br0"
                type: internal

There you go. You have an OpenVSwitch running in your GNS3 that you can mix in with your topology.

As an added bonus. If you want OpenVSwitch to talk to an sFlow client on your PC, just run something like this.

sudo ovs-vsctl -- --id=@s create sFlow \
    agent=eth0 target=\"192.168.10.235:6343\" header=128 \
    sampling=64 polling=10 -- set Bridge br0 sflow=@s
/usr/bin/filetool.sh -b

And for a NetFlow client on your PC.

sudo ovs-vsctl -- set Bridge br0 \
    netflow=@nf -- --id=@nf create NetFlow \
    targets=\"192.168.10.235:2055\" active-timeout=60
/usr/bin/filetool.sh -b