How to Install and License Cisco IOU l2 IOU l3 images on GNS3

If you are a gns3 user desirous of running complex labs, one of the devices you would love to have is the Cisco IOU L2 that allows you simulate the Cisco switch on gns3. While it is relatively easy to download the image and import it to gns3, bringing it up is not quite easy as you will be required to generate its license key before it can work.

In this post, I will share four easy steps to generate and install the Cisco IOU L2 keygen license for use in gns3. I am assuming that your gns3 is installed and linked to the gns3 VMware and that your Cisco IOU L2 image has been download and successfully imported into the Cisco IOU L2 appliance.

At this point, an attempt to run the appliance without the license key, you will get an error that says “Could not find an iourc file (IOU license), please configure an IOU license” To get rid of this error, follow the steps below.

Generate the Cisco IOU L2 keygen

Step1: Ssh to the IP address of your gns3vm using putty or any other terminal emulation software. Username and password are gns3. Hit the enter key a couple of time and using the down arrow key, navigate to the shell option and hit the enter key.

Step2: Copy and paste the command below into the terminal and hit the enter key:


Be careful not to copy the quotation signs.

Step3: Use the list command to verify that a directory called has been created. Type “ls” to verify. You will see this file:

gns3@gns3vm:~$ ls  GNS3

Step5: Run this command: ‘Python3‘ to generate the desired licence ‘iourc.txt

gns3@gns3vm:~$ python3
Cisco IOU License Generator - Kal 2011, python port of 2006 C version
hostid=00000000, hostname=gns3vm, ioukey=25e

Add the following text to ~/.iourc:
gns3vm = 73635fd3b0a13ad0;

Already copy to the file iourc.txt

You can disable the phone home feature with something like:
 echo '' >> /etc/hosts

Step5: Finally, enter the command “cat iourc.txt” to display the license key.

gns3@gns3vm:~$ ls  GNS3  iourc.txt
gns3@gns3vm:~$ cat iourc.txt
gns3vm = 73635fd3b0a13ad0;

Copy the displayed key, go to gns3, click on the edit tab, click on preference, navigate to IOS on Unix and paste the license obtained, click apply and OK. Now you can power on your IOU L2 devices for use in gns3.

If you enjoyed this tutorial, please share with your friends and colleagues!

If you encounter problems like :

root@gns3-iouvm:/home/gns3/GNS3/images# python3


Cisco IOU License Generator – Kal 2011, python port of 2006 C version

Modified to work with python3 by c_d 2014

hostid=a8c00701, hostname=gns3-iouvm, ioukey=a8c00ad9

Traceback (most recent call last):

  File “”, line 21, in <module>

    md5input=iouPad1 + iouPad2 + struct.pack(‘!i’, ioukey) + iouPad1

struct.error: argument out of range



Then find the line by connecting to ‘’ file

md5input=iouPad1 + iouPad2 + struct.pack(‘!i’, ioukey) + iouPad1

Replace with it as;

md5input=iouPad1 + iouPad2 + struct.pack(‘!L’, ioukey) + iouPad1

for more information, feel free to contact me via [email protected]

Be the first to comment

Leave a Reply

Your email address will not be published.