add small tutorial how to compile and install fastd

Signed-off-by: Marek Küthe <m.k@mk16.de>
This commit is contained in:
Marek Küthe 2023-01-09 12:16:25 +01:00
parent 192c4b2ff5
commit 05ebc8c7d6
No known key found for this signature in database
GPG Key ID: 7E869146699108C7
2 changed files with 61 additions and 0 deletions

View File

@ -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
```

View File

@ -2,6 +2,7 @@
# Tunneling
- [fastd](fastd)
- [Compile and install fastd](fastd)
- [WireGuard](wireguard)
- [OpenVPN](openvpn)
- [IP tunnel](iptunnel)