Size: 6130
Comment:
|
Size: 3883
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 5: | Line 5: |
The following commands have been tested in a Ubuntu environment. <<BR>> The procedure should work in any linux distro when you have installed the appropriate packages. |
|
Line 6: | Line 10: |
The following commands have been tested in a Ubuntu environment. |
|
Line 58: | Line 60: |
Now we install {{{andns}}}. | Now, we install {{{andns}}}. |
Line 69: | Line 71: |
Now we install {{{ntkresolv}}}. | Now, we install {{{ntkresolv}}}. |
Line 79: | Line 81: |
But we have to configure it. | But we have to prepare its configuration directory. |
Line 87: | Line 89: |
In seguito, quando lanciamo una macchina virtuale, non avremo bisogno di una interfaccia di rete virtuale collegata ad Internet, ma di una o più interfacce virtuali collegate ad un "dominio di collisione" virtuale. Creiamo una nuova directory e, dal suo interno, avviamo una macchina virtuale. |
Open a terminal. Go to the "pyntk" directory, where you find the file "ntkd". Launch the daemon with the Stackless interpreter and specify the NICs you want to manage. Remember to disable any other manager that might interfere with the parameters of those NICs, such as NetworkManager. |
Line 91: | Line 93: |
luca@luca-laptop:~/netkit/fs$ cd luca@luca-laptop:~$ mkdir test-ntk luca@luca-laptop:~$ cd test-ntk luca@luca-laptop:~/test-ntk$ vstart pc1 --eth0=A --eth1=B --mem=64 }}} Questa sintassi avvia una macchina virtuale con due schede virtuali (eth0 ed eth1) collegate a 2 domini diversi, uno chiamato "A" e l'altro "B". Queste interfacce non vengono affatto inizializzate dal sistema operativo caricato nelle macchine virtuali di netkit. Questa quindi è la situazione ottimale per verificare che il demone ntkd le renda effettivamente utilizzabili. === Una semplice topologia di rete === Supponiamo di voler provare questa topologia di rete: {{{ Collision Domain A | V pc1 ------------- pc2 \ / \ / Collision Domain \ / Collision Domain B ----> \ / <----- C \ / \ / pc3 |
luca@luca-laptop:~$ cd netsukuku/pyntk luca@luca-laptop:~/netsukuku/pyntk$ sudo /opt/stackless/bin/python2.6 ntkd -i eth0 eth1 -vvvv |
Line 121: | Line 97: |
Possiamo farlo con questi comandi: {{{ luca@luca-laptop:~/test-ntk$ vstart pc1 --eth0=A --eth1=B --mem=64 luca@luca-laptop:~/test-ntk$ vstart pc2 --eth0=A --eth1=C --mem=64 luca@luca-laptop:~/test-ntk$ vstart pc3 --eth0=B --eth1=C --mem=64 }}} Si avviano 3 macchine virtuali le cui console appaiono in 3 finestre. Scarichiamo nel nostro sistema da svn la versione corrente di Netsukuku. <<BR>> Mettiamo un link simbolico nella nostra home. {{{ luca@luca-laptop:~/test-ntk$ cd luca@luca-laptop:~$ mkdir -p sviluppo/netsukuku luca@luca-laptop:~$ cd sviluppo/netsukuku luca@luca-laptop:~/sviluppo/netsukuku$ svn co http://dev.hinezumi.org/svnroot/netsukuku/trunk . luca@luca-laptop:~/sviluppo/netsukuku$ cd luca@luca-laptop:~$ ln -s sviluppo/netsukuku netsukuku }}} Quindi {{{~/netsukuku/pyntk}}} è la directory che contiene la versione python di netsukuku. Dalla console di ogni macchina virtuale che abbiamo avviata diamo questi comandi: {{{ pc1:~# cd /hosthome/netsukuku/pyntk pc1:/hosthome/netsukuku/pyntk# /opt/stackless/bin/python2.6 ntkd -i eth0 eth1 -vvvv }}} Ora si hanno le basi per provare il funzionamento di netsukuku. <<BR>> Ci sono anche delle scripts nel repository che aiutano a preparare ambienti complessi. In questo modo è possibile riprodurre automaticamente una certa situazione per fare debug o produrre dei log che possono aiutare a trovare anomalie o punti critici. <<BR>> [[../ScriptsWithNetkit|Questa pagina]] spiega nel dettaglio l'uso di queste script. |
The flag {{{-vvvv}}} make it to produce a very verbose output. You can redirect it to some file for later examination. |
HowTo test netsukuku daemon on real hardware
On Linux
The following commands have been tested in a Ubuntu environment.
The procedure should work in any linux distro when you have installed the appropriate packages.
Dependencies
Open a terminal and give these commands:
luca@luca-laptop:~$ sudo apt-get update luca@luca-laptop:~$ sudo apt-get install build-essential luca@luca-laptop:~$ sudo apt-get install swig luca@luca-laptop:~$ sudo apt-get install openssl libssl-dev luca@luca-laptop:~$ sudo apt-get install xsltproc tinc
Now, we install Stackless Python.
luca@luca-laptop:~$ wget http://www.stackless.com/binaries/stackless-262-export.tar.bz2 luca@luca-laptop:~$ tar xf stackless-262-export.tar.bz2 luca@luca-laptop:~$ cd stackless-2.6.2 luca@luca-laptop:~/stackless-2.6.2$ mkdir -p /opt/stackless luca@luca-laptop:~/stackless-2.6.2$ ./configure --prefix=/opt/stackless luca@luca-laptop:~/stackless-2.6.2$ make luca@luca-laptop:~/stackless-2.6.2$ sudo make altinstall luca@luca-laptop:~/stackless-2.6.2$ cd
Now, we install M2Crypto
luca@luca-laptop:~$ wget http://pypi.python.org/packages/source/M/M2Crypto/M2Crypto-0.20.1.tar.gz luca@luca-laptop:~$ tar xf M2Crypto-0.20.1.tar.gz luca@luca-laptop:~$ cd M2Crypto-0.20.1/ luca@luca-laptop:~/M2Crypto-0.20.1$ /opt/stackless/bin/python2.6 setup.py build luca@luca-laptop:~/M2Crypto-0.20.1$ sudo /opt/stackless/bin/python2.6 setup.py install luca@luca-laptop:~/M2Crypto-0.20.1$ cd
Now, we install dnspython.
luca@luca-laptop:~$ wget http://www.dnspython.org/kits/1.7.1/dnspython-1.7.1.tar.gz luca@luca-laptop:~$ tar xf dnspython-1.7.1.tar.gz luca@luca-laptop:~$ cd dnspython-1.7.1 luca@luca-laptop:~/dnspython-1.7.1$ /opt/stackless/bin/python2.6 setup.py build luca@luca-laptop:~/dnspython-1.7.1$ sudo /opt/stackless/bin/python2.6 setup.py install luca@luca-laptop:~/dnspython-1.7.1$ cd
Get netsukuku
Get from the svn repository the current code of Netsukuku.
luca@luca-laptop:~$ svn co http://dev.hinezumi.org/svnroot/netsukuku/sandbox/lukisi/branches/multipleip netsukuku
So that ~/netsukuku/pyntk contains the current python version of netsukuku.
Now, we install andns.
luca@luca-laptop:~$ cd ~/netsukuku/ANDNS/andns luca@luca-laptop:~/netsukuku/ANDNS/andns$ make luca@luca-laptop:~/netsukuku/ANDNS/andns$ sudo make install luca@luca-laptop:~/netsukuku/ANDNS/andns$ cd ~/netsukuku/ANDNS/pyandns luca@luca-laptop:~/netsukuku/ANDNS/pyandns$ /opt/stackless/bin/python2.6 setup.py build luca@luca-laptop:~/netsukuku/ANDNS/pyandns$ sudo /opt/stackless/bin/python2.6 setup.py install luca@luca-laptop:~/netsukuku/ANDNS/pyandns$ cd
Now, we install ntkresolv.
luca@luca-laptop:~$ cd ~/netsukuku/ntkresolv luca@luca-laptop:~/netsukuku/ntkresolv$ make luca@luca-laptop:~/netsukuku/ntkresolv$ sudo make install luca@luca-laptop:~/netsukuku/ntkresolv$ cd
We do not install netsukuku; we'll launch the daemon from its directory.
But we have to prepare its configuration directory.
luca@luca-laptop:~$ sudo mkdir -p /etc/netsukuku luca@luca-laptop:~$ sudo ln -s $HOME/netsukuku/pyntk/setup/etc/netsukuku/tinc /etc/netsukuku
Start pyntk
Open a terminal. Go to the "pyntk" directory, where you find the file "ntkd". Launch the daemon with the Stackless interpreter and specify the NICs you want to manage. Remember to disable any other manager that might interfere with the parameters of those NICs, such as NetworkManager.
luca@luca-laptop:~$ cd netsukuku/pyntk luca@luca-laptop:~/netsukuku/pyntk$ sudo /opt/stackless/bin/python2.6 ntkd -i eth0 eth1 -vvvv
The flag -vvvv make it to produce a very verbose output. You can redirect it to some file for later examination.