当初上CCIE课程的时候老师曾建议有志于考试的同学联合起来,共同出资购买二手Cisco设备,一起做实验。有了Linux + Dynamips/Dynagen + VNUML,可极大减少考试的经济压力。
Dynamips是一个虚拟Cisco设备软件,当前除了可虚拟Cisco 7200外,还可虚拟Cisco 3600系列(3620, 3640, 3660),3700系列(3725,3745),以及2600系列(2610到2650XM,2691)。与别的虚拟软件不同,它虚拟的Cisco设备可直接运行Cisco IOS。由于版权关系,Cisco IOS需要单独获取。
Dynagen是Dynamips的操作界面,可降低使用Dynamips的难度,另外还增加了少许功能,比如IOS的reload。
VNUML(Virtual Network User Mode Linux)是基于UML(User Mode Linux)组件虚拟网络的工具,你可把网络拓扑写到一个XML文件,VNUML可自动帮你创建Bridge设备,创建TAP接口,启动UML。
你可遵循如下步骤体验一把:
1. 从
http://www.ipflow.utc.fr/index.php/Cisco_7200_Simulator 下载Dynamips,是一个二进制文件,可直接运行
2. 获取Cisco IOS image
3. 从
http://dynagen.org/下载 Dynagen
4. 按照
http://dynagen.org/tutorial.htm 可以进行基本的实验了
5. 从
http://www.dit.upm.es/vnumlwiki/index.php/Main_Page 获取如何安装VNUML
6. 组件复杂网络,如下图
Dynagen还有一个图形化的管理工具,dynagui (
http://dynagui.sourceforge.net/ ),我没怎么用过。
相关链接Dynamips项目介绍
http://www.ipflow.utc.fr/index.php/Cisco_7200_SimulatorDynamips论坛
http://7200emu.hacki.at/Dynagen主页
http://dynagen.org/VNUML主页
http://www.dit.upm.es/vnumlwiki/index.php/Main_PageLinux UML主页
http://user-mode-linux.sourceforge.net/使用Dynmips备考 CCIE实验
http://www.internetworkexpert.com/resources/iosonpc.htm
Comments
Thu, 2007-07-19 05:49 — Marchday
uml和xterm的问题
vnumlparser.pl在启动uml的时候,偶尔会出现弹出空白xterm窗口然后超时的问题。新版本的vnumlparser.pl在启动uml的时候把控制台设置为pts,从而绕开了这个问题。如果你仍使用老版本的vnumlparser.pl,可尝试如下的解决办法:
Dear Rafael, Yingyuan,
> > i meet with the same situation as
> >
https://lists.dit.upm.es/piperma ... 07-May/000626.html.>
> In my opinion, this _known_ problem on VNUML has the following concerns:
>
> - use -Z to avoid vnumlization of file system (Ctr+C).
>
> - Purge (-P) simulation directory, in case of forced release.
>
> - run always as root, and use -u root.
We are working in a UML kernel that it's supposed to solve the Ctr+C problem (in other words, using that kernel for virtual machines you don't need to use -Z or type Ctrl+C at each vm).
An official release has not been provided yet because there are some unsolved issues (in particular, the kernel lacks some key functionalities, like the mconsole direct command execution, because we need patches that were seems abandoned since 2.6.18.1, see [url]http://www.mail-archive.com/user-
mode-linux-user@lists.sourceforge.net/msg05196.html[/url] for details).
However, a "dirty" devel package (kernel binary + modules that need to be installed in /lib/modules on the root_fs) can be downloaded at:
http://jungla.dit.upm.es/~vnuml/ ... xt-2m-devel.tar.bz2Please, in the case you try it, tell us if the "Ctrl+C" problem is solved.
> > when i run 'vnumlparser.pl -t test.xml -v -u root' , it goes OK
> > sometimes, but sometimes it times out when launching the second
> > or third
> > uml, leaving me a blank gnome-terminal window with messages following:
>
>
> - and lastly, the aberrant/weak support/behaviour of uml for xterm.
>
>
http://www.dit.upm.es/vnumlwiki/index.php/Reference>
> *Warning:* tests have shown that booting with xterm binary (usuallly in /usr/X11R6/bin/xterm) can be unstable under certain conditions. If you are using <console id="/n/">xterm</console> and you are having weird problems (UML hanging, xterms poping up but no text appear inside, xterms not popping up, etc.) using a differente xterm program with <xterm> <
http://www.dit.upm.es/vnumlwiki/index.php/Reference#.3Cxterm.3E> (for example, gnome-terminal) is recommended.
>
>
> I give up. Even changing to gnome-xterm, some times it works, others does not.
>
> In my experience, it is fustrating to boot up to 26 machines, (taking half an hour), and hanging on 24th...
>
>
> Then, what I do ?
>
> Ignore x-term, try to boot using the tag
>
> <console id="0">pts</console>
>
> instead of your, (already commented)
>
> <!--console id="0">xterm</console-->
>
> Then , boot the scenario with this command.
>
> vnumlparser.pl -t test.xml -v -u root -w 0 -Z -e test.screen
(Just a minor comment: '-w 0' and '-u root' are not a must -at least in my system :)- but recommendable anyway).
> This ALWAYS WORK, though you don't have any terminal to interact.
>
> Let's open some terminals...
> Apply the attached script to the given file on "-e" option (i.e test.screen)
>
> #chmod +x startTerminal.sh
> #./startTerminal.sh test.screen
>
> If things go well, you will be prompted four termianals, uml1, uml2, uml3, uml4...
> (Type <Enter> on each of them and the login should appear...)
>
> Fermin, David: I see, this is a clumsy way to bootup xterms, and gnome-terminals, but xterm support for UML is weak and
> unstable... If some times works and others does not, most probably is a problem of concurrency and relative speed of processes, coded on the xterm.c driver on uml sources. Take in mind that UML users ussually boots a virtual machine, so this problem may not arise so frequent , but I'm not an expert on UML.
Great! It seems you have provided a smart solution to a years old problem :) I agree how frustrating is to redo the entire scenario just because one of your twenty of thirty virtual machines has failed opening the xterm.
I attach an slightly modified version of your script, able to do the same, but using xterm instead of gnome-terminal (useful if you don't have Gnome installed).
> However, maybe, in future releases, you can integrate this script with a Perl flavour at vnumlparser.pl, and drop the conflictive xterm...
>
> What do you think ?
I agree, this should be implemented in VNUML, but without changing the current semantic. I mean:
1. <console id="n">pts</console>, as now
2. <console id="n">xterm</console>, it will be implemented like the former, but, additionally a xterm will be launched using the pts descriptor, just after the vm booting. From the point of view of the user, there would be no difference regarding the way it is done now (execpt, of course, now xterms always work :)
I think a proof-of-concept could be provided in a VNUML beta coming soon.
Best regards,
------
Fermín 附带的脚本(startTerminal-xterm.sh)内容如下:
#!/bin/sh
if [ $# -ne 1 ]
then
echo Usage "startTerminals <file screen>"
exit 1
fi
LIMIT=`wc -l $1 | cut -f 1 -d " "`
filescreen=$1
for ((i=1; i <= LIMIT ; i++)) # The comma chains together operations.
do
command=`head -$i $filescreen | tail -1`
echo $command
xterm -T uml$i -e $command &
done
reply
http://www.devfront.com/?q=node/300原文: