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-ip-v6 = fd00::2
preshared-key = base64_preshared_key
server = example.com
port = 51820
wg-mtu = 1420
keepalive = 25

参数

必填 描述
private-key WireGuard 私钥,base64 编码
peer-public-key 对等节点公钥,base64 编码
self-ip WireGuard 接口的本地 IPv4 地址
self-ip-v6 WireGuard 接口的本地 IPv6 地址
preshared-key 用于后量子抗性的预共享密钥
server 是* 远程服务器地址(当代理行未指定时使用;代理行优先)
port 是* 远程服务器端口(优先级与 server 相同)
wg-mtu WireGuard 接口的 MTU(默认:1420)。mtu 仅在 [Proxy] 行内联时可用
keepalive 持久保活间隔(秒)
reserved WireGuard 握手头部的保留字节(例如 reserved=0,1,2

* serverport 必须出现在该部分或引用它的 [Proxy] 行中;否则该策略会因不完整而被拒绝。

用法

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

[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 运行在自身的 UDP 隧道上,并使用用户态 TCP/IP 协议栈。名称(例如 wg0)区分大小写。

S. Smart Rabbit LLC © All Rights Reserved            updated 2026-07-28 17:49:04

results matching ""

    No results matching ""