Appearance
SONiC VS on GNS3
Prepare SONiC Image and sonic GNS3 appliance file
Build SONiC VS
bash
git clone https://github.com/Azure/sonic-buildimage.git
cd sonic-buildimage.git
make init
make configure PLATFORM=vs
make target/sonic-vs.img.gzAfter build, the zipped vs image will under target directory.
Prepare VS disk image and gns3 appliance file.
extract the zipped vs image "sonic-vs.img.gz" to "sonic-vs.img" and keep original file.
bash
gzip -dc sonic-vs.img.gz > sonic-vs.imgThe gns3 appliance generate script is under platform/vs, copy it to target and change mode to excutable
bash
cp ../platform/vs/sonic-gns3a.sh .
chmod +x sonic-gns3a.shRun script to create gns3 appliance file
Usage:
bash
sonic-gns3a.sh [ -r <ReleaseNumber> ] -b <SONiC VS image: sonic-vs.image>Example:
bash
sonic-gns3a.sh -r 1.1 -b <store_path>/sonic-vs.imagebash
./sonic-gns3a.sh -r 1.1 -b sonic-vs.imgWhen done, a appliance file will be generated. ex: "SONiC-1.1.gns3a"
GNS3
Install GNS3

Here we run a GNS3 server on remote.
Connect to Remote Server
Run the GNS3
When first run the GNS3, it will ask how the gns3 server be running. Since we are run gns3 on a remote VM, here we pick "Run on a remote server"

- Fill with the server information.

- After setting, reopen GNS3
Import sonic appliance
Prepare the gns3 appliance file and vs image on same directory.
Run the GNS3 and click New template to create a new appliance

- Here we will use generated gns3a file, so select "Import an appliance file"

- Select the vs gns3a file from file dialog.

- Just click Next to start install the appliance

- Select the qemu binary to run this appliance.

- GNS3 will find the related fils, if all found, click Next to install.


- Chack the usage message.

- After installed, the SONiC 1.1 will appear on GNS3 list.

Create simple topology with sonic vs
Put appliance
Use mouse drag to put appliance to topology.

Connecting the link
- Click the "Add link" on toolbar

- Click on node, and pick the interface


Start all nodes


Login in to sonic

Show Interface Status

Show LLDP Neighbor

Connect to real word
The "Cloud" will bridge to a real interface The "NAT" will bridge to a private network which provide by gns3

Add link to cloud, and select the interface wich you want to bridge on.

Now the sonic can mgmt port can get IP from real world and can be access.

Add Ubuntu Applience
The gns3 can support difference type applience like docker or qemu.
Here I will run ubuntu on docker.
Download the Ubuntu docker applience link.
Install the appliance same as sonic vs.

Now we have a virtual lab for testing.
Sniffer the packet on link
Right-click on a link, and select "Start capture"

Check the file name which packet trace will save to.

The packet will shows on wireshark.

Let the project can keep running after exit.
File->"Edit project"

Select "Start the capture visualization program"

Change Image
Need extend the VM memory. (default is 2G)
sonic-installer install [image file or URL]


After done, need reboot the system.
The new installed image will shows on GRUB menu
