diff options
Diffstat (limited to 'kpov_judge/tasks/isc_dhcp_live_boot/howtos/si')
-rw-r--r-- | kpov_judge/tasks/isc_dhcp_live_boot/howtos/si/index.html | 162 |
1 files changed, 162 insertions, 0 deletions
diff --git a/kpov_judge/tasks/isc_dhcp_live_boot/howtos/si/index.html b/kpov_judge/tasks/isc_dhcp_live_boot/howtos/si/index.html index 7e3ffc7..e4cf33d 100644 --- a/kpov_judge/tasks/isc_dhcp_live_boot/howtos/si/index.html +++ b/kpov_judge/tasks/isc_dhcp_live_boot/howtos/si/index.html @@ -135,3 +135,165 @@ </body>
</html>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <title>06 - preparation (isc_dhcp_live_boot)</title>
+ </head>
+
+ <body>
+ <h1 style="color:blue">06 - preparation (isc_dhcp_live_boot)</h1>
+ <h2>Table of contents</h2>
+ <ul>
+ <li><a href="#namen">Purpose of this exercise</a></li>
+ <li><a href="#navidezniRacunalniki">Virtual machines, needed for the purpose of exercise</a></li>
+ <li><a
+href="#skicaPodomrezja">Schematics of our subnet</a></li>
+ <li><a href="#simpleArbiterGW">Setting up simpleArbiterGW</a></li>
+ <li><a href="#DHCP">Setting up DHCP Server</a></li>
+ <li><a href="#clientA">Setting BootableClient A</a></li>
+ <li><a href="#clientB">Setting up BootableClient B</a></li>
+ </ul>
+
+
+ <h2 id="namen">Purpose of this exercise</h2>
+ <p>How to perform live boot using a DHCP server.</p>
+
+ <h2 id="navidezniRacunalniki">Virtual machines needed to perform the task.</h2>
+ <p>We need VirtualBox and the following 4 virtual
+machines:
+ <ul>
+ <li><a href="http://www.polz.si/media/uploads/kpov/virtualke/simpleArbiterGW.vdi">simpleArbiterGW</a></li>
+ <li><a href="http://www.polz.si/media/uploads/kpov/virtualke/simpleArbiterDhcp.vdi">DHCP Server</a></li>
+ <li>Bootable Client A (diskless
+machine)</li>
+ <li>Bootable Client B (diskless
+machine)</li>
+ </ul>
+ </p>
+
+ <h2 id="skicaPodomrezja">Schematics of our subnet</h2>
+ <img style="width: 800px; height: 610px;" src="../images/01.png" alt="slika-01"></img>
+ <p>Our goal is to make BootableClient A get it's IP
+through DHCP server and boot up using file
+A, which is located on simpleArbiterGW,</br>If we run
+BootableClient B machines, we would like it to retrieve it's IP
+through DHCP server and boot from some live ISO which is also located on
+SimpleArbiterGW.
+ </p>
+
+ <h2 id="simpleArbiterGW">Setting up <mark>simpleArbiterGW</mark></h2>
+ <p>Download <a
+href="http://www.polz.si/media/uploads/kpov/virtualke/simpleArbiterGW.vdi">simpleArbiterGW.vdi</a>
+and then run VirtualBox. After the file is downloaded, choose the New
+option in VirtualBoxu and set simpleArbiterGW in the Name
+field.</br>Memory size should be set accordingly (1gb will suffice).
+Spodaj
+izberemo še "Use an existing virtual hard drive file" ter izberemo naš simpleArbiterGW.vdi in pritisnimo Create.</p>
+ </br>
+ <img style="width: 800px; height: 464px;" src="../images/02.png" alt="slika-02"></img>
+ <p>We start our virtual machines simpleArbiterGW using the
+following login
+credentials; username: "root", password: "kaboom".</br></br>
+ Prvo računalnik od NAT-a, kateri je vgrajen v VirtualBox dobi nek naslov (v našem primeru 10.0.2.15).</br>(Da to preverimo uporabimo ukaz <b>ifconfig</b>) Preko tega IP naslova in vmesnika eth0 smo povezani v internet.<p>
+ <img style="width: 800px; height: 384px;" src="../images/03.png" alt="slika-03"></img>
+ <p>However, we would like this machine to have 2
+interfaces! One on NAT(we already have this one), and the other one on Internal Network,</br>preko katerega bomo komunicirali z DHCP Strežnikom ter ostalimi računalniki, ki bodo v našem Internal Network-u.</br></br>
+ We add a new interface, by turning off the virtual machine,
+select our machine in VirtualBox and select
+računalnik, ter v VirtualBoxu <b>Settings -> Network</b></br>
+ <b>Adapter</b> 1 is already set to NAT, we set <b>Adapter
+2</b> to
+Internal Network</p>
+ <img style="width: 800px; height: 137px;" src="../images/04.png" alt="slika-04"></img>
+ <p>So, now we have two network interfaces!</br>In VirtuaBox
+we can define multiple Internal Networks, however, for our need's two
+will suffice. We save the settings and restart simpleArbiterGW.</br></br>
+ Zdaj moramo oba omrežna vmesnika nastaviti tako, da bosta imela nek naslov. Uredimo datoteko <b>interfaces</b> v imeniku
+ <b>/etc/network</b>.</p>
+ <img style="width: 800px; height: 229px;" src="../images/05.png" alt="slika-05"></img>
+ <p>Eth0 was already handled by and integrated DHCP, so eth0 had been assigned an IP).</br>
+ We have to set up the other network interface. If we don't know it's name, we find it out using <b>ifconfig -a</b>.</p>
+ <img style="width: 800px; height: 117px;" src="../images/06.png" alt="slika-06"></img>
+ <p>We can conclude the interface names is set to Eth1.
+ Now we would like to assign an IP naslov to Eth1.</br>
+ Ifconfig could be used, but rebooting the machine would reset the settings. Which is not ideal :)</br>
+ So configuring <b>/etc/network/interfaces would be a better idea.</b></br></br>
+ Izmislimo si eno naključno lokalno omrežje oz naslov lokalnega omrežja ter nastavimo eth1.
+ </p>
+ <img style="width: 800px; height: 296px;" src="../images/07.png" alt="slika-07"></img>
+ <p>Shranimo konfiguracijsko datoteko. Moj računalnik še nima IP-ja na eth1 zato uporabim ukaz <b>ifup eth1</b></p>
+ <img style="width: 800px; height: 23px;" src="../images/08.png" alt="slika-08"></img></br>
+ <p>Now ew use the <b>ifconfig</b> command, to see whether and ip is assigned to eth1 interface</p>
+ <img style="width: 800px; height: 389px;" src="../images/09.png" alt="slika-09"></img>
+ <p>We can see the IP is set. Now let's set up the DHCP
+Server!</p>
+
+ <h2 id="DHCP">Setting up <mark>DHCP Server</mark></h2>
+ <p>We download <a href="http://www.polz.si/media/uploads/kpov/virtualke/simpleArbiterDhcp.vdi">simpleArbiterDhcp.vdi</a> ter zaženemo VirtualBox. Ko je datoteka prenesena v VirtualBoxu izberemo New ter v polje Name vpišemo DHCP Server.</br>Ustrezno nastavimo tudi Memory size (1gb pomnilnika nam bo zadostovalo). Spodaj izberemo še "Use an existing virtual hard drive file" ter izberemo naš simpleArbiterDhcp in pritisnimo Create.</p>
+ </br>
+ <img style="width: 800px; height: 464px;" src="../images/10.png" alt="slika-10"></img>
+ <p>We run DHCP Server virtual machine and login using "root" ad username and "kaboom" as password.</br></br>
+ <p>At first, our machine has no assigned IP, since none was set! Let+s configure it in <b>/etc/network/interfaces</b>.</br>But which interface should we configure? Using <b>ifconfig -a</b> command, we see it's <b>eth0</b>interface.<br>
+ Again we select our IP address.</p>
+ <img style="width: 800px; height: 283px;" src="../images/11.png" alt="slika-11"></img>
+ <p>We save the configuration file. Our computer still has no IP address assigned to eth0, so using <b>ifdown eth0</b> and then <b>ifup eth0</b>we provide one.</p>
+ <img style="width: 800px; height: 25px;" src="../images/12.png" alt="slika-12"></img>
+ <p>Now let us use <b>ifconfig</b> command, to check whether there is an IP assigned to interface eth0</p>
+ <img style="width: 800px; height: 329px;" src="../images/13.png" alt="slika-13"></img>
+ <p>We got it! We install DHCP server using <b>apt-get install isc-dhcp-server</b></p>
+ <img style="width: 800px; height: 322px;" src="../images/14.png" alt="slika-14"></img>
+ <p>We see a bunch of errors. Why? Bacause, we have not internet access! <br>
+ We need to specify the Gateway for our inteface. Our Gateway bo seveda IP našega simpleArbiter navideznega računalnika.</br> To naredimo s pomočjo ukaza <b>route add default gw 192.168.251.1 eth0</b></p>
+ <img style="width: 800px; height: 43px;" src="../images/15.png" alt="slika-15"></img>
+ <p>Try pinging Google's DNS server at 8.8.8.8, to check if now have internet access.</br>
+ We do this using the <b>ping 8.8.8.8</b> command.</p>
+ <img style="width: 800px; height: 361px;" src="../images/16.png" alt="slika-16"></img>
+ <p>Google's DNS server is responding. Great! </br>
+ However, we still cannot run <b>apt-get install isc-dhcp-server</b></br>
+ Let's tempororly add another interface and set it to NAT, so we get internet access and install the DHCP server.</br></br>
+ We add a new interface by turning off the virtual computer, , ter v VirtualBoxu označimo naš virtualni računalnik in pritisnemo na <b>Settings -> Network</b></br>
+ <b>Adapter 1</b> imamo že nastavljeno na Internal Network, <b>Adapter 2</b> pa nastavimo na NAT</p>
+ <img style="width: 800px; height: 134px;" src="../images/17.png" alt="slika-17"></img>
+ <p>Zaženemo naš DHCP Server in v <b>/etc/network/interfaces</b> začasno na koncu dodamo vrstico <b>iface eth1 inet dhcp</b>,datoteko shranimo ter poženemo ukaz <b>ifup eth1</b>.<br>
+ Sedaj imamo dostop do interneta in lahko namestimo naš DHCP strežnik z ukazom <b>apt-get install isc-dhcp-server install</b></br>
+ <img style="width: 800px; height: 26px;" src="../images/18.png" alt="slika-18"></img></br>
+ <p>Poglejmo kaj je v <b>/var/log/syslog</b>, to je datoteka kamor se shranjujejo sporočila kaj se dogaja v našem sistemu</p>
+ <img style="width: 800px; height: 323px;" src="../images/19.png" alt="slika-19"></img></br>
+ <p>Očitno moramo nastaviti dhcp strežnik ter mu povedati tudi kam naj posluša! </br>
+ Za nastavitve DHCP strežnika imamo <b>/etc/dhcp/dhcpd.conf</b>. Let's set it! </br>
+ Prvo zakomentiramo <b>option domain-name-servers</b> zaradi tega da nebo napak da jih ne najde.</p>
+ <img style="width: 800px; height: 26px;" src="../images/20.png" alt="slika-20"></img></br>
+ <p>Nato skonfiguriramo dhcp strežnik, da bo serviral ip-je na nekem podomrežju. Dodamo naslednje zapise:</p>
+ <img style="width: 800px; height: 417px;" src="../images/21.png" alt="slika-21"></img>
+ <p><b>(subnet)</b> Nastavimo podomrežje ter območje naslovov od koder naj jih DHCP strežnik dodeli, katero datoteko naj servira,</br> poleg tega so eni PXE tako neumni, da če jim ti serviraš filename nevejo iz katerega serverja ga dobim, zato napišem še next-server </br>(ip od koder serviram, v našem primeru simpleArbiter), nastavim tudi gateway kateri je v našem primeru tudi simpleArbiter.</br></br>Ker bi radi, da v primeru zagona navideznega računalnika BootableClient B serviramo drugo datoteko, to naredimo tako da definiramo nek dodaten host na sledeč način:</br><b>(host special)</b> Pod <b>hardware ethernet</b> zapišemo MAC naslov našega BootableClient B katerega bo imel, dodelimo mu nek statičen ip naslov ter povemo še iz kje se naj datoteka <b>live-ISO</b> zažene.</p>
+ <p>We save the settings and kill terthe process with ubijemo named <b>dnsmasq</b>using<b>kilall dnsmasq</b>.</p>
+ <img style="width: 740px; height: 34px;" src="../images/22.png" alt="slika-22"></img>
+ <p>Sledi restart našega DHCP strežnika, da bo deloval z novimi nastavitvami, to naredimo z ukazom <b>service isc-dhcp-server restart</b></br>DHCP Strežnik je pripravljen! Pripravimo BootableClientA ter BootableClientB ter testirajmo!</p>
+
+
+ <h2 id="clientA">Postavitev <mark>BootableClient A</mark></h2>
+ <p>Odpremo VirtualBox ter izberemo <b>New</b> in pod <b>Name</b> napišemo BootableClient A ter pod <b>Hard drive</b> izberemo <b>Do not add a virtual hard drive</b> (saj si želimo računalnik brez diska), </br>in pritisnemo na gump Create, da se nam ustvari navidezni računalnik. Želimo, da bo računalnik priklopljen na Internal network zato označimo naš <b>Bootable Client A</b> ter pritisnimo na </br><b>Settings->Network</b> in prvi Adapter 1 spremenimo na Internal Network.</p>
+ <img style="width: 800px; height: 678px;" src="../images/23.png" alt="slika-23"></img>
+ <p>Želimo še, da se računalnik boot-a preko mreže, zato to nastavimo pod zavihkom <b>System</b></p> tako, da pod <b>Boot Order</b> obkljukamo samo <b>Network</b>.</br>
+ Nastavitve shranimo z pritiskom na gumb <b>OK</b></p>
+ <img style="width: 800px; height: 697px;" src="../images/24.png" alt="slika-24"></img>
+ <p>Poženemo našega BootableClient-a A in odličnoo, dobi ip naslov s pomočjo DHCP strežnika in simpleArbiter mu servira točno to datoteko katero si želimo <b>A.0</b></p>
+ <img style="width: 800px; height: 494px;" src="../images/25.png" alt="slika-25"></img>
+
+
+
+ <h2 id="clientB">Postavitev <mark>BootableClient B</mark></h2>
+ <p>Odpremo VirtualBox ter izberemo <b>New</b> in pod <b>Name</b> napišemo BootableClient B ter pod <b>Hard drive</b> izberemo <b>Do not add a virtual hard drive</b> (saj si želimo računalnik brez diska), </br>in pritisnemo na gump Create, da se nam ustvari navidezni računalnik. Želimo, da bo računalnik priklopljen na Internal network zato označimo naš <b>Bootable Client B</b> ter pritisnimo na </br><b>Settings->Network</b> in prvi Adapter 1 spremenimo na Internal Network.</br>
+ Poleg tega nastavimo še pod <b>MAC Address</b> takšen MAC naslov, kot ga imamo v nastavitvah DHCP strežnika (dhcpd.conf -> host special), saj želimo da bo ta naš računalnik izjema</br> in bo ob zagonu dobil drugo datoteko kot ostali in sicer <b>live-ISO</b></p>
+ <img style="width: 800px; height: 678px;" src="../images/26.png" alt="slika-26"></img>
+ <p>Želimo še, da se računalnik boot-a preko mreže, zato to nastavimo pod zavihkom <b>System</b></p> tako, da pod <b>Boot Order</b> obkljukamo samo <b>Network</b>.</br>
+ Nastavitve shranimo z pritiskom na gumb <b>OK</b></p>
+ <img style="width: 800px; height: 697px;" src="../images/27.png" alt="slika-27"></img>
+ <p>Poženemo našega BootableClient-a A in odličnoo, dobi ip naslov s pomočjo DHCP strežnika in simpleArbiter mu servira točno to datoteko katero si želimo <b>live-ISO</b></p>
+ <img style="width: 800px; height: 494px;" src="../images/28.png" alt="slika-28"></img>
+
+
+ </body>
+</html>
+
|