https://github.com/pyhedgehog/anytun
https://github.com/pyhedgehog/anytun
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/pyhedgehog/anytun
- Owner: pyhedgehog
- License: other
- Created: 2022-01-13T11:10:51.000Z (over 3 years ago)
- Default Branch: master
- Last Pushed: 2022-01-13T11:11:24.000Z (over 3 years ago)
- Last Synced: 2025-01-14T08:38:28.985Z (5 months ago)
- Language: C++
- Size: 18.7 MB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README
- Changelog: ChangeLog
- License: LICENSE
- Authors: AUTHORS
Awesome Lists containing this project
README
Dependencies
============Anytun can be built by using either libgcrypt, libnettle or the openssl-crypto
library. The latter is more performant in most cases but there are some license
issues when using this library.Linux
-----
(this includes Debian with FreeBSD Kernel)using libgcrypt:
libgcrypt11-devusing ssl crypto library:
libssl-devusing nettle crypto library:
nettle-devcommon:
build-essential
libboost-serialization-dev
libboost-thread-dev
libboost-system-dev
libboost-regex-devif you want clang as compiler
clangif you want to rebuild the manpage:
asciidocFreebsd
-------using libgcrypt:
security/libgcryptusing ssl crypto lib:
common:
devel/boost (boost-libs on newer versions of the ports tree)
devel/gmakeif you want to rebuild the manpage:
textproc/asciidoc
textproc/libxslt
textproc/docbook-xsl
sysutils/readlink
misc/getoptWindows
-------Crosscompiling with MinGW under Debian/Ubuntu:
----------------------------------------------# sudo apt-get install mingw-w64
# cd contrib/
# ./build-boost-mingw-cross.sh
# ./build-openssl-mingw-cross.sh
# ./build-anytun-mingw-cross.shThe compiled binaries can be found in anytun-w32 and anytun-w64 (32 and 64Bit).
You can create a ZIP archive containing all needed files by calling:# ./make-mingw-release.sh
Using MS Visual C++:
--------------------
OpenSSL
Developer:
http://www.slproweb.com/download/Win32OpenSSL-1_0_1h.exeRuntime Only:
http://www.slproweb.com/download/Win32OpenSSL_Light-1_0_1h.exeBoost
http://sourceforge.net/projects/boost/files/boost-binaries/As it can take some time to install everything from boost here is a
complete list of libraries which have to be installed in order to build anytun:* Serialization
* Thread
* date_time
* System
* regexMicrosoft Visual C++ 2008 Redistributable Package (x86):
http://www.microsoft.com/downloads/details.aspx?familyid=9B2DA534-3E03-4391-8A4D-074B9F2BC1BFInstallation
============Getting the source via GIT:
---------------------------git clone https://git.spreadspace.org/anytun/anytun.git
cd anytunBuilding from source
--------------------using libgcrypt:
# cd src
# ./configure
# makeusing ssl crypto library:
# cd src
# ./configure --use-ssl-crypto
# makeNotes:
- try './configure --help' for further information
- if using openssl pre 0.9.8 you have to disable passphrase
because openssl had no SHA256 implementation prior to this
version
- on FreeBSD you have to use gmake instead of make
- the FreeBSD port has some issues concering daemonizing and signal handlingInstalling
----------# sudo make install
This will install anytun under the --prefix defined with configure.
Uninstalling
------------# sudo make remove
This removes everything except for the config files
# sudo make purge
This also removes the config files
Usage:
======init.d script
-------------The init.d script can be used to start anytun at boot time. It searches for
configuration files which reside at $CONFIG_DIR. For each instance of anytun
which should be started there must be a directory containing at least a file
named config. This file must contain all command line parameter which should
be used when starting the daemon. One line for each parameter. Empty lines and
lines starting with # are ignored. Besides the config file there may be a script
named post-up.sh which will be called when the tun/tap device comes up.
Furthermore there may be a directory called conf.d containing config files for
anytun-config. The syntax of this files is quite the same as those for anytun.
These files are used to configure a multi connection setup using anytun-config
and anytun-controld
This is an example of how the script can be used to start anytun:# /etc/init.d/anytun start client1 p2p-a
In this case the script will start 2 instances of anytun using the config files
$CONFIG_DIR/client1/config and $CONFIG_DIR/p2p-a/config.
If no instance name is specified the script will use the file $CONFIG_DIR/autostart
to determine which instances to start or stop. This file must contain a list
of instance names which should be used when no names are specified at the command
line. One line for each name. Empty lines and lines starting with # are ignored.systemd usage
-------------Using the provided service units, anytun can now be started and managed via Systemd.
As with the init.d script, each VPN or anytun instance, identified by it's $vpnname,
needs it's own configuration subdirectory. E.g.: ${PREFIX}/etc/anytun/${vpnname}/.
For each such CLIENT instance, use the following command to enable it:# systemctl enable anytun@${vpnname}.service
Manually start and stop instances by replacing enable with start or stop.
Errors:
=======Note: Cannot open TUN/TAP dev /dev/net/tun: No such file or directory (errno=2)
Cannot open TUN/TAP dev /dev/anytun0: No such file or directory (errno=2)Solution: Enabling tun/tap device
------------------------------------modprobe tun
cd /dev
./MAKEDEV tunedit /etc/modules and add the line
tun
to load the module automatically