Difference between revisions of "Example-basic"

From VNUML-WIKI
Jump to: navigation, search
(Scenario)
 
(35 intermediate revisions by 3 users not shown)
Line 5: Line 5:
 
  '''Fermín Galán (galan at dit.upm.es)'''
 
  '''Fermín Galán (galan at dit.upm.es)'''
 
  '''David Fernández (david at dit.upm.es)'''
 
  '''David Fernández (david at dit.upm.es)'''
  '''version 1.7, November 21st, 2006'''
+
  '''version 1.8, October 3rd, 2007'''
 
</big>
 
</big>
  
Line 13: Line 13:
 
== Scenario ==
 
== Scenario ==
  
Following example builds the basic topology shown in figure. We provide an [basic-ipv4.xml IPv4 version] and a [basic-ipv6.xml IPv6 version]. The IPv6 version is slightly different; it uses the eth0 host interface as external connection for UML3.
+
The following example builds the basic topology shown in the figures. We provide an IPv4 version and an IPv6 version. The IPv6 version is slightly different; it uses the eth0 host interface as external connection for UML3.
  
Note that the /root/uml1-conf directory must exists in the host machine in order the [[Reference#<filetree>|<filetree>]] tag works in UML1 (for example, you can create it with 'mkdir /root/uml1-conf' and create and empty file inside with 'touch /root/uml1-conf/foobar.conf' to test). In addition, the [[Reference#<exec>|<exec>] tags are intented to test the command execution mode (more information in the [[Usermanual#Execute_Commands|User Manual]]). For example, use 'vnumlparser.pl -x start@basic.xml -v' to run the commands with seq="start" (in addition, the /root/uml1-conf file will be copied to the virtual machine uml1) and 'vnumlparser.pl -x stop@basic.xml -v' to run the commands with seq="stop".
+
Note that the /tmp/uml1-conf directory must exists in the host machine in order for the [[Reference#<filetree>|<filetree>]] tag to work in UML1 (for example, you can create it with 'mkdir /tmp/uml1-conf' and create and empty file inside with 'touch /tmp/uml1-conf/foobar.conf' to test). In addition, the [[Reference#<exec>|<exec>]] tags are intented to test the command execution mode (more information in the [[Usermanual#Execute_Commands|User Manual]]). For example, use 'vnumlparser.pl -x start@basic.xml -v' to run the commands with seq="start" (in addition, the content of /root/uml1-conf directory will be copied to the virtual machine uml1) and 'vnumlparser.pl -x stop@basic.xml -v' to run the commands with seq="stop".
  
<center>[[Image:basic-ipv4.png|Basic IPv4]]</center><br />
+
Before running the IPv6 version you have to edit the specification and change the IP data inside the <host> section to reflect your settings (in this example, 10.1.1.200/24 is the address/mask of the host and 10.1.1.1 the ip address of the router).
 +
 
 +
In both examples xterm consoles are disabled, so you have to access virtual machines using ssh from the host, for example:
 +
 
 +
  host> slogin uml1
  
 
<center>
 
<center>
[[Image:basic-ipv6.png|Basic IPv6]]
+
[[Image:basic-ipv4.png|Basic IPv4]]<br />
</center><br />
+
'''Figure 1: Basic IPv4 scenario'''
 +
 
 +
 
 +
[[Image:basic-ipv6.png|center|Basic IPv6]]
 +
'''Figure 2: Basic IPv6 scenario'''
 +
 
 +
</center>
 +
<br/>
  
 
== VNUML Description (IPv4) ==
 
== VNUML Description (IPv4) ==
  
<?xml version="1.0" encoding="UTF-8"?>
+
<pre>
<!DOCTYPE vnuml SYSTEM "/usr/share/xml/vnuml/vnuml.dtd">
+
 
   
+
<?xml version="1.0" encoding="UTF-8"?>
  <vnuml>
+
<!DOCTYPE vnuml SYSTEM "/usr/share/xml/vnuml/vnuml.dtd" [
    <global>
+
  <!ENTITY VNUMLDIR "/usr/share/vnuml/">
      <version>1.7</version>
+
  <!ENTITY BASEDIR "/usr/share/vnuml/examples/basic/">
      <simulation_name>basic</simulation_name>
+
  <!ENTITY REDIR "&lt;/dev/null &gt;/dev/null 2&gt;&amp;1 &amp;">
      <ssh_key>/root/.ssh/identity.pub</ssh_key>
+
]>
+
<vnuml>
      <automac offset="0"/>
+
 
      <vm_mgmt type="private" network="192.168.0.0" mask="24" offset="100">
+
  <global>
+
      <version>1.8</version>
          <host_mapping/>
+
      <simulation_name>basic</simulation_name>
      </vm_mgmt>
+
      <ssh_key>/root/.ssh/identity.pub</ssh_key>
      <vm_defaults>
+
      <automac offset="0"/>
          <filesystem type="cow">/usr/share/vnuml/filesystems/root_fs_tutorial</filesystem>
+
      <vm_mgmt type="private" network="192.168.0.0" mask="24" offset="100">
          <shell>/bin/sh</shell>         
+
        <host_mapping/>
      </vm_defaults>
+
      </vm_mgmt>
+
      <vm_defaults>
    </global>
+
        <filesystem type="cow">&VNUMLDIR;filesystems/root_fs_tutorial</filesystem>
    <net name="Net0" mode="uml_switch" />
+
        <kernel>&VNUMLDIR;kernels/linux</kernel>
    <net name="Net1" mode="uml_switch"/>
+
        <shell>/bin/sh</shell>         
+
      </vm_defaults>
    <net name="Net2" mode="uml_switch"/>
+
  </global>
    <net name="Net3" mode="uml_switch"/>
+
 
    <vm name="uml1">
+
  <net name="Net0" mode="uml_switch"/>
+
  <net name="Net1" mode="uml_switch"/>
      <mem>50M</mem>
+
  <net name="Net2" mode="uml_switch"/>
      <if id="1" net="Net0">
+
  <net name="Net3" mode="virtual_bridge"/>
          <ipv4>10.0.0.1</ipv4>
+
 
+
  <vm name="uml1">
      </if>
+
      <mem>50M</mem>
      <route type="ipv4" gw="10.0.0.3">default</route>
+
      <if id="1" net="Net0">
      <filetree root="/" when="start">/root/uml1-conf</filetree>
+
        <ipv4>10.0.0.1</ipv4>
+
      </if>
      <exec seq="start" type="verbatim">ls</exec>
+
      <route type="ipv4" gw="10.0.0.3">default</route>
      <exec seq="start" type="verbatim">pwd</exec>
+
      <filetree root="/" seq="start">/tmp/uml1-conf</filetree>
+
      <exec seq="start" type="verbatim">ls</exec>
      <exec seq="start" type="verbatim">touch /root/example.start</exec>
+
      <exec seq="start" type="verbatim">pwd</exec>
      <exec seq="stop" type="verbatim">rm /root/example.start</exec>
+
      <exec seq="start" type="verbatim">touch /root/example.start</exec>
+
      <exec seq="stop" type="verbatim">rm /root/example.start</exec>
      <exec seq="stop" type="verbatim">touch /root/example.stop</exec>
+
      <exec seq="stop" type="verbatim">touch /root/example.stop</exec>
    </vm>
+
  </vm>
    <vm name="uml2">
+
 
      <if id="1" net="Net0">
+
  <vm name="uml2">
+
      <if id="1" net="Net0">
          <ipv4>10.0.0.2</ipv4>
+
        <ipv4>10.0.0.2</ipv4>
      </if>
+
      </if>
      <route type="ipv4" gw="10.0.0.3">default</route>
+
      <route type="ipv4" gw="10.0.0.3">default</route>
+
  </vm>
    </vm>
+
 
    <vm name="uml3">
+
  <vm name="uml3">
      <if id="1" net="Net0">
+
      <if id="1" net="Net0">
          <ipv4>10.0.0.3</ipv4>
+
        <ipv4>10.0.0.3</ipv4>
+
      </if>
      </if>
+
      <if id="2" net="Net1">
      <if id="2" net="Net1">
+
        <ipv4>10.0.1.1</ipv4>
          <ipv4>10.0.1.1</ipv4>
+
      </if>
      </if>
+
      <if id="3" net="Net3">
+
        <ipv4>10.0.3.1</ipv4>
      <if id="3" net="Net3">
+
      </if>
          <ipv4>10.0.3.1</ipv4>
+
      <route type="ipv4" gw="10.0.1.2">10.0.2.0/24</route>
      </if>
+
      <route type="ipv4" gw="10.0.3.2">default</route>
      <route type="ipv4" gw="10.0.1.2">10.0.2.0/24</route>
+
      <forwarding type="ip"/>
+
  </vm>
      <route type="ipv4" gw="10.0.3.2">default</route>
+
 
      <forwarding type="ip"/>
+
  <vm name="uml4">
    </vm>
+
      <if id="1" net="Net1">
+
        <ipv4>10.0.1.2</ipv4>
    <vm name="uml4">
+
      </if>
      <if id="1" net="Net1">
+
      <if id="2" net="Net2">
          <ipv4>10.0.1.2</ipv4>
+
        <ipv4>10.0.2.1</ipv4>
      </if>
+
      </if>
+
      <route type="ipv4" gw="10.0.1.1">default</route>
      <if id="2" net="Net2">
+
      <forwarding type="ip"/>
          <ipv4>10.0.2.1</ipv4>
+
  </vm>
      </if>
+
 
      <route type="ipv4" gw="10.0.1.1">default</route>
+
  <vm name="uml5">
+
      <if id="1" net="Net2">
      <forwarding type="ip"/>
+
        <ipv4 mask="255.255.255.0">10.0.2.2</ipv4>
    </vm>
+
      </if>
    <vm name="uml5">
+
      <route type="ipv4" gw="10.0.2.1">default</route>
      <if id="1" net="Net2">
+
  </vm>
+
 
          <ipv4 mask="255.255.255.0">10.0.2.2</ipv4>
+
  <host>
      </if>
+
      <hostif net="Net3">
      <route type="ipv4" gw="10.0.2.1">default</route>
+
        <ipv4>10.0.3.2</ipv4>
+
      </hostif>
    </vm>
+
      <route type="ipv4" gw="10.0.3.1">10.0.0.0/16</route>
    <host>
+
  </host>
      <hostif net="Net3">
+
 
          <ipv4>10.0.3.2</ipv4>
+
</vnuml>
      </hostif>
+
 
+
</pre>
      <route type="ipv4" gw="10.0.3.1">10.0.0.0/16</route>
 
    </host>
 
</vnuml>
 
  
 
== VNUML Description (IPv6) ==
 
== VNUML Description (IPv6) ==
  
<?xml version="1.0" encoding="UTF-8"?>
+
<pre>
<!DOCTYPE vnuml SYSTEM "/usr/share/xml/vnuml/vnuml.dtd">
+
 
   
+
<?xml version="1.0" encoding="UTF-8"?>
  <vnuml>
+
<!DOCTYPE vnuml SYSTEM "/usr/share/xml/vnuml/vnuml.dtd"
    <global>
+
[
      <version>1.7</version>
+
  <!ENTITY VNUMLDIR "/usr/share/vnuml/">
      <simulation_name>basic</simulation_name>
+
  <!ENTITY BASEDIR "/usr/share/vnuml/examples/basic/">
      <ssh_key>/root/.ssh/identity.pub</ssh_key>
+
  <!ENTITY REDIR "&lt;/dev/null &gt;/dev/null 2&gt;&amp;1 &amp;">
+
]>
      <automac offset="0"/>
+
 
      <vm_mgmt type="private" network="192.168.0.0" mask="24" offset="0">
+
<vnuml>
+
 
          <host_mapping/>
+
  <global>
      </vm_mgmt>
+
      <version>1.8</version>
      <vm_defaults>
+
      <simulation_name>basic</simulation_name>
          <filesystem type="cow">/usr/share/vnuml/filesystems/root_fs_tutorial</filesystem>
+
      <ssh_key>/root/.ssh/identity.pub</ssh_key>
          <shell>/bin/sh</shell>
+
      <automac offset="0"/>
+
      <vm_mgmt type="private" network="192.168.0.0" mask="24" offset="0">
      </vm_defaults>
+
        <host_mapping/>
    </global>
+
      </vm_mgmt>
    <net name="Net0" mode="uml_switch" />
+
      <vm_defaults>
    <net name="Net1" mode="uml_switch" />
+
        <filesystem type="cow">&VNUMLDIR;filesystems/root_fs_tutorial</filesystem>
+
        <kernel>&VNUMLDIR;kernels/linux</kernel>
    <net name="Net2" mode="uml_switch" />
+
        <shell>/bin/sh</shell>
    <net name="Net3" mode="virtual_bridge" external="eth0" />
+
      </vm_defaults>
+
  </global>
    <vm name="uml1">
+
 
      <mem>50M</mem>
+
  <net name="Net0" mode="uml_switch" />
      <if id="1" net="Net0">
+
  <net name="Net1" mode="uml_switch" />
          <ipv6>3ffe:ffff:0::1/48</ipv6>
+
  <net name="Net2" mode="uml_switch" />
+
  <net name="Net3" mode="virtual_bridge" external="eth0" />
      </if>
+
 
      <route type="ipv6" gw="3ffe:ffff:0::3">2000::/3</route>
+
  <vm name="uml1">
      <filetree root="/" when="start">/root/uml1-conf</filetree>
+
      <mem>50M</mem>
+
      <if id="1" net="Net0">
      <exec seq="start" type="verbatim">ls</exec>
+
        <ipv6>2001:db8:0::1/64</ipv6>
      <exec seq="start" type="verbatim">pwd</exec>
+
      </if>
+
      <route type="ipv6" gw="2001:db8:0::3">2000::/3</route>
      <exec seq="start" type="verbatim">touch /root/example.start</exec>
+
      <filetree root="/" seq="start">/tmp/uml1-conf</filetree>
      <exec seq="stop" type="verbatim">rm /root/example.start</exec>
+
      <exec seq="start" type="verbatim">ls</exec>
+
      <exec seq="start" type="verbatim">pwd</exec>
      <exec seq="stop" type="verbatim">touch /root/example.stop</exec>
+
      <exec seq="start" type="verbatim">touch /root/example.start</exec>
    </vm>
+
      <exec seq="stop" type="verbatim">rm /root/example.start</exec>
    <vm name="uml2">   
+
      <exec seq="stop" type="verbatim">touch /root/example.stop</exec>
      <if id="1" net="Net0">
+
  </vm>
+
 
          <ipv6>3ffe:ffff:0::2/48</ipv6>
+
  <vm name="uml2">   
      </if>
+
      <if id="1" net="Net0">
      <route type="ipv6" gw="3ffe:ffff:0::3">2000::/3</route>
+
        <ipv6>2001:db8:0::2/64</ipv6>
+
      </if>
    </vm>
+
      <route type="ipv6" gw="2001:db8:0::3">2000::/3</route>
    <vm name="uml3">   
+
  </vm>
      <if id="1" net="Net0">
+
 
          <ipv6>3ffe:ffff:0::3/48</ipv6>
+
  <vm name="uml3">   
+
      <if id="1" net="Net0">
      </if>
+
        <ipv6>2001:db8:0::3/64</ipv6>
      <if id="2" net="Net1">
+
      </if>
          <ipv6>3ffe:ffff:1::3/48</ipv6>
+
      <if id="2" net="Net1">
      </if>
+
        <ipv6>2001:db8:1::3/64</ipv6>
+
      </if>
      <if id="3" net="Net3">
+
      <if id="3" net="Net3">
          <ipv6>3ffe:ffff:3::3/48</ipv6>
+
        <ipv6>2001:db8:3::3/64</ipv6>
      </if>
+
      </if>
      <route type="ipv6" gw="3ffe:ffff:1::4">3ffe:ffff:2::/48</route>
+
      <route type="ipv6" gw="2001:db8:1::4">2001:db8:2::/64</route>
+
      <route type="ipv6" gw="2001:db8:3::254">2000::/3</route>
      <route type="ipv6" gw="3ffe:ffff:3::254">2000::/3</route>
+
      <forwarding type="ipv6"/>
      <forwarding type="ipv6"/>
+
      <exec seq="start" type="verbatim">touch filesample</exec>
      <exec seq="start" type="verbatim">touch filesample</exec>
+
  </vm>
+
 
    </vm>
+
  <vm name="uml4">   
    <vm name="uml4">   
+
      <if id="1" net="Net1">
      <if id="1" net="Net1">
+
        <ipv6>2001:db8:1::4/64</ipv6>
          <ipv6>3ffe:ffff:1::4/48</ipv6>
+
      </if>
+
      <if id="2" net="Net2">
      </if>
+
        <ipv6>2001:db8:2::4/64</ipv6>
      <if id="2" net="Net2">
+
      </if>
          <ipv6>3ffe:ffff:2::4/48</ipv6>
+
      <route type="ipv6" gw="2001:db8:1::3">2000::/3</route>
      </if>
+
      <forwarding type="ipv6"/>
+
  </vm>
      <route type="ipv6" gw="3ffe:ffff:1::3">2000::/3</route>
+
 
      <forwarding type="ipv6"/>
+
  <vm name="uml5">
    </vm>
+
      <if id="1" net="Net2">
+
        <ipv6>2001:db8:2::5/64</ipv6>
    <vm name="uml5">
+
      </if>
      <if id="1" net="Net2">
+
      <route type="ipv6" gw="2001:db8:2::4">2000::/3</route>
          <ipv6>3ffe:ffff:2::5/48</ipv6>
+
  </vm>
      </if>
+
 
+
  <host>
      <route type="ipv6" gw="3ffe:ffff:2::4">2000::/3</route>
+
      <hostif net="Net3">
    </vm>
+
        <ipv4 mask="255.255.255.0">10.1.1.200</ipv4>
    <host>
+
        <ipv6>2001:db8:3::254/64</ipv6>
      <hostif net="Net3">
+
      </hostif>
+
      <physicalif name="eth0" type="ipv4" ip="10.1.1.200" mask="255.255.255.0" gw="10.1.1.1"/>
          <ipv4 mask="255.255.255.192">138.4.7.148</ipv4>
+
      <route type="ipv4" gw="10.1.1.1">default</route>
          <ipv6>3ffe:ffff:3::254/48</ipv6>
+
      <route type="ipv6" gw="2001:db8:3::3">2001:db8::/32</route>
      </hostif>
+
  </host>
      <physicalif name="eth0" type="ipv4" ip="138.4.7.148" mask="255.255.255.192" gw="138.4.7.189"/>
+
</vnuml>
+
 
      <route type="ipv4" gw="138.4.7.189">default</route>
+
</pre>
      <route type="ipv6" gw="3ffe:ffff:3::3">3ffe:ffff::/32</route>
 
 
    </host>
 
</vnuml>
 
  
 +
== Download ==
  
 +
* VNUML specification file: [http://jungla.dit.upm.es/~vnuml/doc/examples/basic/basic-ipv4.xml basic-ipv4.xml]
 +
* VNUML specification file: [http://jungla.dit.upm.es/~vnuml/doc/examples/basic/basic-ipv6.xml basic-ipv6.xml]
  
 
== Old Releases ==
 
== Old Releases ==
Line 235: Line 242:
 
* [http://jungla.dit.upm.es/~vnuml/doc/examples/basic/1.3/tutorial.html 1.3] (note that in this version the example was named "Tutorial" instead of "Basic").
 
* [http://jungla.dit.upm.es/~vnuml/doc/examples/basic/1.3/tutorial.html 1.3] (note that in this version the example was named "Tutorial" instead of "Basic").
 
* [http://jungla.dit.upm.es/~vnuml/doc/examples/basic/1.6/basic.html 1.6]<br />
 
* [http://jungla.dit.upm.es/~vnuml/doc/examples/basic/1.6/basic.html 1.6]<br />
 +
* [[Example-basic-1.7|1.7]]

Latest revision as of 11:00, 3 October 2007

VNUML Basic Example

Authors:
Fermín Galán (galan at dit.upm.es)
David Fernández (david at dit.upm.es)
version 1.8, October 3rd, 2007


Scenario

The following example builds the basic topology shown in the figures. We provide an IPv4 version and an IPv6 version. The IPv6 version is slightly different; it uses the eth0 host interface as external connection for UML3.

Note that the /tmp/uml1-conf directory must exists in the host machine in order for the <filetree> tag to work in UML1 (for example, you can create it with 'mkdir /tmp/uml1-conf' and create and empty file inside with 'touch /tmp/uml1-conf/foobar.conf' to test). In addition, the <exec> tags are intented to test the command execution mode (more information in the User Manual). For example, use 'vnumlparser.pl -x start@basic.xml -v' to run the commands with seq="start" (in addition, the content of /root/uml1-conf directory will be copied to the virtual machine uml1) and 'vnumlparser.pl -x stop@basic.xml -v' to run the commands with seq="stop".

Before running the IPv6 version you have to edit the specification and change the IP data inside the <host> section to reflect your settings (in this example, 10.1.1.200/24 is the address/mask of the host and 10.1.1.1 the ip address of the router).

In both examples xterm consoles are disabled, so you have to access virtual machines using ssh from the host, for example:

 host> slogin uml1

Basic IPv4
Figure 1: Basic IPv4 scenario


Basic IPv6

Figure 2: Basic IPv6 scenario


VNUML Description (IPv4)


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE vnuml SYSTEM "/usr/share/xml/vnuml/vnuml.dtd" [
  <!ENTITY VNUMLDIR "/usr/share/vnuml/">
  <!ENTITY BASEDIR  "/usr/share/vnuml/examples/basic/">
  <!ENTITY REDIR  "</dev/null >/dev/null 2>&1 &">
]>
<vnuml>

   <global>
      <version>1.8</version>
      <simulation_name>basic</simulation_name>
      <ssh_key>/root/.ssh/identity.pub</ssh_key>
      <automac offset="0"/>
      <vm_mgmt type="private" network="192.168.0.0" mask="24" offset="100">
         <host_mapping/>
      </vm_mgmt>
      <vm_defaults>
         <filesystem type="cow">&VNUMLDIR;filesystems/root_fs_tutorial</filesystem>
         <kernel>&VNUMLDIR;kernels/linux</kernel>
         <shell>/bin/sh</shell>         
      </vm_defaults>
   </global>

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

   <vm name="uml1">
      <mem>50M</mem>
      <if id="1" net="Net0">
         <ipv4>10.0.0.1</ipv4>
      </if>
      <route type="ipv4" gw="10.0.0.3">default</route>
      <filetree root="/" seq="start">/tmp/uml1-conf</filetree>
      <exec seq="start" type="verbatim">ls</exec>
      <exec seq="start" type="verbatim">pwd</exec>
      <exec seq="start" type="verbatim">touch /root/example.start</exec>
      <exec seq="stop" type="verbatim">rm /root/example.start</exec>
      <exec seq="stop" type="verbatim">touch /root/example.stop</exec>
   </vm>

   <vm name="uml2">
      <if id="1" net="Net0">
         <ipv4>10.0.0.2</ipv4>
      </if>
      <route type="ipv4" gw="10.0.0.3">default</route>
   </vm>

   <vm name="uml3">
      <if id="1" net="Net0">
         <ipv4>10.0.0.3</ipv4>
      </if>
      <if id="2" net="Net1">
         <ipv4>10.0.1.1</ipv4>
      </if>
      <if id="3" net="Net3">
         <ipv4>10.0.3.1</ipv4>
      </if>
      <route type="ipv4" gw="10.0.1.2">10.0.2.0/24</route>
      <route type="ipv4" gw="10.0.3.2">default</route>
      <forwarding type="ip"/>
   </vm>

   <vm name="uml4">
      <if id="1" net="Net1">
         <ipv4>10.0.1.2</ipv4>
      </if>
      <if id="2" net="Net2">
         <ipv4>10.0.2.1</ipv4>
      </if>
      <route type="ipv4" gw="10.0.1.1">default</route>
      <forwarding type="ip"/>
   </vm>

   <vm name="uml5">
      <if id="1" net="Net2">
         <ipv4 mask="255.255.255.0">10.0.2.2</ipv4>
      </if>
      <route type="ipv4" gw="10.0.2.1">default</route>
   </vm>

   <host>
      <hostif net="Net3">
         <ipv4>10.0.3.2</ipv4>
      </hostif>
      <route type="ipv4" gw="10.0.3.1">10.0.0.0/16</route>
   </host>

</vnuml>

VNUML Description (IPv6)


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE vnuml SYSTEM "/usr/share/xml/vnuml/vnuml.dtd"
[
  <!ENTITY VNUMLDIR "/usr/share/vnuml/">
  <!ENTITY BASEDIR  "/usr/share/vnuml/examples/basic/">
  <!ENTITY REDIR  "</dev/null >/dev/null 2>&1 &">
]>

<vnuml>

   <global>
      <version>1.8</version>
      <simulation_name>basic</simulation_name>
      <ssh_key>/root/.ssh/identity.pub</ssh_key>
      <automac offset="0"/>
      <vm_mgmt type="private" network="192.168.0.0" mask="24" offset="0">
         <host_mapping/>
      </vm_mgmt>
      <vm_defaults>
         <filesystem type="cow">&VNUMLDIR;filesystems/root_fs_tutorial</filesystem>
         <kernel>&VNUMLDIR;kernels/linux</kernel>
         <shell>/bin/sh</shell>
      </vm_defaults>
   </global>

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

   <vm name="uml1">
      <mem>50M</mem>
      <if id="1" net="Net0">
         <ipv6>2001:db8:0::1/64</ipv6>
      </if>
      <route type="ipv6" gw="2001:db8:0::3">2000::/3</route>
      <filetree root="/" seq="start">/tmp/uml1-conf</filetree>
      <exec seq="start" type="verbatim">ls</exec>
      <exec seq="start" type="verbatim">pwd</exec>
      <exec seq="start" type="verbatim">touch /root/example.start</exec>
      <exec seq="stop" type="verbatim">rm /root/example.start</exec>
      <exec seq="stop" type="verbatim">touch /root/example.stop</exec>
   </vm>

   <vm name="uml2">  
      <if id="1" net="Net0">
         <ipv6>2001:db8:0::2/64</ipv6>
      </if>
      <route type="ipv6" gw="2001:db8:0::3">2000::/3</route>
   </vm>

   <vm name="uml3">   
      <if id="1" net="Net0">
         <ipv6>2001:db8:0::3/64</ipv6>
      </if>
      <if id="2" net="Net1">
         <ipv6>2001:db8:1::3/64</ipv6>
      </if>
      <if id="3" net="Net3">
         <ipv6>2001:db8:3::3/64</ipv6>
      </if>
      <route type="ipv6" gw="2001:db8:1::4">2001:db8:2::/64</route>
      <route type="ipv6" gw="2001:db8:3::254">2000::/3</route>
      <forwarding type="ipv6"/>
      <exec seq="start" type="verbatim">touch filesample</exec>
   </vm>

   <vm name="uml4">   
      <if id="1" net="Net1">
         <ipv6>2001:db8:1::4/64</ipv6>
      </if>
      <if id="2" net="Net2">
         <ipv6>2001:db8:2::4/64</ipv6>
      </if>
      <route type="ipv6" gw="2001:db8:1::3">2000::/3</route>
      <forwarding type="ipv6"/>
   </vm>

   <vm name="uml5">
      <if id="1" net="Net2">
         <ipv6>2001:db8:2::5/64</ipv6>
      </if>
      <route type="ipv6" gw="2001:db8:2::4">2000::/3</route>
   </vm>

   <host>
      <hostif net="Net3">
         <ipv4 mask="255.255.255.0">10.1.1.200</ipv4>
         <ipv6>2001:db8:3::254/64</ipv6>
      </hostif>
      <physicalif name="eth0" type="ipv4" ip="10.1.1.200" mask="255.255.255.0" gw="10.1.1.1"/>
      <route type="ipv4" gw="10.1.1.1">default</route>
      <route type="ipv6" gw="2001:db8:3::3">2001:db8::/32</route>
   </host>
</vnuml>

Download

Old Releases

  • 1.3 (note that in this version the example was named "Tutorial" instead of "Basic").
  • 1.6
  • 1.7