CISCO仿真模拟器Dynamips
一、一些软件介绍
1、dynamips-0.2.8-RC2-cygwin_CISCO.zip:Cisco仿真模拟器Dynamips程序,包括dynamips-wxp.exe,dynamips-w2000.exe,nvram_export.exe,cygwin1.dll,README-0.2.8.txt文件。
2、Dynamips_CISCO_c2900XL-c3h2s-mz-120.5.2-XU.bin、Dynamips_CISCO_c3640-is-mz_120-7_t.bin、Dynamips_CISCO_C7200.bin:不同设备的CISCO IOS bin文件。
3、Dynamips_CISCO_dynagen-0.11.0_win_setup.exe:基于dynamips的一个可以用脚本来配置dynamips的工具。
4、Dynamips_CISCO_DynamipsGUI_2.8_CN.rar:基于dynamips的一个可以用GUI图形方式来配置dynamips的工具。它跟第3工具一样的功能。
二、dynagen的简单试用
套用网上非常流行的一段话:Dynamips,这绝对不是一般的cisco路由器模拟器。dynamips和boson netsim的区别在于:boson是模拟出IOS的命令行,而
dynamips是模拟出cisco7200路由器的硬件环境,然后在这个环境中直接运行Cisco的IOS。换句话讲,dynamips模拟出的是真实
的路由器,就象你在PC上用街机模拟器玩街机游戏一样。
最近上BCN所做的实验都在Dynamips上完成的,Dynamips的确是非常强的工具,当然Dynamips还是不能替代真实的路由器的,还是有些命令是不同的。
想要使用Dynamips首先就要安装winpcap,winpcap有什么用呢?其实我也不知道,google上查到它为win32应用程序提供访问网络底层的能力,也许是让真实环境和虚拟路由器通信的东东吧!!!
然后再安装Dynamips这个软件(有win版和linux版,这里我装的是win版),默认就在c盘了。
再然后就把cisco的ios文件拷到c:\...\Dynamips\images下(目前我就只有3660和7200)
一切准备都做好了,就等需要的实验拓扑图了(也就是sample_labs中的.net文件的内容),这里拿一个全面的说明图来演示。(注意红色部分为.net文件中的内容)
# 项目实践拓扑结构
autostart = False # 是否所有的设备均自动启动?有true和false两个选项,默认是true。能够被每设备的配置所替代。
# model = 7200 # 设置实验室中的所有路由器的默认型号。目前可以选择的有3620,3640,3660和7200。
[localhost:7200] # 服务器的主机名或者ip地址,以及所使用的控制端口。如果你不指明的话,默认使用7200。
# port = 7200 # 老式的设置控制端口的方法,可选,默认为7200。
console = 2001 # 基本控制端口。新开启的实例如果没有指明控制端口,默认会使用这个值+实例号。默认值为2000。
workingdir = C:\Program Files\Dynamips\sample_labs\test # 设置Dynamips所保存所有设备文件的目录。它和运行dynamips的系统的绝对路径有关。
udp = 10000 # 设置NIO使用的基本UDP端口。
[[7200]]
image = C:\Program Files\Dynamips\images\c7200-is-mz.123-10d.bin # 7200路由器的ios文件的绝对路径。
ram = 128 # 每个路由器实例的虚拟内存数。
nvram = 128 # NVRAM的大小
# disk0 = 64 # Set size of PCMCIA ATA disk0
# disk1 = 64 # Set size of PCMCIA ATA disk1
# cnfg = None # Configuration file to import. This is the fully qualified path relative to the system running dynamips.
confreg = 0x2102
npe = npe-400 # NPE类型。("npe-100", "npe-150", "npe-175", "npe-200", "npe-225", "npe-300" or "npe-400")
midplane = vxr # 可选"std" or "vxr"
mmap = True # 设置为false将在为每个路由器产生虚拟内存时使用真实的内存替代磁盘文件。节省内存时是以牺牲性能为代价的。默认选项为True。
# idlepc = 0x607f1630 # 设置cpu空闲的值
# exec_area = 64 # Set the exec area size
# configuration = ... # 基本的64位加密的IOS配置。当前只能在7200下使用。
[[3620]]
image = C:\Program Files\Dynamips\images\c3620-is-mz.122-16.bin # 3620的ios的完全路径。
ram = 64 # 每个路由器的实例的虚拟内存数。
rom = 4 # ROM的大小
nvram = 128 # NVRAM的大小
# disk0 = 64 # Set size of PCMCIA ATA disk0
# disk1 = 64 # Set size of PCMCIA ATA disk1
# iomem = 5 # 路由器内存中分配给iomem的百分比。仅仅应用于3600系列的路由器。
# cnfg = None # Configuration file to import. This is the fully qualified path relative to the system running dynamips.
confreg = 0x2102 # Set the configuration register
mmap = True # 设置为false将在为每个路由器产生虚拟内存时使用真实的内存替代磁盘文件。节省内存时是以牺牲性能为代价的。默认选项为True。
# idlepc = 0x60719b98 # Set the Idle PC value
# exec_area = 64 # Set the exec area size
[[3640]]
image = C:\Program Files\Dynamips\images\c3640-jk9o3s-mz.123-10.bin # 3640的ios的完全路径。
ram = 96 # 每个路由器的实例的虚拟内存数。
rom = 4 # ROM的大小
nvram = 128 # NVRAM的大小
# disk0 = 64 # Set size of PCMCIA ATA disk0
# disk1 = 64 # Set size of PCMCIA ATA disk1
# iomem = 5 # 路由器内存中分配给iomem的百分比。仅仅应用于3600系列的路由器。
# cnfg = None # Configuration file to import. This is the fully qualified path relative to the system running dynamips.
confreg = 0x2102 # Set the configuration register
mmap = True # 设置为false将在为每个路由器产生虚拟内存时使用真实的内存替代磁盘文件。节省内存时是以牺牲性能为代价的。默认选项为True。
# idlepc = 0x60719b98 # Set the Idle PC value
# exec_area = 64 # Set the exec area size
[[3660]]
image = C:\Program Files\Dynamips\images\c3660-is-mz.124-10a.bin # 3660的ios的完全路径。
ram = 96 # 每个路由器的实例的虚拟内存数。
rom = 4 # ROM的大小
nvram = 128 # NVRAM的大小
# disk0 = 64 # Set size of PCMCIA ATA disk0
# disk1 = 64 # Set size of PCMCIA ATA disk1
# iomem = 5 # 路由器内存中分配给iomem的百分比。仅仅应用于3600系列的路由器。
# cnfg = None # Configuration file to import. This is the fully qualified path relative to the system running dynamips.
confreg = 0x2102 # Set the configuration register
mmap = True # 设置为false将在为每个路由器产生虚拟内存时使用真实的内存替代磁盘文件。节省内存时是以牺牲性能为代价的。默认选项为True。
# idlepc = 0x60640290 # Set the Idle PC value
# exec_area = 64 # Set the exec area size
[[Router B1-F2-S1]]
model = 3660
slot1 = NM-16ESW
idlepc = 0x60640eb8
[[Router B1-D-S1]]
model = 3660
slot1 = NM-16ESW
idlepc = 0x60640eb8
[[Router B1-D-S2]]
model = 3660
slot1 = NM-16ESW
idlepc = 0x60640eb8
[[Router B1-D-S1-R]]
model = 3620
idlepc = 0x60424f48
[[Router B1-D-S2-R]]
model = 3620
idlepc = 0x60424f48
[[Router C-S1]]
model = 3660
slot1 = NM-16ESW
idlepc = 0x60640eb8
[[Router C-S2]]
model = 3660
slot1 = NM-16ESW
idlepc = 0x60640eb8
[[Router B2-F2-S1]]
model = 3660
slot1 = NM-16ESW
idlepc = 0x60640eb8
[[Router B2-D-S1]]
model = 3660
slot1 = NM-16ESW
idlepc = 0x60640eb8
[[Router B2-D-S2]]
model = 3660
slot1 = NM-16ESW
idlepc = 0x60640eb8
[[Router B2-D-S1-R]]
model = 3620
idlepc = 0x60424f48
[[Router B2-D-S2-R]]
model = 3620
idlepc = 0x60424f48
#[[Router r1]]
#model = 3660
#slot1 = NM-16ESW
#idlepc = 0x60640eb8
#[[Router r2]]
#model = 7200
#idlepc = 0x607f1630
#[[Router r3]]
#model = 3640
#idlepc = 0x604593cc
#[[Router r4]]
#model = 3620
#idlepc = 0x60424f48
#后面的为说明文字,不影响该文件
下面我们来新建个拓扑图,在sample_labs文件夹中新建一个txt文本然后把扩展名改为.net
用写字板打开.net文件,写入:
# switching
autostart = no # 是否所有的设备均自动启动?有true和false两个选项,默认是true。能够被每设备的配置所替代。
# model = 7200 # 设置实验室中的所有路由器的默认型号。目前可以选择的有3620,3640,3660和7200。
[localhost] # 服务器的主机名或者ip地址,以及所使用的控制端口。如果你不指明的话,默认使用7200。
[[3660]]
image = C:\Program Files\Dynamips\images\c3660-is-mz.124-10a.bin # 3660的ios的完全路径(3660有交换模块,此s1和s2为交换机)。
ram = 96 # 每个路由器的实例的虚拟内存数。
[[router s1]]
model = 3660
slot1 = NM-16ESW
idlepc = 0x60640eb8
f1/1 = s2 f1/1
[[router s2]]
model = 3660
slot1 = NM-16ESW
idlepc = 0x60640eb8
这里有2台交换机,交换机s1的f1/1端口接在s2的f1/1上面,如果还需要更多交换机,可以直接在后面加。
配置完成后,保存关闭,运行桌面上的dynamips Server,然后再运行你所配置的.net文件。ok了,这时你就可以用list命令查看,telnet登录了。
由于dynamips非常占用内存资源,一台512M内存的电脑最多可以开4台模拟的路有器,因此我们就需要在几台PC上同时运行模拟路由器,并且让他们相互连接,今天小吴老师刚把这个方法交给我们。
拓扑图文件是这样的:(这几台电脑必须在一个局域网内)
# Working with multiple dynamips servers
[192.168.6.50] #自己的IP地址
[[3660]]
image = E:\***.bin #自己的IOS文件位置
ram = 96 #模拟路由器的内存大小
[[ROUTER R1]]
model = 3660
s2/0 = R2 s2/0
idlepc = 0x60640eb8
[192.168.6.58] #其它PC的IP地址
workingdir = \***\test #在192.168.6.58这台PC上新建一个test文件夹,用于存放产生的临时文件
[[3660]]
image = E:\***.bin #192.168.6.58这台PC的IOS文件位置
ram = 96
[[ROUTER R2]]
model = 3660
idlepc = 0x60640eb8
注意:192.168.6.58这台PC要运行桌面上的dynamips Server,然后再在6.50这台上进行实验。
三、DynamipsGUI的入门配置
声明:本文主要是为刚刚认识dynamips这个模拟器的朋友.我写这个东西也是因为这个模拟器比较有实用价值.希望大家用好这个模拟器.完成学习.有什么问题欢迎大家在本论坛发帖.
不说废话了直接进入主题吧,看门见图:
首先我按图中序号对每个区域进行介绍:
①:此区域是选择交换机和路由器的个数(有点废话)
②:这个地方是选择设备类型,IOS路径,idle-p值NPE类型,虚拟(表示虚拟设备的RAM所占的内存大小,因为dynamips在模拟时候需要将主机的物理内存模拟成模拟设备的RAM)
③:此区域是配置分布式的dynamips的设置区域(请看分布式专题),对谛率掷此?这个区域暂时还用不到.
④:这里可以选择一些不需要IOS的模拟设备。如:FrameRelay交换机ATM交换机,以太网交换机(现在已经有支持交换的模块NM-16ESW).由模拟器自己提这些功能.
⑤:设备类型,选择你所需要模拟的设备,以上的设备为dynamips目前支持的类型,其他的都不支持.
⑥:这里可以设置连接到主机通信(下文详细介绍)
⑦:可以直接读取真实设备里的NVRAM里的配置文件(.ini格式)
⑧:输出目录(自己先建立).
(根据上面这个拓扑来介绍,希望大家在弄懂基本东西以后,可以在举一反三吧.东西是活的,活学活用)
接下来,我从起始配置到最后开始实验在做逐步讲解.
1.
首先选择根据上面这个拓扑图(建立在做实验的时候在草稿纸上画好拓扑图,注释好个端口设备的IP).我们来用dynamipsGUI来配置脚本文件(注
意:现在的dynamipsGUI和dynamipsee都是可以视化的写dynamips的脚本程序.不是模拟器.有的初学者.总以为这两个程序是模拟
器.真正的模拟器是dynamips 点击进入作者BLGO).未安装的朋友请点下载.下载好安装.点击桌面DynamipsGUI图标打开.
2.好了,打开以后,根据上面的图我们假设R1,R2,R3都使用3640,而R4使用7200.那么我们选择路由器个数为4,并选择桥接到PC.在⑤设备类型里钩选3640 和7200.如图:
3.在②设备配置区域里下拉选择7200,然后浏览选择你的IOS文件点击下载IOS(cisco ios文件夹).
(注意IOS在网上下载后,后缀名为BIN,大家需要将后缀名字改为RAR,然后在解压出来,这样在运行模拟设备时候就避免了再解压)接一下步是最让初学
者感到困惑的地方.计算idle-pc值(idle-pc只为了解决在开启模拟设备时不至于你的CPU占有率达到100%,所以这个值对于能做好实验很重
要).好.指定好IOS路径以后.我们点击计算idle-pc,确定IOS文件存在.之后在弹出窗口中按任意键继续.如图:
之后看到的就是设备的启动了(如同真实设备一样).然后在设备的用户模式下(Router>)下先按组合键ctrl+] 接着在单独按i键.记住不要三个键一起按.按完以后就是等待了.如图:
等待一会儿,出现下图:
看到下面出现一排值.这就是我们所需要的idle-pc值.那么这么多我们怎么选择呢?好!注意看count等于后面的数字.找到一个count最大值.然
后记下前面的一串16进制数.例如上面这图.count=72,这个里面有两个72的值,我们同时记下这两个值.0x605c33fc
和0x605c345c.然后在回到dynamipsGUI界面.将0x605c33fc(或者0x605c345c)填入.(说一下这地方的原则:大家
不要一味的相信最大值就是必须要选择的值.这要看情况而定.如果当你选择一个最大值,然后在后面开设备的时候却出现了CPU100%的情况,那么这个时候
你就应该重新去计算idle-pc值,只到CPU占有率维持在一个正常值.我上面说的选取最大的count值是应该理解为从最大的count值开始去试.
这样一直到找到一个合适的idle-pc值)
4.接下来是NPE类型这里
dynamipsGUI已经有默认值了.我们不需要在去设置它.而在虚拟内存这里dynamipsGUI作者也给出了各个类型模拟器的默认值.大家可以根
据IOS的大小去更改.也要根据自己的物理内存而定.而后面的参数128 --disk0 4
,128的意思是拿128MB的物理内存来作为虚拟设备的RAM, --disk0 4是dynamips的参数在说明文件中的解释为:
--disk0 : Set PCMCIA ATA disk0:
size.这是节省内存的参数.不过3600不支持这个参数.大家如果想深入研究可以读说明文档内容,如下:
The emulator currently supports the following platforms:
- Cisco 7200 (NPE-100 to NPE-400)
- Cisco 3600 (3620, 3640 and 3660)
- Cisco 2691
- Cisco 3725
- Cisco 3745
- Cisco 2600(2610/2611/2620/2621/2610XM/2620XM/2650XM)
To emulate another platform, use the "-P" command line option (for example,
"-P 3725" or "-P 3600").
For the 7200, you can change the NPE type with the "-t" option.
It is possible to select "npe-100", "npe-150", "npe-175", "npe-200",
"npe-225", "npe-300" and "npe-400". The "npe-g1" is not working.
For the 3600, a 3640 with 128 Mb is emulated by default. You can change this
with the "-t" option and by specifying "3620" or "3660".
Don't forget to set the chassis type depending on your IOS image,
a c3660 image will not run on c3640 hardware and vice-versa.
Remark: PCMCIA card emulation is not supported yet with Cisco 3600.
还有一个要说明的,大家如果在以后碰到dynamipsGUI界面的虚拟碰到后面跟一个参数-X(注意为大写)比如96 –X
意思是不使用一个模拟的RAM文件,这样可以使用速度更快.原说明文档也有介绍:-X : Do not use a file to
simulate RAM (faster)
我对新手的建议:关于NPE绾紊柚?大家在使用dynamipsGUI时就使用默认的.关于虚拟大小如何设置.主要还是根据你的IOS大小来定.dynamipsGUI也给了默认值.
5.
接下来我要拿来单讲的就是这个寄存器的值了.很多人在做实验的时候都问,为什么copy run
start以后.下次重新启动虚拟设备时.设置没有被保存.主要就是这个地方的设置问题了.学思科的人都清楚0x2142和0x2102了.
0x2142启动时是不从NVRAM读配置.而0x2102相反.因为dynamips默认是0x2142
所以我们需要在这个地方改为0x2102就可以了.然后在到虚拟的路由设备里面在show
ver看看,你会发现寄存器的值0x2142(虽然我们这之前在dynamipsGUI已经配置过)但还是要重新在改一次寄存器的值才能最后的保存你的配
置命令:config-register 0x2102
然后再配置在copy run start,再reload看看.你就会发现设置保存成功!
6.
好的.上面已经把7200都配置好了.完了以后点寄存器下面的确定.3640也是一样(其它的设备也是如此配置)配置完后确定.
OK!两个设备都配置完毕.接下来.哦还记得我上面的那个拓扑图吧。对,还有一个桥接到本地PC与我们自己的主机通信(我要说明一下.不一定非要桥接到
PC.我这里是故意弄一个PC桥接,因为很多朋友这个地方搞不清楚).我们选择⑥区域里的下拉.选择NIC-O(dynamips可以支持多块网卡桥
接),然后点击计算桥接参数.在弹出的界面里已经有很详细的说明.如图:
在这里我就不在重复了(免得说我罗嗦!
).只说一点.例如这张图中我们应该选择的是第三个网卡信息,即本地网卡信息而不应该选择第二个(是PPPOE拨号的).OK。如本图应该为:
\Device\NPF_{36CC519A-AAF8-4C53-A9EC-7E0B88D917D6},记下网卡信息最好填到dynamipsGUI
界面相应位置.好了.现在选择一个输出目录吧.下一步!!
6.这里就是确定设备名字和telnet端口还有各个slot模块信息.关于slot的模块可以参见我的帖子(下面我不在作模块介绍了):配置好每个设备点击确定配置.好根据上面那个拓扑图我也配置一下.首先是R4(7200)根据图中要求如图:
然后是3640 三个都是一样的:
这里我解释一下界面下面的控制台输出(操作系统我不废话了,不会还有哪个连自己是什么系统不知道的),如果选择TCP输出则需要用telnet连接.推荐使用SecureCRT 点击下载.
如果是直接输出,就是不用telnet连接了,就是直接在窗口下输出CLI界面,就是•••(没办说清楚了,大家自己去用用看就知道了).完事!下一步。
7.根据拓扑连设备吧.我没什么好说的了.就是将拓扑图中各个相连的端口连起来(废话),我也连了一下.发个图.新手自己慢慢体会吧.呵呵(注:图中XPC就是主机)
最后完事点生成BAT文件.在到你的输出目录里去吧.生成的文件如图:
然后依次点R1.bat,R2,bat,R3,bat,R4.bat 意思是打开这四个模拟路由器!.
然后就用SecureCRT连接了IP地址是:127.0.0.1 端口根据配置的console的值!
例如本教程中R1路由器端口设置的是2001 下面我们使用SecureCRT来登陆.
安装好SecureCRT 打开. 点在标签中建立连接
如下图:
点新会话看下图:
接着下图:
下一步如图:
接着在下一步就可以了,最后在连接就看到下图了:
好了,写到这里已经不需要写下去了.在下面都应该是一个ciscoer(学思科的人)知道的了.
四、Dynamips程序的说明
Help for Cisco router simulator (dynamips-0.2.8)
================================================
Authors of this document: Fabien Devaux, Christophe Fillot, MtvE
Emulated hardware
*****************
The emulator currently supports the following platforms:
- Cisco 7200 (NPE-100 to NPE-400)
- Cisco 3600 (3620, 3640 and 3660)
- Cisco 2691
- Cisco 3725
- Cisco 3745
- Cisco 2600 (2610 to 2650XM)
- Cisco 1700 (1710 to 1760)
By default, a Cisco 7206VXR with NPE-200 (256 Mb of DRAM) is emulated.
To emulate another platform, use the "-P" command line option (for example,
"-P 3725" or "-P 3600").
For the 7200, you can change the NPE type with the "-t" option.
It is possible to select "npe-100", "npe-150", "npe-175", "npe-200",
"npe-225", "npe-300" and "npe-400". The "npe-g1" is not working.
For the 3600, a 3640 with 128 Mb is emulated by default. You can change this
with the "-t" option and by specifying "3620" or "3660".
Don't forget to set the chassis type depending on your IOS image,
a c3660 image will not run on c3640 hardware and vice-versa.
Remark: PCMCIA card emulation is not supported yet with Cisco 3600.
Command Line Options overview
*****************************
-l <log_file> : Set logging file (default is dynamips_log.txt)
-j : Disable the JIT compiler, very slow
--exec-area <size> : Set the exec area size (default: 64 Mb)
--idle-pc <pc> : Set the idle PC (default: disabled)
--timer-itv <val> : Timer IRQ interval check (default: 1000)
-i <instance> : Set instance ID
-r <ram_size> : Set the virtual RAM size
-o <rom_size> : Set the virtual ROM size
-n <nvram_size> : Set the NVRAM size
-c <conf_reg> : Set the configuration register
-m <mac_addr> : Set the MAC address of the chassis
(default: automatically generated)
-C <cfg_file> : Import an IOS configuration file into NVRAM
-X : Do not use a file to simulate RAM (faster)
-R <rom_file> : Load an alternate ROM (default: embedded)
-k <clock_div> : Set the clock divisor (default: 4)
-T <port> : Console is on TCP <port>
-U <si_desc> : Console in on serial interface <si_desc>
(default is on the terminal)
-A <port> : AUX is on TCP <port>
-B <si_desc> : AUX is on serial interface <si_desc>
(default is no AUX port)
--disk0 <size> : Set PCMCIA ATA disk0: size
--disk1 <size> : Set PCMCIA ATA disk1: size
-a <cfg_file> : Virtual ATM switch configuration file
-f <cfg_file> : Virtual Frame-Relay switch configuration file
-E <cfg_file> : Virtual Ethernet switch configuration file
-b <cfg_file> : Virtual bridge configuration file
-e : Show network device list of the host machine
Options specific to the Cisco 7200 series:
-t <npe_type> : Select NPE type (default: "npe-200")
-M <midplane> : Select Midplane ("std" or "vxr")
-p <pa_desc> : Define a Port Adapter
-s <pa_nio> : Bind a Network IO interface to a Port Adapter
Options specific to the Cisco 3600 series ("dynamips -P 3600 --help"):
-t <chassis_type> : Select Chassis type (default: "3640")
--iomem-size <val> : IO memory (in percents, default: 5)
-p <nm_desc> : Define a Network Module
-s <nm_nio> : Bind a Network IO interface to a Network Module
Options specific to the Cisco 2691 series ("dynamips -P 2691 --help"):
--iomem-size <val> : IO memory (in percents, default: 5)
-p <nm_desc> : Define a Network Module
-s <nm_nio> : Bind a Network IO interface to a Network Module
Options specific to the Cisco 3725 series ("dynamips -P 3725 --help"):
--iomem-size <val> : IO memory (in percents, default: 5)
-p <nm_desc> : Define a Network Module
-s <nm_nio> : Bind a Network IO interface to a Network Module
Options specific to the Cisco 3745 series ("dynamips -P 3745 --help"):
--iomem-size <val> : IO memory (in percents, default: 5)
-p <nm_desc> : Define a Network Module
-s <nm_nio> : Bind a Network IO interface to a Network Module
Command Line Options details
****************************
-k <clock_div> :
Specify the clock divider (integer) based on the host clock.
Alter the value to match the CISCO clock with the real time.
The command "show clock" at the IOS' CLI will help you set this value.
--idle-pc <pc> :
The "idle PC" feature allows you to run a router instance without having
a 100% CPU load. This implies that you can run a larger number of instances
per real machine.
To determine the "idle PC", start normally the emulator with your Cisco IOS
image, and a totally IOS empty configuration (although not mandatory, this
will give better results). When the image is fully booted, wait for the
"Press RETURN to get started!" message prompt, but do not press Enter key.
Wait about 5 seconds, then press "Ctrl-] + i". Some statistics will be
gathered during 10 seconds. At the end, the emulator will display a list of
possible values to pass to the "--idle-pc" option. You may have to try some
values before finding the good one. To check if the idle PC value is good,
just boot the Cisco IOS image, and check your CPU load when the console
prompt is available. If it is low, you have found a good value, keep it
preciously.
Important remarks:
==================
* An "idle PC" value is *specific* to a Cisco IOS image. You cannot
boot a different IOS image without proceeding as described above.
* Do not run the process while having the "autoconfiguration" prompt.
--exec_area <size> :
The exec area is a pool of host memory used to store pages translated by
the JIT (they contain the native code corresponding to MIPS code pages).
Cisco 7200 Port Adapter Description "<pa_desc>":
------------------------------------------------
Format: slot:pa_driver
slot: the number of the physical slot (starts from 0)
pa_driver: the name of a Port Adapter driver in:
- C7200-IO-FE (FastEthernet, slot 0 only)
- PA-FE-TX (FastEthernet, slots 1 to 6)
- PA-4E (Ethernet, 4 ports)
- PA-8E (Ethernet, 8 ports)
- PA-4T+ (Serial, 4 ports)
- PA-8T (Serial, 8 ports)
- PA-A1 (ATM)
Cisco 3600 Network Module Description "<nm_desc>":
--------------------------------------------------
Format: slot:nm_driver
slot: the number of the physical slot (starts from 0)
nm_driver: the name of a Network Module driver in:
- NM-1E (Ethernet, 1 port)
- NM-4E (Ethernet, 4 ports)
- NM-1FE-TX (FastEthernet, 1 port)
- NM-4T (Serial, 4 ports)
- NM-16ESW (Ethernet switch module, 16 ports)
- Leopard-2FE (Cisco 3660 FastEthernet in slot 0, automatically used)
Cisco 2691/3725/3745 Network Module Description "<nm_desc>":
------------------------------------------------------------
Format: slot:nm_driver
slot: the number of the physical slot (starts from 0)
nm_driver: the name of a Network Module driver in:
- NM-1FE-TX (FastEthernet, 1 port)
- NM-4T (Serial, 4 ports)
- NM-16ESW (Ethernet switch module, 16 ports)
- GT96100-FE (2 integrated ports, automatically used)
NIO binding to Port Adapter "<pa_nio>" and Network Modules "<nm_nio>":
----------------------------------------------------------------------
Format: slot:port:netio_type[:netio_parameters]
slot : the number of the physical slot (starts from 0)
port : the port in the specified slot (starts from 0)
netio_type : host interface for communication
unix:<local_sock>:<remote_sock>
Use unix sockets for local communication.
<local_sock> is created and represents the local NIC.
<remote_sock> is the file used by the other interface.
(ex. "/tmp/local:/tmp/remote")
vde:<control_sock>:<local_sock>
For use with UML (User-Mode-Linux) or VDE switches.
VDE stands for "Virtual Distributed Ethernet".
Please refer to : http://sourceforge.net/projects/vde/
tap:<tap_name>
Use a virtual ethernet device for communication.
<tap_name> is the name of the tap device (ex. "tap0")
gen_eth:<dev_name>
Use a real ethernet device for communication, using libpcap 0.9
or WinPcap. Works on Windows and Unix systems.
<dev_name> is the name of the Ethernet device (ex. "eth0")
The device list can be found using the "-e" option.
linux_eth:<dev_name>
Use a real ethernet device for communication (Linux specific).
<dev_name> is the name of the Ethernet device (ex. "eth0")
udp:<local_port>:<remote_host>:<remote_port>
Use an UDP socket for connection between remote instances.
<local_port> is the port we listen to.
<remote_host> is the host listening the port you want to connect to.
<remote_port> is the port you want to connect to.
(ex. "1000:somehost:2000" and "2000:otherhost:1000" on the other
side)
tcp_cli:<host>:<port>
Client side of a tcp connection.
<host> is the ip address of the server.
<port> is the port to connect to.
tcp_ser:<port>
Server side of a tcp connection.
<port> is the port to listen to.
null
Dummy netio (used for testing/debugging), no parameters needed.
VTTY binding to real serial port device "<si_desc>":
----------------------------------------------------
Format: <device>{:baudrate{:databits{:parity{:stopbits{:hwflow}}}}}}
device: character device name, e.g. /dev/ttyS0
baudrate: baudrate
databits: number of databits.
parity: data parity: N=none, O=odd, E=even,
stopbits: number of stop bits
hwflow: hardware flow control (0=disable, 1=enable)
Note that the device field is mandatory, however other fields are optional.
(dynamips will default to 9600, 8, N, 1, no hardware flow control)
Note that access to the escape commands (described below) through a serial
port are deliberately prevented, as the escape commands interfere with
serial encapsulation protocols.
Escape commands
***************
You can press ^] (Ctrl + ]) at any time, followed by one of these characters:
o : Show the VM object list
d : Show the device list
r : Dump MIPS CPU registers
t : Dump MIPS TLB entries
m : Dump the latest memory accesses
s : Suspend CPU emulation
u : Resume CPU emulation
q : Quit the emulator
b : Dump the instruction block tree
h : JIT hash table statistics
l : MTS64 cache statistics
c : Write IOS configuration to disk (ios_cfg.txt)
j : Non-JIT mode statistics
i : Determine an idling pointer counter
x : Experimentations (can crash the box!)
^]: Send ^]
If you press an unrecognized key, help will be shown.
Note: on Windows, it may be the "Ctrl + $" sequence.
Virtual Bridge
**************
The virtual bridge is used to emulate a shared network between emulator
instances.
Any emulator instance can act as a virtual bridge.
The configuration file (specified by the "-b" option) contains a list of
NetIO descriptors, with the following syntax:
interface_name:netio_type[:netio_parameters]
Example:
# Connection to instance "I0"
I0:udp:10000:127.0.0.1:10001
# Connection to instance "I1"
I1:udp:10002:127.0.0.1:10003
# Connection to instance "I2"
I2:udp:10004:127.0.0.1:10005
The "I0" instance would be launched with the following parameters:
dynamips ios.bin -p 1:PA-FE-TX -s 1:0:udp:10001:127.0.0.1:10000
Virtual Ethernet switch
***********************
The virtual ethernet switch is used to emulate an Ethernet network between
emulator instances. This switch supports access and trunk ports (802.1Q).
ISL will be available in a future release.
Any emulator instance can act as a virtual ethernet switch.
The configuration file (specified by the "-E" option) contains a list of
NetIO descriptors (representing interfaces) and a list of interface properties
(access/trunk port, VLAN info...)
The interface definition is similar to Port Adapters:
IF:interface_name:netio_type[:netio_parameters]
1) Configuring an Access Port
syntax: ACCESS:interface_name:vlan_id
2) Configuration a 802.1Q Trunk Port
syntax: DOT1Q:interface_name:native_vlan
The native VLAN is not tagged. On Cisco devices, by default the native VLAN
is VLAN 1.
Example of configuration file:
IF:E0:udp:10000:127.0.0.1:10001
IF:E1:udp:10002:127.0.0.1:10003
IF:E2:gen_eth:eth0
DOT1Q:E0:1
ACCESS:E1:4
DOT1Q:E2:1
Virtual ATM switch
******************
The virtual ATM switch fabric is used to emulate an ATM backbone between
emulator instances. The use of this virtual switch is not mandatory, you
can directly connect emulator instances for point-to-point ATM connections.
Please note that only basic VP/VC switching is supported, there is no
support for ILMI/QSAAL/... or other specific ATM protocols.
Any emulator instance can act as a virtual ATM switch.
Example of configuration file (specified by the "-a" option):
# Virtual Interface List
IF:A0:udp:10001:127.0.0.1:10000
IF:A1:udp:10002:127.0.0.1:10003
IF:A2:udp:10004:127.0.0.1:10005
# VP connection between I0 and I1
VP:A0:10:A1:20
VP:A1:20:A0:10
# VP connection between I0 and I2
VP:A0:11:A2:30
VP:A2:30:A0:11
# VC connection between I1 and I2
VC:A1:5:2:A2:7:3
VC:A2:7:3:A1:5:2
In this example, we have 3 virtual interfaces, A0, A1 and A2. The syntax
for interface definition is similar to Port Adapters:
IF:interface_name:netio_type[:netio_parameters]
You can do VP switching or VC switching:
1) VP switching
syntax: VP:input_if:input_vpi:output_if:output_vpi
2) VC switching
syntax: VC:input_if:input_vpi:input_vci:output_if:output_vpi:output_vci
Testing the Virtual ATM switch with one dynamips instance
*********************************************************
(Contribution of Mtv Europe)
Virtual ATM switch configuration file ("atm.cfg"):
IF:A0:udp:10003:127.0.0.1:10001
IF:A1:udp:10004:127.0.0.1:10002
# a0/vpi=1/vci=100 connects to a1/vpi=2/vci=200
VC:A0:1:100:A1:2:200
VC:A1:2:200:A0:1:100
Invoking dynamips:
./dynamips -p 1:PA-A1 -s 1:0:udp:10001:127.0.0.1:10003 \
-p 2:PA-A1 -s 2:0:udp:10002:127.0.0.1:10004 \
-a atm.cfg IOS.BIN
(note input ports of IOS interfaces are output ports of ATM switch
interfaces, and vice versa).
IOS configuration:
ip cef
ip vrf test
rd 1:1
route-target both 1:1
int a1/0
no shut
int a1/0.2 p
ip addr 1.1.1.1 255.255.255.0
pvc 1/100
interface a2/0
no shut
interface a2/0.2 p
ip vrf forwarding test
ip addr 1.1.1.2 255.255.255.0
pvc 2/200
!
# ping 1.1.1.2
!!!!!
Virtual Frame-Relay switch
**************************
The virtual Frame-Relay switch fabric is used to emulate a Frame-Relay
backbone between emulator instances. The use of this virtual switch is not
mandatory, you can directly connect emulator instances with appropriate IOS
configuration.
Any emulator instance can act as a virtual Frame-Relay switch.
There is only a basic implementation of the LMI protocol (ANSI Annex D), which
is probably not conforming but works with Cisco IOS. Fortunately, Cisco IOS
is able to detect automatically the LMI protocol.
Example of configuration file (specified by the "-f" option):
# Virtual Interface List
IF:S0:udp:10001:127.0.0.1:10000
IF:S1:udp:10002:127.0.0.1:10003
# DLCI switching between S0 and S1
VC:S0:200:S1:100
VC:S1:100:S0:200
In this example, we have 2 virtual interfaces, S0 and S1. The syntax
for interface definition is similar to Port Adapters:
IF:interface_name:netio_type[:netio_parameters]
DLCI switching syntax:
VC:input_if:input_dlci:output_if:output_dlci
In the example above, the switch is configured to switch packets
received on interface S0 with DLCI 200 to interface S1 with DLCI 100,
and vice-versa.
== EOF ==
没有评论:
发表评论