Example-olive
Olive example
Authors: David Fernández (david at dit.upm.es) version 1.9, July 8th, 2011
Scenario
A simple example scenario designed to show and experiment with the Olive based Juniper router emulation capabilities of VNX. The scenario is made of 6 virtual machines: three Olive routers (r1, r2, r3) interconected in a triangle topology; and three Linux (Ubuntu) hosts (h1, h2, h3), each connected to a LAN serviced by one of the routers (see figure below). The host has an interface on the scenario connected to one of the LANs.
To start the scenario just type:
cd /usr/share/vnx/examples/ vnx -f example_olive.xml -v --create
After that you will see the consoles of the 6 virtual machines created. To access the Ubuntu hosts just use the standard login/password (root/xxxx). To access the Olive routers use whatever you have configured (remember that we cannot distribute root-file-systems for Olive; you have to create it yourself and be aware of the legal restrictions).
At startup, the Olive routers load a configuration that is made of the configuration specified in the <conf> tag of each router:
<conf>conf/example_olive/r1.conf</conf>
and the configuration commands derived from the interfaces and routes (<if> and <route> tags) values in the VNX XML specification. For example, in the case of router r1, the interfaces specified:
<if id="1" net="Lan1" name="fxp0"> <ipv4>10.0.1.1/24</ipv4> <ipv6>2001:db8:1::1/64</ipv6> </if> <if id="2" net="ptp12" name="fxp1"> <ipv4>10.0.0.1/30</ipv4> <ipv6>2001:db8:12::1/64</ipv6> </if> <if id="3" net="ptp13" name="fxp2"> <ipv4>10.0.0.9/30</ipv4> <ipv6>2001:db8:13::1/64</ipv6> </if>
are translated into the following commands added to the router configuration:
interfaces { fxp0 { unit 0 { family inet { address 10.0.1.1/24; } family inet6 { address 2001:db8:1::1/64; } } } fxp1 { unit 0 { family inet { address 10.0.0.1/30; } family inet6 { address 2001:db8:12::1/64; } } } fxp2 { unit 0 { family inet { address 10.0.0.9/30; } family inet6 { address 2001:db8:13::1/64; } } } }
You can see the results of the configuration commands executed over Olive routers in the VNX ACE daemon log file:
root@r1% less /var/log/vnxolived.log
You can show the map of the scenario with:
vnx -f example_olive.xml -v --show-map
VNX Description
<vnx xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="/usr/share/xml/vnx/vnx-1.97.xsd"> <global> <version>1.92</version> <scenario_name>example_olive</scenario_name> <automac offset="0"/> <vm_mgmt type="none" /> <vm_defaults> <console id="0" display="no"/> <console id="1" display="yes"/> </vm_defaults> <!--olive_ext>simple_olive-olext.xml</olive_ext--> </global> <net name="Lan1" mode="virtual_bridge" /> <net name="Lan2" mode="virtual_bridge" /> <net name="Lan3" mode="virtual_bridge" /> <net name="ptp12" mode="virtual_bridge" /> <net name="ptp13" mode="virtual_bridge" /> <net name="ptp23" mode="virtual_bridge" /> <!-- NODES --> <vm name="r1" type="libvirt" subtype="kvm" os="olive"> <filesystem type="cow">/usr/share/vnx/filesystems/root_fs_olive</filesystem> <mem>256M</mem> <conf>conf/example_olive/r1.conf</conf> <if id="1" net="Lan1" name="fxp0"> <ipv4>10.0.1.1/24</ipv4> <ipv6>2001:db8:1::1/64</ipv6> </if> <if id="2" net="ptp12" name="fxp1"> <ipv4>10.0.0.1/30</ipv4> <ipv6>2001:db8:12::1/64</ipv6> </if> <if id="3" net="ptp13" name="fxp2"> <ipv4>10.0.0.9/30</ipv4> <ipv6>2001:db8:13::1/64</ipv6> </if> </vm> <vm name="r2" type="libvirt" subtype="kvm" os="olive"> <filesystem type="cow">/usr/share/vnx/filesystems/root_fs_olive</filesystem> <mem>256M</mem> <conf>conf/example_olive/r2.conf</conf> <if id="1" net="Lan2" name="fxp0"> <ipv4>10.0.2.1/24</ipv4> <ipv6>2001:db8:2::1/64</ipv6> </if> <if id="2" net="ptp12" name="fxp1"> <ipv4>10.0.0.2/30</ipv4> <ipv6>2001:db8:12::2/64</ipv6> </if> <if id="3" net="ptp23" name="fxp2"> <ipv4>10.0.0.5/30</ipv4> <ipv6>2001:db8:23::1/64</ipv6> </if> </vm> <vm name="r3" type="libvirt" subtype="kvm" os="olive"> <filesystem type="cow">/usr/share/vnx/filesystems/root_fs_olive</filesystem> <mem>256M</mem> <conf>conf/example_olive/r3.conf</conf> <if id="1" net="Lan3" name="fxp0"> <ipv4>10.0.3.1/24</ipv4> <ipv6>2001:db8:3::1/64</ipv6> </if> <if id="2" net="ptp13" name="fxp1"> <ipv4>10.0.0.10/30</ipv4> <ipv6>2001:db8:12::2/64</ipv6> </if> <if id="3" net="ptp23" name="fxp2"> <ipv4>10.0.0.6/30</ipv4> <ipv6>2001:db8:13::2/64</ipv6> </if> </vm> <vm name="h1" type="libvirt" subtype="kvm" os="linux"> <filesystem type="cow">/usr/share/vnx/filesystems/root_fs_ubuntu</filesystem> <mem>256M</mem> <if id="1" net="Lan1"> <ipv4>10.0.1.2/24</ipv4> <ipv6>2001:db8:1::2/64</ipv6> </if> </vm> <vm name="h2" type="libvirt" subtype="kvm" os="linux"> <filesystem type="cow">/usr/share/vnx/filesystems/root_fs_ubuntu</filesystem> <mem>256M</mem> <if id="1" net="Lan2"> <ipv4>10.0.2.2/24</ipv4> <ipv6>2001:db8:2::2/64</ipv6> </if> </vm> <vm name="h3" type="libvirt" subtype="kvm" os="linux"> <filesystem type="cow">/usr/share/vnx/filesystems/root_fs_ubuntu</filesystem> <mem>256M</mem> <if id="1" net="Lan3"> <ipv4>10.0.3.2/24</ipv4> <ipv6>2001:db8:3::2/64</ipv6> </if> </vm> <host> <hostif net="Lan1"> <ipv4>10.0.1.3/24</ipv4> <ipv6>2001:db8:1::3/64</ipv6> </hostif> </host> </vnx>
Download
The example is included in VNX distribution.