WireGuard 配置

Chute 支持 WireGuard 作为出站代理协议。您可以在 [Proxy] 部分中内联配置 WireGuard,也可以定义一个命名的 [WireGuard] 部分并引用它。

WireGuard 部分

[WireGuard] 部分定义了一个完整的 WireGuard 隧道配置,可以通过名称从 WireGuard 代理策略中引用。

[WireGuard wg0]
private-key = base64_private_key
peer-public-key = base64_peer_public_key
self-ip = 10.0.0.2
self-ipv6 = fd00::2
preshared-key = base64_preshared_key
server = example.com
port = 51820
mtu = 1420
keepalive = 25
dns = 1.1.1.1

参数

必填 描述
private-key WireGuard 私钥,base64 编码
peer-public-key 对等节点公钥,base64 编码
self-ip WireGuard 接口的本地 IPv4 地址
self-ipv6 WireGuard 接口的本地 IPv6 地址
preshared-key 用于后量子抗性的预共享密钥
server 远程服务器地址(覆盖代理策略中的设置)
port 远程服务器端口
mtu WireGuard 接口的 MTU(默认:1420)
keepalive 持久保活间隔(秒)
dns WireGuard 隧道的 DNS 服务器
reserved-bits WireGuard 握手的保留位

用法

从代理策略中引用该部分:

[Proxy]
WG = wireguard, section-name=wg0

[Proxy Group]
WGGroup = select, WG

[Rule]
IP-CIDR,10.0.0.0/8,WGGroup
FINAL,DIRECT

可以定义多个 [WireGuard] 部分用于不同隧道:

[WireGuard us]
private-key = ...
peer-public-key = ...
self-ip = 10.0.1.2

[WireGuard eu]
private-key = ...
peer-public-key = ...
self-ip = 10.0.2.2

注意:WireGuard 使用基于 QUIC 的适配器。名称(例如 wg0)区分大小写。

S. Smart Rabbit LLC © All Rights Reserved            updated 2026-06-28 02:09:18

results matching ""

    No results matching ""