ZH
EUR
免费版免费 安装

Raspberry Pi

ToutWAF on a Raspberry Pi or another 64-bit ARM server: required system, target boards, memory and storage. Experimental: never tried on real ARM hardware.

All ways to install

您安装的是哪个版本

目前公开的是名为 0.3.0-dev 的开发版。名称保持不变:每次发布都会替换上一次,并用构建编号区分两个构建。尚无稳定版:只有在每个系统和每个软件包都完成端到端测试之后,才会发布稳定版。因此本页的命令从 dev 通道安装。开发版可能存在缺陷:在依赖它之前,请先在测试站点上试用。

At a glance

  • A 64-bit system is required: Raspberry Pi OS 64-bit (Bookworm / Debian 12 or newer), Ubuntu 22.04 or 24.04 arm64, Debian 12 or 13 arm64. 32-bit (armv7l, armhf) is not supported and not planned, even on a Pi 4 or 5.
  • Target boards: Raspberry Pi 5, 4, 400 and CM4; Pi 3 and CM3 (1 GB: data plane only); Pi Zero 2 W (512 MB: not recommended). Pi 2 v1.1, Zero, Zero W and Pi 1: not supported. Other arm64 servers (Graviton, Ampere) use the same build.
  • Memory: the installer warns below 1 GB; for all-in-one (console, data plane and policy database on the same board) plan for 2 GB or more.
  • Storage: prefer an SSD or a good USB or NVMe drive to an SD card, which wears out with continuous writes and can be corrupted by a power loss. Choose the location with --home.

The commands, step by step

Check that the system is 64-bit

uname -m must print aarch64 and getconf LONG_BIT must print 64. Otherwise flash a 64-bit image with Raspberry Pi Imager: an in-place conversion is not possible.

bash
uname -m                    # aarch64 = 64-bit kernel (armv7l = 32-bit: unsupported)
getconf LONG_BIT            # must print 64
dpkg --print-architecture   # Debian family: arm64 is required (armhf = 32-bit system)

Check compatibility without installing

The script prints the verdict and the table of supported systems, and changes nothing on the machine.

bash
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh -o install.sh
sudo bash install.sh --check-compat

使用一行命令安装脚本

脚本会下载适合您架构的原生二进制文件,创建专用的非特权用户,并安装经过加固的 systemd 服务 toutwaf-dp(数据平面,端口 80 和 443)与 toutwaf-cp(控制平面与控制台,端口 9443),然后打印首次登录信息。

bash
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash

安装程序选项

新安装位于单一的主目录 /var/toutwaf(包含 bin、conf、data 和 logs;可用 --home DIR 或 TOUTWAF_HOME 更改),命令行工具会链接到 /usr/local/bin。较早的安装保留自己的路径(/etc/toutwaf、/var/lib/toutwaf),绝不会被移动。

options
# only let your admin network reach the console (port 9443)
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash -s -- --console-from 203.0.113.0/24

# do not touch the host firewall / choose the installation home
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash -s -- --no-firewall
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash -s -- --home /opt/toutwaf

# name the channel explicitly (the installer of the dev branch already takes the dev channel; no stable version exists yet)
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash -s -- --channel dev

Watch memory before putting real traffic on it

No memory measurement has been made on ARM: watch it, keep the number of sites and the rule sets small on a small board, and enable swap with care (never heavy swap on an SD card).

bash
systemctl status toutwaf-dp --no-pager
free -h

管理服务

两个服务都会随系统启动。使用这些命令启动、停止或重启它们。

systemd
sudo systemctl enable --now toutwaf-cp toutwaf-dp
sudo systemctl restart toutwaf-cp toutwaf-dp
sudo systemctl stop toutwaf-dp toutwaf-cp

检查服务

bash
sudo systemctl status toutwaf-cp toutwaf-dp --no-pager
toutwafctl doctor
curl -kI https://127.0.0.1:9443/
curl -s http://127.0.0.1:9101/healthz
sudo journalctl -u toutwaf-dp -u toutwaf-cp -n 50 --no-pager

升级

先备份配置和数据,再重新运行安装程序:它会保留您的设置,如果新版本未能恢复正常会自动回滚。这里显示的是新安装的路径(/var/toutwaf);较早的安装仍使用 /etc/toutwaf 和 /var/lib/toutwaf。您也可以在控制台的“更新”页面中升级。

bash
sudo mkdir -p /var/toutwaf.bak
sudo cp -a /var/toutwaf/conf /var/toutwaf/data /var/toutwaf.bak/
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh | sudo bash -s -- --update --yes
curl -s http://127.0.0.1:9101/healthz

卸载

第一段命令移除服务、二进制文件以及 ToutWAF 添加的防火墙规则,并保留您的数据。第二段还会删除配置、数据和日志。

bash
curl -fsSL https://repo.qu3ntin.com/toutwaf/toutwaf/-/raw/dev/install.sh -o install.sh
sudo bash install.sh --uninstall
purge
sudo bash install.sh --uninstall --purge

What is not verified

We prefer to say it plainly.

  • The arm64 build has been compiled and run only under emulation (QEMU): it has not been tested on any Raspberry Pi or other real ARM hardware. What this page says about real hardware is guidance, not a validated result.
  • The installer has not been run on arm64 (systemd, firewall, units); the hardened release build for arm64 has not been built.
  • No performance, memory or SD-card measurement has been made, and none is claimed: test your own traffic (toutwaf-dp bench) before relying on it.

Other ways to install

Learn more in the documentation