Agenda: build-nmm-class-dynamips-kvm.htm

File build-nmm-class-dynamips-kvm.htm, 9.6 KB (added by admin, 5 years ago)
Line 
1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xmlns="http://www.w3.org/1999/xhtml">
3<head>
4  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5  <meta http-equiv="Content-Style-Type" content="text/css" />
6  <meta name="generator" content="pandoc" />
7  <title>Building the Network Management topology</title>
8  <style type="text/css">code{white-space: pre;}</style>
9  <link rel="stylesheet" href="../../style.css" type="text/css" />
10</head>
11<body>
12<div id="header">
13<h1 class="title">Building the Network Management topology</h1>
14</div>
15<div id="TOC">
16<ul>
17<li><a href="#building-the-router-class"><span class="toc-section-number">1</span> Building the router class</a><ul>
18<li><a href="#first-do-a-quick-check-that-the-vms-are-not-running-or-other-routers."><span class="toc-section-number">1.1</span> First, do a quick check that the VMs are not running, or other routers.</a></li>
19<li><a href="#now-lets-make-sure-the-workshop-kit-repository-is-up-to-date"><span class="toc-section-number">1.2</span> Now, let's make sure the workshop kit repository is up to date:</a></li>
20<li><a href="#now-run-the-vm_servers.yml-playbook-again-but-were-only-going-to"><span class="toc-section-number">1.3</span> Now, run the <code>vm_servers.yml</code> playbook again, but we're only going to</a></li>
21<li><a href="#lets-grab-the-class.net-file-for-the-network-management-topology."><span class="toc-section-number">1.4</span> Let's grab the <code>class.net</code> file for the Network Management topology.</a></li>
22<li><a href="#copy-the-base-router-configuration-files"><span class="toc-section-number">1.5</span> Copy the base router configuration files</a></li>
23<li><a href="#now-were-ready-to-start-the-routers."><span class="toc-section-number">1.6</span> Now, we're ready to start the routers.</a></li>
24<li><a href="#import-the-router-configurations"><span class="toc-section-number">1.7</span> Import the router configurations</a></li>
25</ul></li>
26</ul>
27</div>
28<p>We're going to build a topology we use in the Network Management class (and some others). This will require to have some routers on the backbone, and behind each router, 4 PCs will be started.</p>
29<p>The topology will look as follows:</p>
30<p>[pic]</p>
31<p>Let's get started! You will be working as a group - this means you will cooperate on this task.</p>
32<h1 id="building-the-router-class"><a href="#building-the-router-class"><span class="header-section-number">1</span> Building the router class</a></h1>
33<h2 id="first-do-a-quick-check-that-the-vms-are-not-running-or-other-routers."><a href="#first-do-a-quick-check-that-the-vms-are-not-running-or-other-routers."><span class="header-section-number">1.1</span> First, do a quick check that the VMs are not running, or other routers.</a></h2>
34<ul>
35<li>use <code>virsh list</code> to identify the machines you will need to shutdown</li>
36<li>if you are running screen, reconnect to that, and stop dynamips and dynagen</li>
37</ul>
38<p>Check using <code>ps ax</code> that no dynamips or dynagen processes are left running.</p>
39<h2 id="now-lets-make-sure-the-workshop-kit-repository-is-up-to-date"><a href="#now-lets-make-sure-the-workshop-kit-repository-is-up-to-date"><span class="header-section-number">1.2</span> Now, let's make sure the workshop kit repository is up to date:</a></h2>
40<pre><code>cd /home/nsrc/workshop-kit
41git pull</code></pre>
42<h2 id="now-run-the-vm_servers.yml-playbook-again-but-were-only-going-to"><a href="#now-run-the-vm_servers.yml-playbook-again-but-were-only-going-to"><span class="header-section-number">1.3</span> Now, run the <code>vm_servers.yml</code> playbook again, but we're only going to</a></h2>
43<p>modify the DHCP server</p>
44<pre><code>cd ansible
45sudo ansible-playbook -t dhcp vm_servers.yml</code></pre>
46<p>If everything went well, a new file should have been installed, <code>/etc/dhcp/dhcpd.nmm.conf</code>. Take a look at this file. You will notice there are 9 groups of 4 PCs. That's a total of 36 machines we will be starting!</p>
47<p>To be on the safe side, we will run:</p>
48<pre><code>sudo ansible-playbook -t interfaces networking.yml</code></pre>
49<p>And to be certain all the interfaces have started, run the following commands:</p>
50<pre><code>sudo ifup br1 br2 br3 br4 br5 br6 br7 br8 br9 tap1 tap2 tap3 tap4 tap5 tap6 tap7 tap8 tap9</code></pre>
51<p>Ignore the complaints if it says the interfaces are already up.</p>
52<h2 id="lets-grab-the-class.net-file-for-the-network-management-topology."><a href="#lets-grab-the-class.net-file-for-the-network-management-topology."><span class="header-section-number">1.4</span> Let's grab the <code>class.net</code> file for the Network Management topology.</a></h2>
53<p>In the future, we'll probably use ansible, but in the meantime, we've got a standard version of the topology ready for you to download!</p>
54<p>You can copy it from the workshop-kit repository (under workshop-kit/conf/dynagen/nmm/class.net).</p>
55<p>Create a working directory for the nmm class:</p>
56<pre><code>cd /home/nsrc</code></pre>
57<p>You should already have a work directory for dynamips, but just in case:</p>
58<pre><code>mkdir -p dynamips/nmm
59cd dynamips/nmm</code></pre>
60<p>Copy the <code>class.net</code> file here:</p>
61<pre><code>cp /home/nsrc/workshop-kit/conf/dynagen/nmm/class.net .</code></pre>
62<p>If the file cannot be found, then you need to run <code>git pull</code> to update the workshop-kit repository!</p>
63<p>Alternatively, copy-paste the <code>class.net</code> file from</p>
64<pre><code>http://wsnoc.nsrc.org:8000/nsrc/workshop-kit/raw/master/conf/dynagen/nmm/class.net</code></pre>
65<p>... into the <code>class.net</code> file.</p>
66<p>Note: You MUST clean the contents of the cache directory, as was explained in class. If in doubt:</p>
67<pre><code>rm -f /home/nsrc/dynamips/cache/*</code></pre>
68<p>Note: it's important to do the cleanup!</p>
69<h2 id="copy-the-base-router-configuration-files"><a href="#copy-the-base-router-configuration-files"><span class="header-section-number">1.5</span> Copy the base router configuration files</a></h2>
70<p>We still need to load some basic configuration into the routers, otherwise they will start with no IP address configured!</p>
71<p>We'll copy the <code>lab-base</code> configuration from the workshop-kit:</p>
72<pre><code>cd /home/nsrc/dynamips/nmm
73mkdir work
74mkdir configs
75cp /home/nsrc/workshop-kit/conf/dynagen/nmm/configs/lab-base/* configs/</code></pre>
76<h2 id="now-were-ready-to-start-the-routers."><a href="#now-were-ready-to-start-the-routers."><span class="header-section-number">1.6</span> Now, we're ready to start the routers.</a></h2>
77<pre><code>cd /home/nsrc/dynamips/nmm</code></pre>
78<p>We'll use <code>screen</code> so we can have <code>dynamips</code> running in one screen, and <code>dynagen</code> in the other. You should know how to do this!</p>
79<p>Once <code>screen</code> is started, start <code>dynamips</code> by running the following command:</p>
80<pre><code>/home/nsrc/workshop-kit/conf/dynagen/run-dynamips</code></pre>
81<p>You should see the following output:</p>
82<pre><code>Cisco Router Simulation Platform (version 0.2.10-amd64/Linux stable)
83Copyright (c) 2005-2011 Christophe Fillot.
84Build date: Nov  2 2013 19:03:02
85
86Local UUID: 4b9d715c-b9da-4939-ac35-d7821b5b4be2
87
88Hypervisor TCP control server started (port 7200).</code></pre>
89<p>Make sure the process is running:</p>
90<pre><code>ps ax | grep dynamips</code></pre>
91<p>Switch to/create another <code>screen</code> windows and we are now ready to start the <code>class.net</code> using <code>dynagen</code>:</p>
92<pre><code>cd /home/nsrc/dynamips/nmm/</code></pre>
93<p>Launch <code>dynagen</code> on the <code>class.net</code> file:</p>
94<pre><code>dynagen class.net</code></pre>
95<p>All routers should start, and you should see:</p>
96<pre><code>Reading configuration file...
97
98Network successfully loaded
99
100Dynagen management console for Dynamips and Pemuwrapper 0.11.0
101Copyright (c) 2005-2007 Greg Anuzelli, contributions Pavel Skovajsa
102
103=&gt;</code></pre>
104<p>Run the <code>list</code> command to see that all routers are up. You should see:</p>
105<pre><code>Name       Type       State      Server          Console
106r1         7200       running    s1.ws.nsrc.org:7200 2101
107r2         7200       running    s1.ws.nsrc.org:7200 2102
108r3         7200       running    s1.ws.nsrc.org:7200 2103
109r4         7200       running    s1.ws.nsrc.org:7200 2104
110r5         7200       running    s1.ws.nsrc.org:7200 2105
111r6         7200       running    s1.ws.nsrc.org:7200 2106
112r7         7200       running    s1.ws.nsrc.org:7200 2107
113r8         7200       running    s1.ws.nsrc.org:7200 2108
114r9         7200       running    s1.ws.nsrc.org:7200 2109</code></pre>
115<h2 id="import-the-router-configurations"><a href="#import-the-router-configurations"><span class="header-section-number">1.7</span> Import the router configurations</a></h2>
116<p>Now, time to import the router configurations for r1 to r9.</p>
117<p>Run this at the <code>dynagen</code> prompt:</p>
118<pre><code>=&gt; import /all configs</code></pre>
119<p>You should see:</p>
120<pre><code>Importing r2 from r2.cfg
121Importing r5 from r5.cfg
122Importing r8 from r8.cfg
123Importing r1 from r1.cfg
124Importing r6 from r6.cfg
125Importing r7 from r7.cfg
126Importing r4 from r4.cfg
127Importing r9 from r9.cfg
128Importing r3 from r3.cfg</code></pre>
129<p>Reload all the routers so the new configs are loaded:</p>
130<pre><code>=&gt; reload /all</code></pre>
131<p>Wait a few minutes - you should be able to ping the routers:</p>
132<pre><code>r1 -&gt; 10.10.0.1
133r2 -&gt; 10.10.0.2
134...
135r9 -&gt; 10.10.0.9</code></pre>
136<p>Also, you should be able to telnet to each router, using the following credentials:</p>
137<pre><code>user: cisco
138password: cisco</code></pre>
139</body>
140</html>