#! /usr/bin/python |
print'n*********************************************************************' |
print'Cisco IOU License Generator - Kal 2011, python port of 2006 C version' |
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='x4Bx58x21x81x56x7Bx0DxF3x21x43x9Bx7ExACx1DxE6x8A' |
iouPad2='x80'+39*'0' |
md5input=iouPad1 + iouPad2 + struct.pack('!L', ioukey) + iouPad1 |
iouLicense=hashlib.md5(md5input).hexdigest()[:16] |
# add license info to $HOME/.iourc |
print'n*********************************************************************' |
print'Create the license file $HOME/.iourc with this command:' |
print' echo -e '[license]n'+ hostname +' = '+ iouLicense +';''+' tee $HOME/.iourc ' |
print'nThe command adds the following text to $HOME/.iourc:' |
print'[license]n'+ hostname +' = '+ iouLicense +';' |
# disable phone home feature |
print'n*********************************************************************' |
print'Disable the phone home feature with this command:' |
print' grep -q -F '127.0.0.1 xml.cisco.com' /etc/hosts echo '127.0.0.1 xml.cisco.com' sudo tee -a /etc/hosts' |
print'nThe command adds the following text to /etc/hosts:' |
print'127.0.0.1 xml.cisco.com' |
print'n*********************************************************************' |
I'm getting this error SyntaxError: Missing parentheses in call to 'print' Python version 3.5 |
this a great video work for me |
thanks |
I think Python updated python3 libraries and now it's not running. File 'CiscoIOUKeygen.py', line 2 I tried to add parentheses to the print lines, but now i get error: Traceback (most recent call last): Any ideas? |
I think you need to use python2 and not python3, I encountered this before and someone from a different site said to use the python2. |
ubuntu 16.04, worked straight out box, copy-and-paste, thanks for the script. |
i have cousing this problem.Please solve this. gns3@gns3-iouvm: ^ |
In python 3.x print is a function. You must use python 2.X and not 3.x. Or you can change code. Ex print 'blablabla' to print('blablabla') |
Try this those who are using pyth ver 3.really hats off this man |
To make this work do the following on the VM you are running IOU/IOL on. Next Move to the directory you are running IOU from: Create the python script: now run the script: you will get some output. You may also need to make the iourc file executable: now paste the line starting with grep in the console. That should be it and the IOL should start now. |
Cisco AP licensing on wireless lan controller was always a little bit “messy”. You need to add AP-adder licenses to your current license by activating a PAK (Product activation key) on cisco.com with your Cisco CCO ID, downloaded the lic file and upload it to your controller AND (!) restarting the whole machine. The last days, I installed a Cisco 5520 HA WLC cluster to one of my customer and was always asking the Cisco support where I can find the PAK. After several mails, I found out, that Cisco is going a new way to license the access points on WLCs. You now buy Cisco “Right to Use” (RTU) Licenses and just configure the AP license count at “Management / Software Activation / Licenses”:
You can read more information about it here. There is also the possibility to add this via CLI:
show license summary
license add ap-count (1-200)
and you don’t need to restart your WLC 🙂 thanks Cisco… finally!