Merge pull request 'add small tutorial how to compile and install fastd' (#33) from mark22k/docs:fastd_compile into master

Reviewed-on: https://codeberg.org/CRXN/docs/pulls/33
This commit is contained in:
Marek Küthe 2023-01-11 07:36:43 +00:00
commit 0ea15f4236
2 changed files with 60 additions and 0 deletions

View File

@ -0,0 +1,59 @@
# 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.
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)