Netemu 虚拟化先锋 's Archiver

simon 发表于 2007-7-1 20:57

VNUML and Dynamips/Dynagen mixed scenario (貌似是西班牙)

[[url=http://www.dit.upm.es/vnumlwiki/index.php?title=Example-Dyna&action=edit&section=1][color=#0000ff]edit[/color][/url]] Scenario This example will emulate the network scenario shown in the figure, where the hosts are emulated using VNUML virtual machines and the routers are CISCOs emulated using dynamips.
[url=http://www.dit.upm.es/vnumlwiki/index.php/Image:Network1.jpeg][img=711,293]http://www.dit.upm.es/vnumlwiki/images/6/6b/Network1.jpeg[/img][/url]
To create the scenario, you first have to download the vnuml and dynagen scenarios specifications (provided below) to a directory. Remember to modify "idlepc" values in the dynagen specification to adapt it to your optimum values.
Later, you can start the scenario by following this steps:
[list][*]Start VNUML scenario (hosts) with:[/list]vnumlparser.pl -t dynavnuml.xml -v -u root[list][*]If not already running, start dynamips daemon:[/list]dynamips -H 7200&[list][*]Start Dynagen scenario (routers) with:[/list]dynagen dynavnuml.net[list][*]Once started, open router consoles with:[/list]=> console /all[list][*]Enable router tap interfaces (they are automatically created by dynagen but not enabled):[/list]ifconfig r1-e00 up ifconfig r1-e01 up ifconfig r1-e02 up ifconfig r2-e00 up ifconfig r2-e01 up[list][*]Connect router interfaces with virtual bridges:[/list]brctl addif Net0 r1-e00 brctl addif Net1 r1-e01 brctl addif Net2 r1-e02 brctl addif Net2 r2-e00 brctl addif Net3 r2-e01[list][*]Configure the routers, loading the configurations shown below. To do that, you have to:[/list]enable conf t    ...paste router config commands exit exit write


After the write is executed, the configuration is saved, so next time the route starts it will load that configuration.
The scenario is ready for testing. For example, you can login to H1 and test the connectivity with H4:
H1:~# ping 10.1.3.10PING 10.1.3.10 (10.1.3.10) 56(84) bytes of data.64 bytes from 10.1.3.10: icmp_seq=1 ttl=62 time=35.1 ms64 bytes from 10.1.3.10: icmp_seq=2 ttl=62 time=46.2 ms64 bytes from 10.1.3.10: icmp_seq=3 ttl=62 time=70.0 ms--- 10.1.3.10 ping statistics ---3 packets transmitted, 3 received, 0% packet loss, time 2034msrtt min/avg/max/mdev = 35.128/50.461/70.020/14.556 ms[[url=http://www.dit.upm.es/vnumlwiki/index.php?title=Example-Dyna&action=edit&section=2][color=#0000ff]edit[/color][/url]] Additional tips [list][*]You can save router configurations to a file by means of the command:[/list]export /all /root/vnuml/tests/vnuml-dynamips/config[list][*]Besides, you can save configurations as base64 encoded blobs in your network file This allows the distribution of router configurations together with network topology in the .net file. To do it, just execute the command:[/list]save /all /root/vnuml/tests/vnuml-dynamips/config[[url=http://www.dit.upm.es/vnumlwiki/index.php?title=Example-Dyna&action=edit&section=3][color=#0000ff]edit[/color][/url]] VNUML Description File dynavnuml.xml:
save /all /root/vnuml/tests/vnuml-dynamips/config
[edit] VNUML Description
File dynavnuml.xml:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE vnuml SYSTEM "/usr/share/xml/vnuml/vnuml.dtd">

<vnuml>
  <global>
    <version>1.7</version>
    <simulation_name>dynavnuml</simulation_name>
    <automac/>
    <vm_mgmt type="none" />
    <vm_defaults>
       <filesystem type="cow">/usr/share/vnuml/filesystems/root_fs_tutorial</filesystem>
       <kernel>/usr/share/vnuml/kernels/linux</kernel>
       <console id="0">xterm</console>
       <!--xterm>gnome-terminal,-t,-x</xterm-->
    </vm_defaults>
  </global>

  <net name="Net0" mode="virtual_bridge" />
  <net name="Net1" mode="virtual_bridge" />
  <net name="Net2" mode="virtual_bridge" />
  <net name="Net3" mode="virtual_bridge" />

  <vm name="H1">
    <xterm>xterm,-T H1,-e</xterm>
    <if id="1" net="Net1">
      <ipv4 mask="255.255.255.0">10.1.1.10</ipv4>
    </if>
    <route type="ipv4" gw="10.1.1.1">default</route>
  </vm>

  <vm name="H2">
    <xterm>xterm,-T H2,-e</xterm>
    <if id="1" net="Net1">
      <ipv4 mask="255.255.255.0">10.1.1.11</ipv4>
    </if>
    <route type="ipv4" gw="10.1.1.1">default</route>
  </vm>

  <vm name="H3">
    <xterm>xterm,-T H3,-e</xterm>
    <if id="1" net="Net2">
      <ipv4 mask="255.255.255.0">10.1.2.10</ipv4>
    </if>
    <route type="ipv4" gw="10.1.2.1">default</route>
  </vm>

  <vm name="H4">
    <xterm>xterm,-T H4,-e</xterm>
    <if id="1" net="Net3">
      <ipv4 mask="255.255.255.0">10.1.3.10</ipv4>
    </if>
    <route type="ipv4" gw="10.1.3.1">default</route>
  </vm>

  <host>
    <hostif net="Net0">
      <ipv4 mask="255.255.255.0">10.1.0.10</ipv4>
    </hostif>
    <route type="ipv4" gw="10.1.0.1">10.0.0.0/16</route>
  </host>

</vnuml>
[edit] Dynagen Description
File dynavnuml.net:

# VNUML-Dynagen example
[localhost]
   
    [[3640]]
        image = /usr/share/vnuml/filesystems/c3640
        ram = 96
   
    [[ROUTER R1]]
        e0/0 = NIO_tap:r1-e00
        e0/1 = NIO_tap:r1-e01
        e0/2 = NIO_tap:r1-e02
        model = 3640
        slot1 = NM-4E
        idlepc = 0x605d2350
   
    [[ROUTER R2]]
        e0/0 = NIO_tap:r2-e00
        e0/1 = NIO_tap:r2-e01
        model = 3640
        slot1 = NM-4E
        idlepc = 0x605d2350
[edit] Router configurations
R1:

hostname R1
no ip domain lookup

interface e0/0
ip address 10.1.0.1 255.255.255.0
no shutdown
interface e0/1
ip address 10.1.1.1 255.255.255.0
no shutdown
interface e0/2
ip address 10.1.2.1 255.255.255.0
no shutdown

ip route 10.1.3.0 255.255.255.0 10.1.2.2

line vty 0
password xxxx
login
R2:

hostname R2
no ip domain lookup

interface e0/0
ip address 10.1.2.2 255.255.255.0
no shutdown
interface e0/1
ip address 10.1.3.1 255.255.255.0
no shutdown

ip route 10.1.0.0 255.255.255.0 10.1.2.1
ip route 10.1.1.0 255.255.255.0 10.1.2.1

line vty 0
password xxxx
login
[edit] Download

simon 发表于 2007-7-1 20:58

y078[size=1.65em][b]Download [/b][/size]
Note: Please, be aware that this is beta software. It has been developed and mainly tested over Suse 8.1/8.2/9.0/9.1/9.3/10.0 Linux distribution, although it should work (maybe with minor modifications) over other Linux distributions (successfull tests over Red Hat 7.3/8.0/9.0 and FC4, Slackware 8.1, Mandrake 10.0 and Debian 3.0/3.1 have been already done). [email=vnuml-at-dit.upm.es][color=#0000ff]Let us know[/color][/email] if you test VNUML over other distributions to include the information here.
About VNUML versions:
[list][*]VNUML language (in fact the DTD for the VNUML files) is identified by two version numbers, for example, VNUML DTD 1.2.[*]VNUML parser is identified by three version numbers. The first two numbers refers to the VNUML DTD version the parser works with. For example, vnumlparser.pl 1.2.1 works with VNUML DTD 1.2 files.[*]The first public releases were VNUML DTD 1.2 and vnumlparser.pl 1.2.1.[/list]You can also get [url=http://www.dit.upm.es/vnumlwiki/index.php/Old_Releases][color=#0000ff]old releases[/color][/url], but you should use always the newest stable release.
[table=90%][tr][td][b]VNUML Downloads[/b] [/td][/tr][tr][td]VNUML Current Release [/td][/tr][tr][td]VNUML releases are hosted at SourceForge. [url=http://sourceforge.net/project/showfiles.php?group_id=113582&package_id=123470][color=#0000ff]Here is the complete list[/color][/url].
Current stable release is [url=http://prdownloads.sourceforge.net/vnuml/vnuml-1.8.1.orig.tar.gz?download][color=#0000ff]1.8.1[/color][/url] (25/05/2007).
If you are using a .deb based distro (like Debian or Ubuntu) you can install VNUML using APT. Just add the following to your sources.list file:
deb [url]http://jungla.dit.upm.es/~vnuml/debian[/url] binary/and update and install 'vnuml' package. [url=http://www.dit.upm.es/vnumlwiki/index.php/Installation#Installing_from_.deb_package][color=#0000ff]Details here[/color][/url].
Testing releases use a different APT repository:
deb [url]http://jungla.dit.upm.es/~vnuml/debian-testing[/url] binary/[/td][/tr][tr]UML Kernels [/tr][tr][td]UML kernels are hosted at SourceForge. [url=http://sourceforge.net/project/showfiles.php?group_id=113582&package_id=128763][color=#0000ff]Here is the complete list[/color][/url].
Current UML kernel is [url=http://prdownloads.sourceforge.net/vnuml/linux-2.6.18.1-bb2-xt-1m.tar.bz2?download][color=#0000ff]linux-2.6.18.1-bb2-xt-1m[/color][/url] (23/03/2007).
[/td][/tr][tr]Root filesystems [/tr][tr][td]Root Filesystems are hosted at SourceForge. [url=http://sourceforge.net/project/showfiles.php?group_id=113582&package_id=122995][color=#0000ff]Here is the complete list[/color][/url].
Current root_fs is [url=http://prdownloads.sourceforge.net/vnuml/root_fs_tutorial-0.4.1.bz2?download][color=#0000ff]0.4.1[/color][/url] (24/10/2006).
The root password for the filesystems is: xxxx
[/td][/tr][tr]Live CD/DVD [/tr][tr][td]VNUML Live CD/DVDs are hosted at SourceForge. [url=http://sourceforge.net/project/showfiles.php?group_id=113582&package_id=169893][color=#0000ff]Here is the complete list[/color][/url].
Latest version is [url=http://downloads.sourceforge.net/vnuml/vnuml-live-2.1.iso][color=#0000ff]VNUML Live 2.1[/color][/url] (30/04/2007). You can have a look at the [url=http://sourceforge.net/project/shownotes.php?release_id=504983&group_id=113582][color=#0000ff]README file[/color][/url].
[b]IMPORTANT NOTE[/b]: if you plan to install VNUML-Live-DVD on your hard disk, take into account the user creation known issue described [url=http://www.dit.upm.es/vnumlwiki/index.php/Live_cd][color=#0000ff]here[/color][/url].
To start VNUML Live DVD from inside VMware, you can use this [url=http://downloads.sourceforge.net/vnuml/vnuml-live-2.1-vmplayer.zip][color=#0000ff]file[/color][/url].
[/td][/tr][tr]VNUML Virtual Appliance for VMware [/tr][tr][td]We have created a VMware based virtual appliance starting from VNUML-Live-DVD following the procedure described [url=http://www.dit.upm.es/vnumlwiki/index.php/Livedvd-install-vmware][color=#0000ff]here[/color][/url].
Latest version is: [url=ftp://ftp.dit.upm.es/vnuml/ubuntu-vnuml-2.1.zip][color=#0000ff]VNUML Virtual Appliance 2.1[/color][/url]. See [url=http://www.dit.upm.es/vnumlwiki/index.php/Live_cd][color=#0000ff]how to use it[/color][/url]
[/td][/tr][/table]

页: [1]

Powered by Discuz! Archiver 7.0.0  © 2001-2009 Comsenz Inc.