EVE-NG-中文网论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 65270|回复: 5

3.EVE-NG导入Dynamips和IOL(转)

[复制链接]
发表于 2018-3-16 09:57:07 | 显示全部楼层 |阅读模式
Dynamips导入过程一、查看EVE的地址,并用SFTP工具连接(本文以SecureFX为例)
二、上传镜像文件到相应目录
镜像保存目录:
/opt/unetlab/addons
                             —/dynamips  Dynamips镜像保存目录
                             —/iol              IOL镜像保存目录(运行IOU的镜像)
                             —/qemu        QEMU镜像(运行ASAv、ISE、F5等等镜像)

将dynamips镜像上传到/opt/unetlab/addons/dynamips目录下
三、修正镜像权限
用SSH登录到EVE,运行如下命令
/opt/unetlab/wrappers/unl_wrapper -a fixpermissions

注意:
有可能您的机器跑Dynamips后CPU利用率非常高,计算idlepc后利用率会降到最低,此处就先不介绍idlepc计算方法了,今后如各位有需要再补充!
个人觉得,有了vios和iol后,dynamips就没必要使用了!如果各位有兴趣,进QQ群:593920308(EmulatedLab)获取idle值计算方法!

IOL导入过程一、上传镜像到相应目录
与IOL有关的文件包含
IOL的镜像
iourc文件(IOL的license文件)
CiscoIOUKeygen.py(python脚本,用于生成license)

将如上文件全部上传到/opt/unetlab/addons/iol/bin目录下
二、生成并编写license第一种方法:命令自动生成
确保CiscoIOUKeygen.py已经上传后,执行命令
cd /opt/unetlab/addons/iol/bin/
python CiscoIOUKeygen.py | grep -A 1 ‘license’ > iourc
生成license代码
第二种方法:手动修改
生成license代码
root@eve-ng:~#cd /opt/unetlab/addons/iol/bin
root@eve-ng:/opt/unetlab/addons/iol/bin# ls
CiscoIOUKeygen.py
i86bi-linux-l2-adventerprisek9-15.1a.bin
i86bi-linux-l2-ipbasek9-15.1a.bin
i86bi-linux-l2-upk9-12.2.bin
i86bi-linux-l2-upk9-15.0a.bin
i86bi-linux-l3-adventerprisek9-12.4.bin
i86bi-linux-l3-adventerprisek9-15.2.2.15T.bin
i86bi-linux-l3-adventerprisek9-15.2.4M1.bin
i86bi-linux-l3-adventerprisek9-15.4.1T.bin
iourc
root@eve-ng:/opt/unetlab/addons/iol/bin# python CiscoIOUKeygen.py
*********************************************************************
Cisco IOU License Generator – Kal 2011, python port of 2006 C version
Modified to work with python3 by c_d 2014
hostid=007f0101, hostname=eve-ng, ioukey=7f0343
Add the following text to ~/.iourc:
[license]
eve-ng = 972f30267ef51616;
You can disable the phone home feature with something like:
echo ‘127.0.0.127 xml.cisco.com’ >> /etc/hosts
root@eve-ng:/opt/unetlab/addons/iol/bin#
红色字体即IOL的license,这段代码随着EVE-NG的hostname变动,hostname不同,计算的结果也不同。

编写license文件
安装vim(确保EVE联网)
apt-get update
apt-get install vim
root@eve-ng:/opt/unetlab/addons/iol/bin# vim iourc
把原来的删除掉,重新粘贴新的license代码
:wq! 保存退出
三、修正镜像权限
运行如下命令
/opt/unetlab/wrappers/unl_wrapper -a fixpermissions
运行镜像测试
不会的朋友请看历史文章,不做详细介绍
用web界面登录并添加设备,这时候能看到Cisco IOS与Cisco IOL几项已经被点亮。
选择一个Cisco IOS 7206VXR和一个Cisco IOL做测试

已经通了!此处有必要说一下,以前用GNS3时Dynamips与IOL的设备中间直连会报错,中间必须增加一个GNS3自带的二层交换机才能正常通信。而EVE-NG不需要~~~



如未注明,均为原创,版权归EmulatedLab所有!转载请注明出处,否则追究法律责任!

回复

使用道具 举报

发表于 2018-7-9 11:37:12 | 显示全部楼层
那么请问,哪里才能下载到CiscoIOUKeygen.py 呢?
回复

使用道具 举报

发表于 2018-11-28 16:37:29 | 显示全部楼层
受教了,感谢感谢。
回复

使用道具 举报

发表于 2018-12-24 12:18:37 | 显示全部楼层
andyzhang209 发表于 2018-7-9 11:37
那么请问,哪里才能下载到CiscoIOUKeygen.py 呢?

#! /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='\x4B\x58\x21\x81\x56\x7B\x0D\xF3\x21\x43\x9B\x7E\xAC\x1D\xE6\x8A'
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*********************************************************************"



存到記事本,另存成CiscoIOUKeyGen.py檔
回复

使用道具 举报

发表于 2019-6-22 21:39:20 | 显示全部楼层
我导入镜像之后只点亮了Cisco IOL一项,点开Cisco IOL里面的image有好多,全在里面了,这是怎么回事?
回复

使用道具 举报

发表于 2021-4-6 14:38:32 | 显示全部楼层
dddd咕咕咕咕咕咕过。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|小黑屋|手机版|Archiver|EVE-NG-中文网论坛

GMT+8, 2024-4-26 05:54 , Processed in 0.039810 second(s), 17 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc. Template By 【未来科技】【 www.wekei.cn 】

快速回复 返回顶部 返回列表