EVE-NG – adding a SONiC switch

The SONiC platfrom was revealed by Microsoft in 2016, offering an open-source containerised switch for cloud scale deployments. It is bulit onto of a Switch Abstraction Interface (SAI) which allows the OS to be run on a large number of vendor platforms, makoing it hardware agnostic.

Lets take a look at getting it running on EVE-NG. The latest successful build images for the various suported platforms can be foundn on the front page:

SONiC github front page

We are interteted in the VS (Virtual Switch) image:

SONiC build images

Check in the EVE-NG /opt/unetlab/html/templates/<cpu_vendor>/ directory for the SONiC switch templete, sonicsw.yml .

sonicsw template

As is the case with all other templetes, create a directory with the same name as the templete (soncisw) and then suffix it with a unique value. We will using the build version ‘sonicsw-202106‘. Copy the sonic-vs.img from the download and rename it ‘virtioa.qcow2‘ and place it in the newly created directory.

Initial Configuration

The SONiC virtual switch will load with the default Hardware SKU of ‘Force10-S6000’; a 32 port 10/40Gb TOR switch. This can be confirmed with the commands show platform summary and show interfaces status .

This default configuration also comes with some additional BGP and Layer3 interface configurations which are probably not required.

A new config can be created for the HwSKU using the sonic-cfggen command, in particular the preset parameter (t1,l2,empty,l1,l3). ‘t1’ is the default, with ‘l2’ or ‘l3’ being the most appropriate template depending on the topology. Pipe the output of the command to the candidate configuration file location (/etc/sonic/config_db.json) and then reload the config:

sudo cp /etc/sonic/config_db.json ~/OLD-config_db.json
sudo sonic-cfggen -H --preset l2 -k Force10-S6000 -p /usr/share/sonic/device/x86_64-kvm_x86_64-r0/Force10-S6000/port_config.ini > ~/tmp.json
sudo mv ~/tmp.json /etc/sonic/config_db.json
config reload -y

Once the switch has reloaded, lets configure an OOB management interface. By default no mamangement VRF exists, also upon creation Ethernet0 becomes bound to master interface ‘mgmt’ which belongs to the management VRF:

sudo config vrf add mgmt
sudo config save

We can then confirm the Layer 3 configuation for the OOB managment.

You can now connect the Ethernet0 interface to you cloud0 managment network in EVE-NG.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Blog at WordPress.com.

Up ↑

%d bloggers like this: