Adding Cisco IOL to EVE-NG


  • First download the .bin files from here or here. Most probably the file names will be:
    • i86bi_linux_l2-adventerprisek9-ms.SSA.high_iron_20190423.bin This will the one for Switch Layer-2 device
    • i86bi_LinuxL3-AdvEnterpriseK9-M2_157_3_May_2018.bin This will for a router i.e. Layer-3 device
  • Further you need to paste these into the /opt/unetlab/addons/iol/bin using the FTP client, I used Filezilla as follows:
    • First of all you need to know the ip of your EVE-NG machine that you are running using Virtual Box (the one that you used to get access in the browser), in my case it is 192.168.18.210 (statically given)
  • Once you have entered the required details, and connected to eve-ng, you will be able to see the contents as shown in the orange coloured box in the image above.
  • Then, in order to transfer the files, you can just navigate to the desired directory and drag the item(s) from green part to the orange part, and you have completed the file transfer.

Creating a IOURC license file…

  • Copy the code given below and name the file gen.py (You can give this file any name as per your convenience, but remember to keep the extension as .py , python will be able to run this file when given the command to do so) (The code has been taken from other available resources)
#! /usr/bin/python
print("*********************************************************************")
print("Cisco IOU License Generator - Kal 2011, python port of 2006 C version")
print("Modified to work with python3 by c_d 2014")
import os
import socket
import hashlib
import struct

# get the host id and host name to calculate the hostkey
hostid=os.popen("hostid").read().strip()
hostname = socket.gethostname()
ioukey=int(hostid,16)
for x in hostname:
 ioukey = ioukey + ord(x)
print("hostid=" + hostid +", hostname="+ hostname + ", ioukey=" + hex(ioukey)[2:])

# create the license using md5sum
iouPad1 = b'\x4B\x58\x21\x81\x56\x7B\x0D\xF3\x21\x43\x9B\x7E\xAC\x1D\xE6\x8A'
iouPad2 = b'\x80' + 39*b'\0'
md5input=iouPad1 + iouPad2 + struct.pack('!i', ioukey) + iouPad1
iouLicense=hashlib.md5(md5input).hexdigest()[:16]

print("\nAdd the following text to ~/.iourc:")
print("[license]\n" + hostname + " = " + iouLicense + ";\n")
print("You can disable the phone home feature with something like:")
print(" echo '127.0.0.127 xml.cisco.com' >> /etc/hosts\n")
  • transfer this gen.py file into the same directory where you moved the .bin files in the earlier steps
  • Now move to the EVE-NG CLI, and navigate to /opt/unetlab/addons/iol/binwhere you have kept the .py file and other .bin files. This can be done using
cd /opt/unetlab/addons/iol/bin
  • Now use the following command to run the .py file you just moved into /opt/unetlab/addons/iol/bin
python gen.py
  • Your output will be like this:
  • now you need to make a iourc file in /opt/unetlab/addons/iol/bindirectory, you can do the same using
nano -c iourc

[license]
"your hostname" = "the key out put the program that you ran"; 
  • NOTE: I think you should not forget the semi-colon (;) at the end
  • after typing this into the file you need to press Ctrl+O in order to save the file, read the next message and type Y to confirm the filename and at last press Ctrl+X to close the nano editor.
  • You have completed the process, now you can type “ls” to see the contents, and you will have the following view.
  • Now your router and switch should be working perfectly in your simulation environment (that you access in your browser using the ip of your EVE-NG machine)
  • You also have to run the following command in order for everything to take effect:
/opt/unetlab/wrappers/unl_wrapper -a fixpermissions

If Not able to open telnet to nodes in the EVE-NG

  • Follow the steps given below:
sudo add-apt-repository ppa:smartfinn/eve-ng-integration
sudo apt-get update
sudo apt-get install eve-ng-integration
source


7 responses to “Adding Cisco IOL to EVE-NG”

  1. Great instruction, but i have 1 issue, my nodes start but after few seconds it stop. can i have any suggestion how to fixed this? thank you

    • there might be a problem with the license file that you used, I had the same problem, what I did was to add them again. Sorry for the late response.

  2. Hi Ranjanbir –
    It worked perfectly for me on my first try!! I am very grateful for your effort in creating this instruction.

    Thanks
    Devon

  3. Hi,
    nice instruction, but my Lab didn’t start to work.
    Logs:
    root@eve-ng:/opt/unetlab/addons/iol/bin# tail -f /opt/unetlab/data/Logs/unl_wrapper.txt
    ul 07 17:48:55 INFO: CWD is /opt/unetlab/tmp/0/a79361f0-aa77-42b4-854b-010fcc5f25db/1
    JJul 07 17:48:55 INFO: starting /opt/unetlab/wrappers/iol_wrapper -T 0 -D 1 -t “R1” -F /opt/unetlab/addons/iol/bin/i86bi_linux_l3-L3-ADVENTERPRISEK9-M-15.4-2T.bin -d 0 -e 1 -s 0 — -n 1024 -q -m 1024 -c startup-config > /opt/unetlab/tmp/0/a79361f0-aa77-42b4-854b-010fcc5f25db/1/wrapper.txt 2>&1 &
    ^C
    root@eve-ng:/opt/unetlab/addons/iol/bin# cat /opt/unetlab/tmp/0/a79361f0-aa77-42b4-854b-010fcc5f25db/1/wrapper.txt
    7/6 15:48:55.242 ERR File ‘iourc’ does not exist.
    root@eve-ng:/opt/unetlab/addons/iol/bin# ls -all
    total 459364
    drwxr-xr-x 2 root root 4096 Jul 7 15:57 .
    drwxr-xr-x 4 root root 4096 Jul 7 13:48 ..
    -rw-r–r– 1 root root 1058 Jul 7 15:10 gen.py
    -rwxr-xr-x 1 root root 126249700 Jul 7 14:41 i86bi_linux_l2-adventerprisek9-ms.SSA.high_iron_20190423.bin
    -rwxr-xr-x 1 root root 184759244 Jul 7 14:41 i86bi_LinuxL3-AdvEnterpriseK9-M2_157_3_May_2018.bin
    -rwxr-xr-x 1 root root 159350476 Jul 7 14:41 i86bi_linux_l3-L3-ADVENTERPRISEK9-M-15.4-2T.bin
    -rw-r–r– 1 root root 37 Jul 7 15:16 .iourc
    -rw-r–r– 1 root root 37 Jul 7 15:31 iourc

    • Hi,
      Can you share some more details to have a better insight.
      did you use the “fixpermission” command before proceeding.

  4. @kbish did you found a fix to your problem ?
    I have changed the image, run fixpermission, tested the image directly in ssh (LD_LIBRARY_PATH=/opt/unetlab/addons/iol/lib /opt/unetlab/addons/iol/bin/L3-ADVENTERPRISEK9-M-15.4-2T.bin 1) but still can not start the router

    root@eve-ng:/opt/unetlab/addons/iol/bin# ls -li
    total 155636
    1053858 -rw-r–r– 1 root root 27 août 19 20:19 –
    1053857 -rw-r–r– 1 root root 1056 août 19 20:30 gen.py
    1053854 -rw-r–r– 1 root root 1056 août 19 20:18 IOUkeygen.py
    1053853 -rw-r–r– 1 root root 38 août 19 20:49 iourc
    1053850 -rwxr-xr-x 1 root root 159350476 août 19 20:41 L3-ADVENTERPRISEK9-M-15.4-2T.bin
    1053852 -rw-r–r– 1 root root 0 août 19 23:00 NETMAP

    root@eve-ng:/opt/unetlab/addons/iol/bin# tail /opt/unetlab/data/Logs/unl_wrapper.txt
    Aug 20 01:00:54 INFO: tunctl -u unl1 -g root -t vunl1_10_0 2>&1
    Aug 20 01:00:54 INFO: sysctl -w net.ipv6.conf.vunl1_10_0.disable_ipv6=1
    Aug 20 01:00:54 INFO: tunctl -u unl1 -g root -t vunl1_10_16 2>&1
    Aug 20 01:00:54 INFO: sysctl -w net.ipv6.conf.vunl1_10_16.disable_ipv6=1
    Aug 20 01:00:54 INFO: tunctl -u unl1 -g root -t vunl1_10_32 2>&1
    Aug 20 01:00:54 INFO: sysctl -w net.ipv6.conf.vunl1_10_32.disable_ipv6=1
    Aug 20 01:00:54 INFO: tunctl -u unl1 -g root -t vunl1_10_48 2>&1
    Aug 20 01:00:54 INFO: sysctl -w net.ipv6.conf.vunl1_10_48.disable_ipv6=1
    Aug 20 01:00:54 INFO: CWD is /opt/unetlab/tmp/1/fff8621f-fa17-415b-b618-1fbb91f43ab5/10
    Aug 20 01:00:54 INFO: starting /opt/unetlab/wrappers/iol_wrapper -T 1 -D 10 -t “R10” -F /opt/unetlab/addons/iol/bin/L3-ADVENTERPRISEK9-M-15.4-2T.bin -d 0 -e 1 -s 0 — -n 1024 -q -m 1024 > /opt/unetlab/tmp/1/fff8621f-fa17-415b-b618-1fbb91f43ab5/10/wrapper.txt 2>&1 &
    root@eve-ng:/opt/unetlab/addons/iol/bin#

    root@eve-ng:/opt/unetlab/addons/iol/bin# cat /opt/unetlab/tmp/1/fff8621f-fa17-415b-b618-1fbb91f43ab5/10/wrapper.txt
    19/7 23:0:54.529 ERR File ‘iourc’ does not exist.

Leave a Reply

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