Skip to content

Latest commit

 

History

History
87 lines (68 loc) · 4.57 KB

Testing.md

File metadata and controls

87 lines (68 loc) · 4.57 KB

General Information

Playing / Testing

Sonic Software images

There are two reliable places to find SoNiC software images:

Find additional information about image sources and procedure on how to find the SONiC image in the Azure pipeline artifacts here.

Sonic Software Switch (depreciated)

SoNiC wiki describes using the SoNiC P4 Software switch, don't bother to try, this functionality has been depreciated but the Docs still exist, see also #1618.

A virtual machine

Download a SONiC VS KVM image, e.g. from https://sonic.software/

DIR="$(mktemp -d /tmp/sonic.XXXXX)
cd $DIR
wget https://sonic.software/download-gns3a.sh
chmod +x download-gns3a.sh
./download-gns3a.sh master

qemu-system-x86_64 -machine q35 -m 4096 -smp 4 -hda sonic*.img \
-monitor telnet::45454,server,nowait \
-nographic -netdev user,id=sonic0,hostfwd=tcp::5555-:22 \
-device e1000,netdev=sonic0 -cpu host -accel kvm

# Password admin / YourPaSsWoRd
ssh admin@localhost -p 5555

# Control QEMU:
telnet localhost 45454

# Stop it the hard way
killall qemu-system-x86_64

Note: Find an extended tutorial of building a VM virtual lab using the SONiC VS KVM image here

A docker container

Download a SONiC VS docker image, e.g. from https://sonic.software/ Find the tutorials here or here to build lightweight testbed environment of SONiC using docker (not tested).

GNS3 Simulation environment

This section guides you to create and import a SONiC appliance into GNS3. Tutorial took inspiration from the following blog post (note that the blog post is outdated and refers to the depreciated SoNiC P4 Software switch image).

  • Install and launch GNS3
  • Download a VS SONiC image, refer to Sonic Software images
    • A convenient way how to download and extract the image and also create GNS3 appliance file is via the download script available at https://sonic.software/download-gns3a.sh
      wget https://sonic.software/download-gns3a.sh
      chmod +x download-gns3a.sh
      ./download-gns3a.sh <release number>  # master
    • The above will download the latest image for the giver release number and create a GNS3 appliance file named e.g. SONiC-master-656617.gns3a
      • Note that you may observe some issues with the stable SONiC VS builds:
        • 202405 release, e.g. #19399
        • 202311 release, e.g. #13317
        • Keep in mind that these and other issues may cause some unexpected behaviour of SONiC
  • From this point you can follow the instructions provided in https://pine-networks.com/blog/setting-up-sonic-on-gns3/.
    • Skip the initial instructions and start with the importing of appliance file you generated above e.g. SONiC-master-656617.gns3a
    • Once you import the SONiC image you can create a new project or open the existing one and start using the SONiC appliance in GNS3 by dragging the SONiC appliance into the main window of your GNS3 project