Internet connection sharing in Netsukuku HOWTO

This document describes how to configure a Netsukuku node to share its
Internet connection and how to configure another node that will use the shared
connection.

-----------------------------------------------------------------------------

*** Internet Gateway Search

If the nodes are in restricted mode (compatibility with the Internet), they
can share their Internet connection. This can be easily done, in fact, if a
node X, connected to the Internet, activates the masquerading, it is possible
for the other nodes to connect by setting as the default gateway their rnode
which lead to the node X.

This can be automated by Netsukuku itself.
The node which is sharing its connection will tell to the Netsukuku daemon to
masquerade its connection and to set a specific flag in the QSPN packets.
The other nodes in restricted mode will automatically know their nearest
Netsukuku Internet gateway and set it in their default route.

For more information read http://lab.dyne.org/Ntk_IGS .

*** Prerequisites

The IGS code of Netsukuku depends on the IPIP tunnel code of the kernel, so if
you are using Linux be sure to have the `CONFIG_NET_IPIP' option set as a
module or built-in.

*** How to share your Internet connection

First of all modify the /etc/netsukuku/netsukuku.conf file.

Set `internet_connection' to 1.

Set the `internet_gateway' option to the IP of the gateway you use to reach 
the Internet and specify the network interface too, for example:
"internet_gateway = 192.168.1.1:eth0". This option is necessary only if you
don't have the default route set when you run NetsukukuD (i.e. you haven't
connected yet), otherwise, leave it commented.

You have also to set your upload and download bandwidth in 
`internet_upload_rate' and `internet_download_rate'. It is expressed in Kb/s,
so if you have a line which maximum can do: 640 Kb/s in dwload and 30 Kb/s in 
upload, set them to 640 and 30.

`internet_ping_hosts' is a list of Internet hosts which will be pinged to
verify if the connection is alive, you can use the default hosts.

Finally, If you want to share your Internet connection among other Netsukuku
nodes, set `share_internet' to 1.

---- netsukuku.conf snip ----
internet_connection	= 1
internet_gateway	= 192.168.1.1:eth0
internet_download_rate  = 640
internet_upload_rate	= 30
internet_ping_hosts	= google.com:cisco.com:sourceforge.net:dyne.org
share_internet		= 1
----       snip end      ----

Now you are ready to launch the Netsukuku daemon. You have just to append the -I
option in the command line. For example:

# netsukuku_d -i wlan0 -r -I

*** How to connect to the Internet using a shared connection

Just start the daemon in restricted mode, f.e:

# netsukuku_d -i wlan0 -r

If you have an Internet connection and you don't want to share it, you have to
set the correct options in netsukuku.conf:

---- netsukuku.conf snip ----
internet_connection     = 1
internet_gateway        = 192.168.1.1:eth0
internet_download_rate  = 640
internet_upload_rate    = 30
internet_ping_hosts     = google.com:cisco.com:sourceforge.net:dyne.org
share_internet          = 0
----       snip end      ----

If you don't your Internet connection default route will be overwritten with
that of another node.
