diff --git a/docs/tunneling/fastd-compile-install.md b/docs/tunneling/fastd-compile-install.md new file mode 100644 index 0000000..c6e7c90 --- /dev/null +++ b/docs/tunneling/fastd-compile-install.md @@ -0,0 +1,60 @@ + +# Compile and install fastd + +The fastd compilation process is documented at [Building fastd](https://fastd.readthedocs.io/en/stable/devel/building.html. This is only a brief guide. For reference, the official fastd documentation should be used. + +## Preparation + +The first thing to do is to install the appropriate dependencies. On Debian you can do this with the following command: +``` +sudo apt install build-essential meson bison libuecc-dev libcap-dev libjson-c-dev libssl-dev libmnl-dev libsodium-dev clang-format +``` + +After that you can clone the Git repository. GitHub requires an IPv4 clearnet connection. +``` +git clone https://github.com/NeoRaider/fastd.git +``` + +## Compilation + +After that you can prepare the compilation: +``` +meson setup fastd fastd-build -Dbuildtype=release -Db_lto=true -Dcapabilities=enabled -Doffload_l2tp=enabled +``` +`-Db_lto=true` activates link-time optimizations. `-Dcapabilities=enabled` enables the option that fastd can later negotiate capabilities with its peer accordingly. `-Doffload_l2tp=enabled` enables the option to later offload L2TP connections in fastd to the kernel and thus increase speed. + +In addition, the `-Doptimization=3` flag can be used to perform strong optimizations. The flag `-Dmethod_cipher-test=enabled` can be used to use the `cipher-test` method in fastd. + + +After that you can change to the build directory and compile fastd: +``` +cd fastd-build +ninja +``` + +To install fastd you can use the following command: +``` +sudo ninja install +``` + +## Installation + +If you want to use fastd with Systemd, you can create a unit in the file `/lib/systemd/system/fastd@.service`: +``` +[Unit] +Description=Fast and Secure Tunnelling Daemon (connection %I) +After=network.target + +[Service] +Type=notify +ExecStart=/usr/local/bin/fastd --syslog-level info --syslog-ident fastd@%I -c /etc/fastd/%I/fastd.conf +ExecReload=/bin/kill -HUP $MAINPID + +[Install] +WantedBy=multi-user.target +``` + +After that you can load the new unit: +``` +systemctl daemon-reload +``` diff --git a/docs/tunneling/index.md b/docs/tunneling/index.md index 7243490..f165b7e 100644 --- a/docs/tunneling/index.md +++ b/docs/tunneling/index.md @@ -2,6 +2,7 @@ # Tunneling - [fastd](fastd) +- [Compile and install fastd](fastd) - [WireGuard](wireguard) - [OpenVPN](openvpn) - [IP tunnel](iptunnel)