Example-basic

Authors: Ferm&iacute;n Gal&aacute;n (galan at dit.upm.es) David Fern&aacute;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  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  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 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



Figure 1: Basic IPv4 scenario

Figure 2: Basic IPv6 scenario

VNUML Description (IPv4)
 <!DOCTYPE vnuml SYSTEM "/usr/share/xml/vnuml/vnuml.dtd" [ <!ENTITY VNUMLDIR "/usr/share/vnuml/"> <!ENTITY BASEDIR "/usr/share/vnuml/examples/basic/"> <!ENTITY REDIR "&lt;/dev/null &gt;/dev/null 2&gt;&amp;1 &amp;"> ]>

1.7      basic /root/.ssh/identity.pub     &VNUMLDIR;filesystems/root_fs_tutorial &VNUMLDIR;kernels/linux /bin/sh 

   

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

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

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

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

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

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

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 "&lt;/dev/null &gt;/dev/null 2&gt;&amp;1 &amp;"> ]>

1.7      basic</simulation_name> /root/.ssh/identity.pub</ssh_key> <vm_mgmt type="private" network="192.168.0.0" mask="24" offset="0"> <host_mapping/> </vm_mgmt>  &VNUMLDIR;filesystems/root_fs_tutorial &VNUMLDIR;kernels/linux /bin/sh </vm_defaults>

<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" />

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

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

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

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

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

<hostif net="Net3"> <ipv4 mask="255.255.255.0">10.1.1.200 2001:db8:3::254/64 <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 type="ipv6" gw="2001:db8:3::3">2001:db8::/32

Download

 * VNUML specification file: basic-ipv4.xml
 * VNUML specification file: basic-ipv6.xml

Old Releases

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