Fixing IOU Keygen Error Running Cisco IOS on Linux in Eve-NG

If you keep getting this error when generating key as license for  running IOL or IOS On Linux, (also called IOU or IOS On Unix) in EVE-NG

darwin@eve-ng:/$ cd /opt/unetlab/addons/iol/bin

darwin@eve-ng:/opt/unetlab/addons/iol/bin$ python keygen.py
*********************************************************************
Cisco IOU License Generator – Kal 2011, python port of 2006 C version
hostid=bada0c0f, hostname=eve-ng, ioukey=bada0e51
Traceback (most recent call last):
File “./keygen.py”, line 18, in <module>
md5input=iouPad1 + iouPad2 + struct.pack(‘!i’, ioukey) + iouPad1
struct.error: ‘i’ format requires -2147483648 <= number <= 2147483647

Step 1:
Solution: Modify the python script, change i to L

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

Run again:

darwin@eve-ng:/opt/unetlab/addons/iol/bin$ python keygen.py
*********************************************************************
Cisco IOU License Generator – Kal 2011, python port of 2006 C version
hostid=bada0c0f, hostname=eve-ng, ioukey=bada0e51
Step 2: Add the following text to ~/.iourc:
[license]
eve-ng = f2630dfba88daedd;
You can disable the phone home feature with something like:
 echo ‘127.0.0.127 xml.cisco.com’ >> /etc/hosts
Step 2: Input the license key in “iourc” file
vi iourc
[license]
eve-ng = f2630dfba88daedd;
Step 3: Test IOL
darwin@eve-ng:/opt/unetlab/addons/iol/bin$ LD_LIBRARY_PATH=/opt/unetlab/addons/iol/lib /opt/unetlab/addons/iol/bin/i86bi-linux-l3-adventerprisek9-15.4.2T.bin 1
***************************************************************
IOS On Unix – Cisco Systems confidential, internal use only
Under no circumstances is this software to be provided to any
non Cisco staff or customers.  To do so is likely to result
in disciplinary action. Please refer to the IOU Usage policy at
wwwin-iou.cisco.com for more information.
***************************************************************
              Restricted Rights Legend
Use, duplication, or disclosure by the Government is
subject to restrictions as set forth in subparagraph
(c) of the Commercial Computer Software – Restricted
Rights clause at FAR sec. 52.227-19 and subparagraph
(c) (1) (ii) of the Rights in Technical Data and Computer
Software clause at DFARS sec. 252.227-7013.
           cisco Systems, Inc.
           170 West Tasman Drive
           San Jose, California 95134-1706
Cisco IOS Software, Linux Software (I86BI_LINUX-ADVENTERPRISEK9-M), Version 15.4(2)T, DEVELOPMENT TEST SOFTWARE
Technical Support: http://www.cisco.com/techsupport
Copyright (c) 1986-2014 by Cisco Systems, Inc.
Compiled Thu 27-Mar-14 01:08 by prod_rel_team
This product contains cryptographic features and is subject to United
–omitted lines —

2 Comments

  1. Chris Newnham said:

    You absolute legend, thanks!

  2. Adi said:

    Thanks a lot mate..Very useful document
    Made my day!!

Leave a Reply

Your email address will not be published. Required fields are marked *