How to create a new GNS3 appliance template to work with SONiC using Linux shell?

Are you excited about enhancing your GNS3 network testing capabilities with SONiC but concerned it might be too complex? No need to worry! 😊

GNS3 doesn't come pre-configured with SONiC, but we'll guide you through a straightforward method to set it up. This guide simplifies the process into easy-to-follow steps that anyone can follow. We'll provide you with all the necessary resources to take your network tests to the next level 😎. In this article, you'll learn how to create a new SONiC appliance for GNS3 using a shell script on Ubuntu and how to add a template in Web version of GNS3 and Desktop version of GNS3.

So, are you prepared to embark on this journey with us? We'll seamlessly integrate SONiC into your GNS3 environment – it's a breeze! πŸš€πŸ˜‰

Keep in mind that there are various ways to add SONiC images to GNS3, and we're presenting one of them.

Prerequisites

  • A functional GNS3 Server -> Link to the article where it's all explained

  • Access to the requisite SONiC image.

  • A fundamental understanding of networking concepts and familiarity with GNS3 operations.

  • Ubuntu client

Step 1. Download the ready SONiC appliance

1. Download the shell script from the link below.

https://github.com/sonic-net/sonic-buildimage/blob/master/platform/vs/sonic-gns3a.sh

1.png

Now save the file on your PC. I created a new directory for this operation, so my file will be downloaded to :

C:\COMMUNITY_SONIC

Also you'll need the SONiC image. Put the image in the same directory as shell script you just downloaded. 

2.png

2. Run the shell script, in this case I'm using the WSL2 Ubuntu 22.04. To create an appliance with the downloaded shell script, enter the directory where you have the SONiC VS image and the downloaded shell script. The command is right below:

./sonic-gns3a.sh -r Community -b sonic-vs.img

3.png

With -you are naming the appliance that you'll create.

With -you are choosing which image to use to create an appliance.

Step 2. Adding new device with appliance.

1. Enter GNS3, select the File button in the top-left corner of the GNS3, and select the Import appliance button from the drop-down list. Select the .gns3a file that you created earlier.

4.png

5.png

2.Select Install the appliance on the main server button, and click Next

6.png

3. Change Qemu binary to:

/bin/qemu-system-x86_64

And select Next

7.png

4. In the next window you will see your .img image that is applied to your .gns3a file. Select Next.

8.png

5. In the final window there is information about the category. Select Finish and there will be a window about the successfully created appliance.

9.png

Congratulations!

You have successfully created a SONiC template in GNS3. Now you can utilize SONiC in your GNS3 network simulations.

Happy Networking !!! πŸ˜‰

Adding new device with appliance using web version of GNS3.

So, we learned how to add a new appliance in the downloaded GNS3. In this step, you'll learn how to add a new appliance in the web version of GNS3. First, you need to enter the address of your web version of GNS3.

1. Enter an existing project, if you don't have any click Add blank project.

10.png

2. Select the + icon and from the drop-down table select the New Template option.

11.png

3. Select Import an appliance file and click Next

12.png

4. Select the .gns3a file that you created using the Linux shell and click the Open button.

13.png

5. Change Qemu binary to:

/bin/qemu-system-x86_64

And select Create

14.png

15.png

Congratulations!

You have successfully created a SONiC template in GNS3. Now you can utilize SONiC in your GNS3 network simulations.

Happy Networking !!! πŸ˜‰

If you're looking for more GNS3 tutorials and resources, you can explore the following articles:

How to create a new GNS3 appliance template to work with SONiC using GNS3 Desktop Client?

How to set up GNS3 server on VirtualBox?

How to create a new GNS3 appliance template to work with SONiC using GNS3 Web UI?

Was this article helpful?
0 out of 0 found this helpful

Articles in this section