| Both sides previous revisionPrevious revision | |
| eve-ng [2025/12/14 13:46] – Name | eve-ng [2025/12/14 14:03] (current) – Name |
|---|
| nano /opt/unetlab/addons/iol/bin/CiscoIOUKeygen.py</code> | nano /opt/unetlab/addons/iol/bin/CiscoIOUKeygen.py</code> |
| * Paste into CiscoIOUKeygen.py (should be an empty file first) | * Paste into CiscoIOUKeygen.py (should be an empty file first) |
| * <code><print("*********************************************************************") | * <code>print("*********************************************************************") |
| print("Cisco IOU License Generator - Kal 2011, python port of 2006 C version. Modified by Timothy C. Fox 2025. https://tim.army") | print("Cisco IOU License Generator - Kal 2011, python port of 2006 C version. Modified by Timothy C. Fox 2025. https://tim.army") |
| import os | import os |
| out_file.write("[license]\n" + hostname + " = " + iouLicense + ";\n") | out_file.write("[license]\n" + hostname + " = " + iouLicense + ";\n") |
| print("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nCopied to the file /opt/unetlab/addons/iol/bin/.iourc\n ") | print("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nCopied to the file /opt/unetlab/addons/iol/bin/.iourc\n ") |
| | |
| #print("The old way of disabling the call home feature was by editing the host file.") | #print("The old way of disabling the call home feature was by editing the host file.") |
| #print("That method no longer works with the x86_64_crb_linux images. The new way is the following:") | #print("That method no longer works with the x86_64_crb_linux images. The new way is the following:") |
| #print("iptables -I OUTPUT -p udp --dport 53 -m string --hex-string \"|03|xml|05|cisco|03|com\" --algo bm -j DROP") | #print("iptables -I OUTPUT -p udp --dport 53 -m string --hex-string \"|03|xml|05|cisco|03|com\" --algo bm -j DROP") |
| |
| # Add the following to iptables to block Cisco Call-Home | # Add the following to iptables to block Cisco Call-Home and set the timeout value to 10 seconds |
| os.system('iptables -I OUTPUT -p udp --dport 53 -m string --hex-string "|03|xml|05|cisco|03|com" --algo bm -j DROP') | os.system('timeout 10 iptables -I OUTPUT -p udp --dport 53 -m string --hex-string "|03|xml|05|cisco|03|com" --algo bm -j DROP') |
| |
| # Display the iptables | # Display the iptables |
| print("iptables -L OUTPUT -p udp --dport 53 -m string --hex-string \"|03|xml|05|cisco|03|com\" --algo bm -j DROP") | print("iptables -L OUTPUT -p udp --dport 53 -m string --hex-string \"|03|xml|05|cisco|03|com\" --algo bm -j DROP") |
| |
| # Fix permissions | # Fix permissions and set the timeout value to 60 seconds |
| print("Fixing permissions . . . standby") | print("Fixing permissions . . . standby") |
| os.system('/opt/unetlab/wrappers/unl_wrapper -a fixpermissions') | os.system('timeout 60 /opt/unetlab/wrappers/unl_wrapper -a fixpermissions') |
| print("Permissions fixed")</code> | print("Permissions fixed")</code> |
| |