= 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.
<
>
'''UPDATE:''' A Fedora user contributed a recipe to workaround some issues that you could encounter on Fedora systems, namely with installation of {{{M2Crypto}}}. It is [[../Fedora|here]].
=== 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
luca@luca-laptop:~$ sudo apt-get install subversion
}}}
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$ sudo 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
}}}
=== ANDNA ===
Confirm that the file {{{/etc/hostname}}} contains the name you want to register in the network. In my case:
{{{
luca@luca-laptop:~$ cat /etc/hostname
luca-laptop
luca@luca-laptop:~$
}}}
Issue the following commands to configure the DNS wrapper.
{{{
luca@luca-laptop:~$ sudo tee /etc/netsukuku/dnswrapper.conf </dev/null
andnsserver in-process
EOF
luca@luca-laptop:~$ sudo tee /etc/netsukuku/andnsserver.conf </dev/null
inetnameserver 8.8.8.8
EOF
luca@luca-laptop:~$ sudo tee /etc/netsukuku/libandns.conf </dev/null
andnsserver 127.0.0.1
EOF
luca@luca-laptop:~$
}}}
=== 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.
<
>
This command will not fork itself in background, so you will not get the prompt back.
If you want (mostly you do) to be able to lookup for names into ANDNA, then
instruct the resolver to use 127.0.0.1 as DNS server. Open a new terminal, issue this command:
{{{
luca@luca-laptop:~$ sudo tee /etc/resolv.conf </dev/null
nameserver 127.0.0.1
EOF
luca@luca-laptop:~$
}}}
You might also want to further customize the file {{{/etc/netsukuku/andnsserver.conf}}} if you want
to proxy the requests that are for the Internet to a particular DNS server, instead of {{{8.8.8.8}}}.