Skip to content

telekom/tunprox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository contains the tunprox project

Licensing
=========

Tunprox is NOT open source software. 
Tunprox is made available to you under a source-available license, which
means only non-commercial usage is permitted.

The specific terms of this source-available license can be found in the file
"LICENSE".

The library frlib found in the directory /ext/frlib/ IS open source software and 
available under the MPL-2.0 license, see /ext/frlib/LICENSE.txt for details.



Instructions
============

Tunprox itself is composed of three parts:
The kernel module. You find it in
ldt-kmod.
To compile cd to ldt-kmod and run
#> make
#> make install
#> depmod -a
This compiles and installs the module for the current running
kernel. The installation needs to be done as root.
/lib/modules/`uname -r`/build
must exist to compile. If the kernel headers are installed
in another directory or the module shall be compiled using:
#> make -C /path/to/kernel/headers M=`pwd`
Or set the environment variable LINUXSRC to the path
where the linux kernel sources are in. This can be easily
done from within openwrt, too.
The kernel modules does not need the frlib of course.
To load the module run
#> modprobe ldt

The tunprox-tool is the user-space tool to configure the
kernel module and request information from it.
to compile cd to ldt-tool and run
#> make
This will compile the frlib, the libtunprox and the tool.
The tool is linked statically to libtunprox and frlib. So
you don't need them to run the tunprox tool.

libtunprox
is a userspace library to do the communication with the
kernel module. The communication over the netlink interface
uses the implementation in the frlib. So the frlib is needed
for the tunprox-library. This library is needed by the tunprox
tool. It is compiled together with the tool.
To compile it manually cd to ldt-tool/lib and run
#> make
The library is linked statically to the tunprox tool, so
an installation is not needed, unless you do use the lib
for other purposes, too.

The tunprox tool itself is located in ldt-tool/tool
The compilation is done from within ldt-tool, so the
frlib and libtunprox are compiled, too.
If you want to compile it separately cd to tunprox-tool/tool
and run:
#> make
to get usage infarmation run 
#ldt -h 

The tunprox library and frlib are linked staticaly. Modify the
Makefile to link dynamically. Note, that when the frlib is linked
dynamically libpthread needs to be linked, too.



Debug-messages:
The kenel module writes debug messages to the kernel-ring buffer
which can be read using dmesg. To enable debug message:
#> sysctl net.ldt.debug=1
set it to 2 to make the kernel module more verbose, or 3 to be really
verbose.
tunprox showdev or tunprox showall do not show the configured key
used for authentication. For debug purpose sometimes it can be
usefull to show the key, too. set:
#> sysctl net.ldt.showkey=1
to enable output of the key. (Only root can do this, but anyone can
call tunprox showdev/showall. So be carefull. This feature can be
a severe security risk, when using it in a production system!!)


Sysfs:
To get statistics of the configured tunnels go to
/sys/class/net/<dev>/tunnel/<tunnel-id>/statistics/
if the device is tp0 and the tunnel-id is 0:
/sys/class/net/tp0/tunnel/0/statistics/

The userspace-tool logs to ldt.log in the current working
directory. To use a different logfile create a config file named
/etc/ldt.rc
or
~/.ldtrc or ~/.config/ldt.rc
containing a line
logfile="/path/to/logfile"
Note that the path needs to be an absolute path; ~ cannot be used
as homedir.