<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>zInformatik &#187; Netzwerk</title>
	<atom:link href="http://zinformatik.de/tag/netzwerk/feed/" rel="self" type="application/rss+xml" />
	<link>http://zinformatik.de</link>
	<description>Computer, Informatik und Mikrocontroller Blog</description>
	<lastBuildDate>Sat, 22 Oct 2011 09:51:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Scenariogenerator für VNUML</title>
		<link>http://zinformatik.de/linux/scenariogenerator-fur-vnuml/</link>
		<comments>http://zinformatik.de/linux/scenariogenerator-fur-vnuml/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 11:41:20 +0000</pubDate>
		<dc:creator>zimon</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Programmieren]]></category>
		<category><![CDATA[Ubuntuusers-Planet]]></category>
		<category><![CDATA[Generator]]></category>
		<category><![CDATA[Netzwerk]]></category>
		<category><![CDATA[Script]]></category>
		<category><![CDATA[VNUML]]></category>

		<guid isPermaLink="false">http://zinformatik.de/?p=1558</guid>
		<description><![CDATA[<p>Vor einiger Zeit habe ich mal einen Scenariogenerator für <a href="http://zinformatik.de/tipps-tricks/interessante-programme/vnuml-ein-netzwerksimulator-mit-user-mode-linux/" title="VNUML - Ein Netzwerksimulator mit User-Mode-Linux" target="_self" class="liinternal">VNUML</a> geschrieben um schnell und einfach Scenariodateien für verschiedene Topologien erstellen zu können.</p>
<p>Dafür habe ich mir überlegt, was die wesentlichen Informationen sind um eine Netzwerktopologie zu beschreiben. Dies sind die existierenden Netze, die existierenden Router und welche Router an welche Netze&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p>Vor einiger Zeit habe ich mal einen Scenariogenerator für <a href="http://zinformatik.de/tipps-tricks/interessante-programme/vnuml-ein-netzwerksimulator-mit-user-mode-linux/" title="VNUML - Ein Netzwerksimulator mit User-Mode-Linux" target="_self" class="liinternal">VNUML</a> geschrieben um schnell und einfach Scenariodateien für verschiedene Topologien erstellen zu können.</p>
<p>Dafür habe ich mir überlegt, was die wesentlichen Informationen sind um eine Netzwerktopologie zu beschreiben. Dies sind die existierenden Netze, die existierenden Router und welche Router an welche Netze angeschlossen sind.<br />
Dem Generatorscript wird eine Datei mit diesen Informationen übergeben und erstellt daraus die VNUML-Scenariodatei. Über Variablen im Script kann gesteuert werden, welcher Kernel und welches Dateisystem verwendet werden soll und wie die einzelnen Router/Rechner-Definitionen aussehen sollen.</p>
<p><strong>Syntax</strong><br />
Die Syntax der übergebenen Dateien, die die Endung .zvf tragen müssen ist folgendermaßen:<br />
Leerzeilen sowie Zeilen, die mit <code>#</code> beginnen werden ignoriert.<br />
In der ersten Zeile stehen die Netze mit Komma getrennt (Leerzeichen sind nicht erlaubt)<br />
In den darauf folgenden Zeilen werden die Router definiert und angegeben, mit welchen Netzen sie verbunden sind. Am Anfang einer solchen Zeile steht jeweils zuerst der Name des Routers gefolgt von einem Leerzeichen. Danach werden alle angeschlossenen Netze mit Komma getrennt aufgelistet (Leerzeichen sind darin nicht erlaubt).</p>
<p><strong>Beispiel</strong><br />
Das folgende Beispiel definiert ein Scenario mit 3 Routern (r1, r2 und r3), die über 3 Netze (net1,net2 und net3) zu einem Dreieck verbunden sind:</p>

<div class="wp_syntax"><div class="code"><pre class="plain" style="font-family:monospace;"># beispiel.zvf
net1,net2,net3
&nbsp;
r1 net1,net2
r2 net2,net3
r3 net3,net1</pre></div></div>

<p>Die Namenskonvention (<code>/net[0-9]+/</code> für Netze und <code>/r[0-9]+/</code> für Router) muss eingehalten werden, damit das Script funktioniert.<br />
Da keine Fehlerbehandlung implementiert ist, muss die Syntax exakt eingehalten werden.</p>
<p>Wenn man das Script mit <code>chmod a+x createscenario.pl</code> ausführbar gemacht hat, kann man die Scenariodatei <code>beispiel.xml</code> durch folgenden Aufruf erstellen:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>createscenario.pl beispiel.zvf</pre></div></div>

<p><strong>Download</strong><br />
Hier das Perlscript zum downloaden:</p>
<p><a href="http://zinformatik.de/wp-content/uploads/2009/07/createscenario.txt" class="liinternal">createscenario.pl</a></p>
<p>Irgendwie gibt es Probleme, wenn ich eine .pl Datei direkt verlinke. Daher habe ich sie in <code>createscenario.txt</code> umbenannt. Nach dem Download sollte die Datei also mit dem Befehl</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mv</span> createscenatio.txt createscenatio.pl</pre></div></div>

<p>umbenannt werden.</p>
<p>Es können Maximal 254 Netze und 254 Router erstellt werden. Die IP-Adressen werden nach folgendem Schema vergeben:<br />
10.0.NETZNUMMER.ROUTERNUMMER wobei ROUTERNUMMER pro Netz hoch gezählt wird und nicht der Nummer des Routernamens entspricht (die Netznummer hingegen ist auch die Nummer aus dem Namen des Netzes).</p>
]]></content:encoded>
			<wfw:commentRss>http://zinformatik.de/linux/scenariogenerator-fur-vnuml/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>VNUML &#8211; Ein Netzwerksimulator mit User-Mode-Linux</title>
		<link>http://zinformatik.de/tipps-tricks/interessante-programme/vnuml-ein-netzwerksimulator-mit-user-mode-linux/</link>
		<comments>http://zinformatik.de/tipps-tricks/interessante-programme/vnuml-ein-netzwerksimulator-mit-user-mode-linux/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 12:26:44 +0000</pubDate>
		<dc:creator>zimon</dc:creator>
				<category><![CDATA[Interessante Programme]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Ubuntuusers-Planet]]></category>
		<category><![CDATA[Netzwerk]]></category>
		<category><![CDATA[Routing]]></category>
		<category><![CDATA[Simulation]]></category>
		<category><![CDATA[User-Mode-Linux]]></category>
		<category><![CDATA[VNUML]]></category>

		<guid isPermaLink="false">http://zinformatik.de/?p=1468</guid>
		<description><![CDATA[<p><div id="attachment_1486" class="wp-caption alignright" style="width: 310px"><a href="http://zinformatik.de/wp-content/uploads/2009/07/switch-ethernet-connection.jpg" class="liimagelink"><img src="http://zinformatik.de/wp-content/uploads/2009/07/switch-ethernet-connection.jpg" alt="Foto: Ben Stanfield" title="Foto: Ben Stanfield" width="300" height="179" class="size-full wp-image-1486" /></a><p class="wp-caption-text">Foto: Ben Stanfield</p></div><a href="http://www.dit.upm.es/vnumlwiki/index.php/Main_Page" title="Offizielle VNUML Homepage" target="_blank" class="liexternal">VNUML</a> (Virtual Network User-Mode-Linux) ist ein Programm um Netzwerke zu simulieren. Dabei werden die beteiligten Rechner nicht nur simuliert, sondern als virtuelle Maschinen gestartet, wodurch sie mit echten Protokollen miteinander kommunizieren. Daher eignet sich dieses Tool sehr gut zum Testen und Lernen z.B von Routingprotokollen. Man kann damit jedoch auch Paketfiltering mittels <a href="http://de.wikipedia.org/wiki/Iptables" title="Wikipedia - iptables" target="_blank"&#8230;</p>]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_1486" class="wp-caption alignright" style="width: 310px"><a href="http://zinformatik.de/wp-content/uploads/2009/07/switch-ethernet-connection.jpg" class="liimagelink"><img src="http://zinformatik.de/wp-content/uploads/2009/07/switch-ethernet-connection.jpg" alt="Foto: Ben Stanfield" title="Foto: Ben Stanfield" width="300" height="179" class="size-full wp-image-1486" /></a><p class="wp-caption-text">Foto: Ben Stanfield</p></div><a href="http://www.dit.upm.es/vnumlwiki/index.php/Main_Page" title="Offizielle VNUML Homepage" target="_blank" class="liexternal">VNUML</a> (Virtual Network User-Mode-Linux) ist ein Programm um Netzwerke zu simulieren. Dabei werden die beteiligten Rechner nicht nur simuliert, sondern als virtuelle Maschinen gestartet, wodurch sie mit echten Protokollen miteinander kommunizieren. Daher eignet sich dieses Tool sehr gut zum Testen und Lernen z.B von Routingprotokollen. Man kann damit jedoch auch Paketfiltering mittels <a href="http://de.wikipedia.org/wiki/Iptables" title="Wikipedia - iptables" target="_blank" rel="nofollow" class="liwikipedia"><code>iptables</code></a> sowie andere Dienste wie <a href="http://de.wikipedia.org/wiki/Address_Resolution_Protocol" title="Wikipedia - ARP" target="_blank" rel="nofollow" class="liwikipedia"><em>ARP</em></a>, <a href="http://de.wikipedia.org/wiki/Domain_Name_System" title="Wikipedia - DNS" target="_blank" rel="nofollow" class="liwikipedia"><em>DNS</em></a> oder <a href="http://de.wikipedia.org/wiki/ICMP" title="Wikipedia - ICMP" target="_blank" rel="nofollow" class="liwikipedia"><em>ICMP</em></a> ausprobieren. Auch eigene Entwicklungen können so getestet werden.<br />
Da für jeden Rechner ein <a href="http://www.user-mode-linux.org/" title="User-Mode-Linux Homepage" target="_blank" class="liexternal">User-Mode-Linux System</a> (englisch) &#8211; welches über einen echten Kernel und ein eigenes Dateisystem verfügt &#8211; gestartet wird, ist die Simulation sehr realitätsnah und die Rechner verhalten sich wie echte autonome Maschinen.<br />
Für diesen Artikel ist es vorteilhaft, wenn man grundlegende Kenntnisse über Netzwerke besitzt (es wird z.B. vorausgesetzt, dass man weiß was <a href="http://de.wikipedia.org/wiki/IP-Adresse" title="Wikipedia - IP-Adresse" target="_blank" rel="nofollow" class="liwikipedia">IP-Adressen</a>, <a href="http://de.wikipedia.org/wiki/IP-Adresse#Netzwerkteil_und_Ger.C3.A4teteil" title="Wikipedia - IP-Adressen: Netzwerkteil und Geräteteil" target="_blank" rel="nofollow" class="liwikipedia">Netze und Netzmasken</a> sowie <a href="http://de.wikipedia.org/wiki/Router" title="Wikipedia - Router" target="_blank" rel="nofollow" class="liwikipedia">Router</a> sind)</p>
<p><strong>UPDATE:</strong> Artikel nochmal überarbeitet</p>
<p><strong>Installation</strong><br />
Für Debian basierte Distributionen gibt es ein .deb Paket, welches zumindest unter Ubuntu problemlos installiert werden kann. Ansonsten kann man sich den Quelltext herunter laden. Eine englische <a href="http://www.dit.upm.es/vnumlwiki/index.php/Installation" title="VNUML - Installation" target="_blank" class="liexternal">Installationsanleitung</a> ist auch verfügbar.<br />
Ist VNUML installiert, braucht man noch ein Dateisystem. Auf der Projektseite gibt es 2 verschiedene zum <a href="http://www.dit.upm.es/vnumlwiki/index.php/Download" title="VNUML - Dateisysteme Download" target="_blank" class="liexternal">downloaden</a>. Ein größeres, welches mehr Programme beinhaltet und ein sehr abgespecktes, welches nützlich ist um größere Netzwerke zu generieren, da für jeden virtuellen Rechner ein Dateisystem im Arbeitsspeicher liegt.<br />
Man kopiert das gewählte Dateisystem nach <code>/usr/share/vnuml/filesystems/filesystem.img</code>. Für die Beispiele in diesem Artikel reicht das kleine, welches man als <code>mini_fs</code> speichern kann. Dafür können die folgenden Befehle benutzt werden, nachdem man die Datei n3vlr-0.11-vnuml-v0.1.tar.gz herunter geladen hat:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> <span style="color: #660033;">-xvzf</span> n3vlr-<span style="color: #000000;">0.11</span>-vnuml-v0.1.tar.gz
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">cp</span> n3vlr-<span style="color: #000000;">0.11</span>-vnuml-v0.1.img <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>vnuml<span style="color: #000000; font-weight: bold;">/</span>filesystems<span style="color: #000000; font-weight: bold;">/</span>mini_fs</pre></div></div>

<p>Möchte man das Dateisystem ändern um z.B. neue Programme hinzuzufügen oder unbenötigte Dateien zu löschen, kann man dieses mit dem Befehl</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>vnuml
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">mount</span> <span style="color: #660033;">-o</span> loop <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>vnuml<span style="color: #000000; font-weight: bold;">/</span>filesystems<span style="color: #000000; font-weight: bold;">/</span>filesystem.img <span style="color: #000000; font-weight: bold;">/</span>mnt<span style="color: #000000; font-weight: bold;">/</span>vnuml</pre></div></div>

<p>einhängen. Nun kann man im Ordner <code>/mnt/vnunml</code> alle gewünschten Änderungen vornehmen und das Dateisystem danach mit <code>sudo umount /mnt/vnuml</code> wieder aushängen.</p>
<p><strong>Scenariodatei erstellen</strong><br />
Die Netzwerktopologie wird in einer XML-Datei beschrieben. In dieser werden zuerst die globalen Einstellungen festgelegt, in denen unter anderem angegeben wird, wo das zu nutzende Dateisystem liegt und welchen ssh-Key man nutzen möchte um auf die virtuellen Rechner zuzugreifen.<br />
Danach folgen die Definitionen der Netze gefolgt von den Rechnern.<br />
Im folgenden eine minimale Beispielkonfiguration, die zwei Rechner beschreibt, die über ein Netz miteinander verbunden sind. Zuerst der globale Teil, in dem die VNUML-Version, der Name des Scenarios und weitere Einstellungen definiert werden. Dort wird auch das Management-Netz (192.168.0.0/24) definiert, über das man vom eigenen Rechner auf die verschiedenen virtualisierten Maschinen zugreifen kann.<br />
Existiert noch kein öffentlicher ssh-key, so sollte man sich mit folgendem Kommando einen anlegen:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span></pre></div></div>

<p>Bei der Frage nach einem Passwort drückt man einfach Enter ohne ein Passwort einzugeben. Der vorgeschlagene Pfad sollte stimmen, kann also beibehalten werden.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE vnuml SYSTEM &quot;/usr/share/xml/vnuml/vnuml.dtd&quot;&gt;</span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;vnuml<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;global<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1.8<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;simulation_name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>beispiel<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/simulation_name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ssh_version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ssh_version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ssh_key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/root/.ssh/id_rsa.pub<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ssh_key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;automac</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;vm_mgmt</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;private&quot;</span> <span style="color: #000066;">network</span>=<span style="color: #ff0000;">&quot;192.168.0.0&quot;</span> <span style="color: #000066;">mask</span>=<span style="color: #ff0000;">&quot;24&quot;</span> <span style="color: #000066;">offset</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;host_mapping</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/vm_mgmt<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;vm_defaults</span> <span style="color: #000066;">exec_mode</span>=<span style="color: #ff0000;">&quot;mconsole&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filesystem</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;cow&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>/usr/share/vnuml/filesystems/mini_fs<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filesystem<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;kernel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/usr/share/vnuml/kernels/linux<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/kernel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/vm_defaults<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/global<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Als nächstes werden die Netze definiert. In diesem Beispiel gibt es nur ein Netz, da man sich sonst um das Routing kümmern müsste (dazu später mehr).</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;net</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;net1&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;virtual_bridge&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>Im Modus &#8220;virtual_bridge&#8221; werden die Interfaces aller virtuellen Rechner sowie alle Netze über Bridges ans Hostsystem (den eigenen Rechner) gekoppelt, so dass man sie mit einem <code>ifconfig</code> sehen und mittels <a href="http://de.wikipedia.org/wiki/Tcpdump" title="Wikipedia - tcpdump" target="_blank" rel="nofollow" class="liwikipedia"><code>tcpdump</code></a> oder <a href="http://de.wikipedia.org/wiki/Wireshark" title="Wikipedia - Wireshark" target="_blank" rel="nofollow" class="liwikipedia">Wireshark</a> überwachen kann. Dafür wird jedoch das Paket &#8220;bridge-utils&#8221; benötigt. Alternativ kann man statt dessen auch &#8220;uml_switch&#8221; benutzen.</p>
<p>Nun folgen die Definitionen der virtuellen Rechner. Bei beiden Rechnern wird ein Interface definiert (es können aber auch mehrere sein, z.B. für Router).</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;">    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;vm</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;rechner1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;if</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">net</span>=<span style="color: #ff0000;">&quot;net1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ipv4</span> <span style="color: #000066;">mask</span>=<span style="color: #ff0000;">&quot;255.255.255.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>10.0.1.1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ipv4<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/if<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/vm<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;vm</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;r2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;if</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">net</span>=<span style="color: #ff0000;">&quot;net1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ipv4</span> <span style="color: #000066;">mask</span>=<span style="color: #ff0000;">&quot;255.255.255.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>10.0.1.2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ipv4<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/if<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/vm<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/vnuml<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Es empfiehlt sich die Datei genauso wie das Scenario (die globale Eigenschaft <code>simulation_name</code>) zu benennen. In diesem Fall also <code>beispiel.xml</code></p>
<p><strong>Scenario starten und zu den Rechnern verbinden</strong><br />
Um das Scenario zu starten genügt der folgende Aufruf:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> vnumlparser.pl <span style="color: #660033;">-t</span> beispiel.xml</pre></div></div>

<p>Nachdem das Scenario gestartet ist, kann man sich auf einen der Rechner einloggen:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ssh</span> rechner1</pre></div></div>

<p>Durch die Angabe des öffentlichen ssh-Keys sollte es keine Passwortabfrage geben. Ansonsten ist das Passwort per default <code>xxxx</code>. Nun kann man alles mögliche Testen. Man kann einen Ping versenden:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ping</span> 10.0.1.2</pre></div></div>

<p>oder ein Interface überwachen.<br />
Dafür loggt man sich am besten in einer anderen Konsole auf dem 2. Rechner ein:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ssh</span> rechner2</pre></div></div>

<p>und startet dort einen TCP-Dump:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">tcpdump <span style="color: #660033;">-i</span> eth1</pre></div></div>

<p>Der Ping sollte die ganze Zeit weiter laufen, damit man auch etwas sehen kann. Danach kann man ihn mit Strg+c stoppen.<br />
Mit <code>exit</code> kann man einen Rechner wieder verlassen.<br />
Da man häufiger auf mehreren Rechnern gleichzeitig eingeloggt sein möchte wenn man mit VNUML arbeitet, bietet es sich an <a href="http://zinformatik.de/tipps-tricks/interessante-programme/einfuhrung-in-screen/" title="Einführung in Screen" target="_self" class="liinternal">Screen</a> zu benutzen.<br />
Um die Simulation zu beenden führt man folgenden Befehl aus:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> vnumlparser.pl <span style="color: #660033;">-P</span> beispiel.xml</pre></div></div>

<p><strong>Dienste starten</strong><br />
Wie bereits erwähnt eignet sich VNUML besonders gut zum ausprobieren und Testen von Routingprotokollen. Daher sind auch die Quagga-Implementationen der bekanntesten Routingprotokolle <em>RIP</em>, <em>OSPF</em> und <em>BGP</em> bereits installiert und können recht einfach genutzt werden. Ich werde in diesem Artikel jedoch nur eine Minimalkonfiguration für <em>RIP</em> und <em>OSPF</em> angeben. Eine Einführung in diese Protokolle und deren Konfiguration würde an dieser Stelle zu weit führen.<br />
Um das Routing grundsätzlich zu aktivieren wird das Tag</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;forwarding</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;ipv4&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>genutzt. Weitere Tags binden ein Konfigurationsverzeichnis <code>conf</code> ein (welches im gleichen Verzeichnis, wie die xml-Datei des Scenarios liegt) und starten die verschiedenen Daemons.<br />
Im Verzeichnis <code>conf</code> sollten dann die folgenden Dateien vorhanden sein:</p>
<p><code>zebra.conf</code></p>

<div class="wp_syntax"><div class="code"><pre class="plain" style="font-family:monospace;">!
hostname zebra
!
password xxxx
enable password xxxx</pre></div></div>

<p><code>ripd.conf</code></p>

<div class="wp_syntax"><div class="code"><pre class="plain" style="font-family:monospace;">!
hostname ripd
password xxxx
!
router rip
network 10.0.0.0/8</pre></div></div>

<p><code>ospfd.conf</code></p>

<div class="wp_syntax"><div class="code"><pre class="plain" style="font-family:monospace;">!
hostname ospfd
password xxxx
!
router ospf
network 10.0.0.0/8 area 0</pre></div></div>

<p>Weitere Infos zu den Quagga-Routingprotokollen gibt es unter <a href="http://www.quagga.net/" title="Quagga Homepage" target="_blank" class="liexternal">http://www.quagga.net</a>.<br />
Ein Scenario, welches der Einfachheit halber nur aus Routern besteht, auf denen man wahlweise <em>OSPF</em> oder <em>RIP</em> starten kann wird im folgenden Beispiel definiert:</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #00bbdd;">&lt;!DOCTYPE vnuml SYSTEM &quot;/usr/share/xml/vnuml/vnuml.dtd&quot;&gt;</span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;vnuml<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;global<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>1.8<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;simulation_name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>mini<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/simulation_name<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ssh_version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ssh_version<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ssh_key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/root/.ssh/id_rsa.pub<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ssh_key<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;automac</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;vm_mgmt</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;private&quot;</span> <span style="color: #000066;">network</span>=<span style="color: #ff0000;">&quot;192.168.0.0&quot;</span> <span style="color: #000066;">mask</span>=<span style="color: #ff0000;">&quot;24&quot;</span> <span style="color: #000066;">offset</span>=<span style="color: #ff0000;">&quot;100&quot;</span> <span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;host_mapping</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/vm_mgmt<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;vm_defaults</span> <span style="color: #000066;">exec_mode</span>=<span style="color: #ff0000;">&quot;mconsole&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filesystem</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;cow&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>/usr/share/vnuml/filesystems/mini_fs<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filesystem<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;kernel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/usr/share/vnuml/kernels/linux<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/kernel<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/vm_defaults<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/global<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;net</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;net1&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;virtual_bridge&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;net</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;net2&quot;</span> <span style="color: #000066;">mode</span>=<span style="color: #ff0000;">&quot;virtual_bridge&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;vm</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;r1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;if</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">net</span>=<span style="color: #ff0000;">&quot;net1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ipv4</span> <span style="color: #000066;">mask</span>=<span style="color: #ff0000;">&quot;255.255.255.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>10.0.1.1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ipv4<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/if<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;forwarding</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;ipv4&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filetree</span> <span style="color: #000066;">root</span>=<span style="color: #ff0000;">&quot;/etc/quagga&quot;</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;start&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>conf<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filetree<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>sysctl -w net.ipv4.conf.all.rp_filter=0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>hostname<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>/usr/lib/quagga/zebra -f /etc/quagga/zebra.conf -d<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;rip&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>/usr/lib/quagga/ripd -f /etc/quagga/ripd.conf -d<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;ospf&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>/usr/lib/quagga/ospfd -f /etc/quagga/ospfd.conf -d -P 2604<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;stop&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>hostname<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;stop&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>killall zebra<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;stop&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>killall ripd<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;stop&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>killall ospfd<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;rpfilter&quot;</span> <span style="color: #000066;">type</span>= <span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            for f in /proc/sys/net/ipv4/conf/*/rp_filter; do echo 0 &gt; $f; done
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/vm<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;vm</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;r2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;if</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">net</span>=<span style="color: #ff0000;">&quot;net1&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ipv4</span> <span style="color: #000066;">mask</span>=<span style="color: #ff0000;">&quot;255.255.255.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>10.0.1.2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ipv4<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/if<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;if</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;2&quot;</span> <span style="color: #000066;">net</span>=<span style="color: #ff0000;">&quot;net2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ipv4</span> <span style="color: #000066;">mask</span>=<span style="color: #ff0000;">&quot;255.255.255.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>10.0.2.1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ipv4<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/if<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;forwarding</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;ipv4&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filetree</span> <span style="color: #000066;">root</span>=<span style="color: #ff0000;">&quot;/etc/quagga&quot;</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;start&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>conf<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filetree<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>sysctl -w net.ipv4.conf.all.rp_filter=0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>hostname<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>/usr/lib/quagga/zebra -f /etc/quagga/zebra.conf -d<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;rip&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>/usr/lib/quagga/ripd -f /etc/quagga/ripd.conf -d<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;ospf&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>/usr/lib/quagga/ospfd -f /etc/quagga/ospfd.conf -d -P 2604<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;stop&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>hostname<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;stop&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>killall zebra<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;stop&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>killall ripd<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;stop&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>killall ospfd<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;rpfilter&quot;</span> <span style="color: #000066;">type</span>= <span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            for f in /proc/sys/net/ipv4/conf/*/rp_filter; do echo 0 &gt; $f; done
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/vm<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;vm</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;r3&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;if</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;1&quot;</span> <span style="color: #000066;">net</span>=<span style="color: #ff0000;">&quot;net2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ipv4</span> <span style="color: #000066;">mask</span>=<span style="color: #ff0000;">&quot;255.255.255.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>10.0.2.2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ipv4<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/if<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;forwarding</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;ipv4&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
&nbsp;
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filetree</span> <span style="color: #000066;">root</span>=<span style="color: #ff0000;">&quot;/etc/quagga&quot;</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;start&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>conf<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/filetree<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>sysctl -w net.ipv4.conf.all.rp_filter=0<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>hostname<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>/usr/lib/quagga/zebra -f /etc/quagga/zebra.conf -d<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;rip&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>/usr/lib/quagga/ripd -f /etc/quagga/ripd.conf -d<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;ospf&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>/usr/lib/quagga/ospfd -f /etc/quagga/ospfd.conf -d -P 2604<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;stop&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>hostname<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;stop&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>killall zebra<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;stop&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>killall ripd<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;stop&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>killall ospfd<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;exec</span> <span style="color: #000066;">seq</span>=<span style="color: #ff0000;">&quot;rpfilter&quot;</span> <span style="color: #000066;">type</span>= <span style="color: #ff0000;">&quot;verbatim&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
            for f in /proc/sys/net/ipv4/conf/*/rp_filter; do echo 0 &gt; $f; done
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/exec<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/vm<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/vnuml<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p><div id="attachment_1493" class="wp-caption alignright" style="width: 310px"><a href="http://zinformatik.de/wp-content/uploads/2009/06/mini.png" class="liimagelink"><img src="http://zinformatik.de/wp-content/uploads/2009/07/mini-300x53.png" alt="Die Topologie des Beispielscenarios mini.xml" title="Die Topologie des Beispielscenarios mini.xml" width="300" height="53" class="size-medium wp-image-1493" /></a><p class="wp-caption-text">Die Topologie des Beispielscenarios mini.xml</p></div>Dieses Beispiel besteht aus 3 Routern, die mit zwei Netzen zu einer &#8220;Kette&#8221; verbunden sind (siehe Abbildung rechts). Startet man dieses Scenario, so kann man nicht von r1 (10.0.1.1) nach r3 (10.0.2.2) pingen, da die Routingdaemons noch nicht gestartet sind und r1 noch nichts von net2 weiß:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> vnumlparser.pl <span style="color: #660033;">-t</span> mini.xml
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ssh</span> root<span style="color: #000000; font-weight: bold;">@</span>r1
<span style="color: #c20cb9; font-weight: bold;">ping</span> 10.0.2.2</pre></div></div>

<p>Wie man sieht, kommen die Pings nicht bei r3 an.  Mit <code>exit</code> verläst man den Router r1 wieder.<br />
Es gibt nun 4 Sequenzen, die ausgeführt werden können: <em>start</em>, <em>stop</em>, <em>rip</em> und <em>ospf</em>. Dabei wird durch ausführen der Sequenz <em>start</em> der Hostname gesetzt und der zebra-Daemon gestartet. Mit <em>rip</em> oder <em>ospf</em> wird der entsprechende Routingdaemon gestartet und <em>stop</em> beendet alle Routingprozesse.<br />
Man startet nun also z.B. den <em>RIP</em>-Daemon mit den folgenden Befehlen:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> vnumlparser.pl <span style="color: #660033;">-x</span> start<span style="color: #000000; font-weight: bold;">@</span>mini.xml
<span style="color: #c20cb9; font-weight: bold;">sudo</span> vnumlparser.pl <span style="color: #660033;">-x</span> rip<span style="color: #000000; font-weight: bold;">@</span>mini.xml</pre></div></div>

<p>Nun kann man testen, ob das Routing auch funktioniert, indem man den Ping, der vorher fehlschlug wiederholt:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">ssh</span> root<span style="color: #000000; font-weight: bold;">@</span>r1
<span style="color: #c20cb9; font-weight: bold;">ping</span> 10.0.2.2</pre></div></div>

<p>Jetzt sollte der Ping funktionierten. Bei größeren Scenarien kann es einige Sekunden dauern bis alle Router über die notwendigen Informationen verfügen (also bis das Scenario <em>konvergent</em> ist).</p>
<p>Natürlich gibt es noch viele weitere Optionen und Möglichkeiten, die VNUML zur Verfügung stellt. Dies soll nur eine kleine Einführung sein, um die ersten Schritte mit diesem System zu machen. </p>
<p><strong>Links</strong></p>
<ul>
<li><a href="http://www.dit.upm.es/vnumlwiki/index.php/Main_Page" title="Offizielle VNUML Seite" target="_blank" class="liexternal">http://www.dit.upm.es/vnumlwiki/index.php/Main_Page</a> (englisch) &#8211; Offizielle VNUML Seite mit Downloadmöglichkeit und Dokumentation</li>
<li><a href="http://www.uni-koblenz.de/~vnuml/index.de.php" title="Deutsche VNUML Seite der Universität Koblenz" target="_blank" class="liexternal">http://www.uni-koblenz.de/~vnuml/index.de.php</a> &#8211; VNUML Seiten der Universität Koblenz</li>
<li><a href="http://de.wikipedia.org/wiki/VNUML" title="Wikipedia - VNUML" target="_blank" rel="nofollow" class="liwikipedia">http://de.wikipedia.org/wiki/VNUML</a> &#8211; Wikipedia Artikel zu VNUML</li>
<li><a href="http://www.quagga.net/" title="Quagga Homepage" target="_blank" class="liexternal">http://www.quagga.net</a> (englisch) &#8211; Offizielle Quagga Seite</li>
<li><a href="http://de.wikipedia.org/wiki/Quagga_(Software)" title="Wikipedia - Quagga" target="_blank" rel="nofollow" class="liwikipedia">http://de.wikipedia.org/wiki/Quagga_(Software)</a> &#8211; Wikipedia Artikel zu Quagga</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://zinformatik.de/tipps-tricks/interessante-programme/vnuml-ein-netzwerksimulator-mit-user-mode-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

