WireGuard Configuration
Chute supports WireGuard as an outbound proxy protocol. You can either configure WireGuard inline in the [Proxy] section, or define a named [WireGuard] section and reference it.
WireGuard Section
A [WireGuard] section defines a complete WireGuard tunnel configuration that can be referenced by name from a WireGuard proxy server.
[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
Parameters
| Key | Required | Description |
|---|---|---|
private-key |
Yes | WireGuard private key, base64-encoded |
peer-public-key |
Yes | Peer public key, base64-encoded |
self-ip |
No | Local IPv4 address for the WireGuard interface (default: 10.0.0.2, for both WireGuard and AmneziaWG) |
self-ip-v6 |
No | Local IPv6 address for the WireGuard interface |
preshared-key |
No | Pre-shared key for post-quantum resistance |
server |
Yes* | Remote server address (used when the proxy line does not specify one; the proxy line takes precedence) |
port |
Yes* | Remote server port (same precedence as server) |
wg-mtu |
No | MTU for the WireGuard interface (default: 1420). mtu in the section is read as wg-mtu; an explicit wg-mtu wins |
keepalive |
No | Persistent keepalive interval in seconds. Absent, no keepalive is sent |
allowed-ips |
No | The destinations the peer carries, as comma-separated CIDRs (e.g. allowed-ips = 10.0.0.0/8, 192.168.1.0/24). A connection to an address outside them is refused (TCP) or dropped (UDP). Absent, or listing both 0.0.0.0/0 and ::/0, means every destination; an entry that is not a CIDR is ignored with a warning, and a list in which no entry is valid carries nothing — every connection through the peer is refused |
reserved |
No | The three reserved bytes that follow the message type in the WireGuard header (e.g. reserved=0,1,2; 0/1/2 and the base64 of the three bytes are accepted too), written into every message the tunnel sends — servers such as Cloudflare WARP use them to identify the client. A value that is not three bytes is ignored with a warning |
reserved-in-mac |
No | reserved-in-mac = true writes the reserved bytes into a handshake message before its MAC (mac1) is computed, so the MAC covers them; by default mac1 is computed with them zero and they are written afterwards. Turn it on only when the peer computes and verifies mac1 over a header that already carries them; WARP does not need it. It takes effect only with reserved, is off by default, and does not apply to AmneziaWG |
* server and port must be present either in the section or on the referencing [Proxy] line; otherwise the policy is rejected as incomplete.
Surge peer Syntax
A section may describe its peer the way Surge does:
[WireGuard wg0]
private-key = base64_private_key
self-ip = 10.0.0.2
mtu = 1280
peer = (public-key = base64_peer_public_key, endpoint = example.com:51820, preshared-key = base64_preshared_key, keepalive = 25, client-id = 1/2/3, allowed-ips = "0.0.0.0/0, ::/0")
public-keybecomespeer-public-key,endpoint(host:port, or[v6]:port) becomesserverandport,client-id = a/b/cbecomesreserved, andpreshared-keyandkeepalivekeep their names. A key written directly in the section wins over the same value insidepeer.- Only one peer is used; a second one is reported as an advisory and ignored.
allowed-ipsis compiled and enforced for WireGuard TCP and UDP: a destination outside the peer's CIDRs is refused or dropped because that peer cannot route it back. Surge's section keysdns-serverandprefer-ipv6remain preserved but have no effect and appear in the notice about ignored options.- When the configuration is saved, the section is written back with the keys above instead of the
peer = (…)line.
Usage
Reference the section from a proxy server:
[Proxy]
WG = wireguard, section-name=wg0
[Proxy Group]
WGGroup = select, WG
[Rule]
IP-CIDR,10.0.0.0/8,WGGroup
FINAL,DIRECT
Multiple [WireGuard] sections can be defined for different tunnels:
[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
Note: WireGuard runs over its own UDP tunnel with a userspace TCP/IP stack. The names (e.g.
wg0) are case-sensitive.Note: A policy that takes its settings from a
[WireGuard …]or[AmneziaWG …]section cannot be tested with Test Connection in the policy editor. Write the settings into the policy line itself to test it.
Importing a wg-quick File
A .conf file with [Interface] carrying PrivateKey and a [Peer] carrying PublicKey is read as a wg-quick file, before any other .conf detection. It becomes one policy named after the file and a [WireGuard <name>] section — or [AmneziaWG <name>] when the interface carries Jc, Jmin, Jmax, S1–S4, H1–H4 or I1–I5:
Addressbecomesself-ipandself-ip-v6(the first address of each family);Endpointbecomesserverandport;AllowedIPsbecomesallowed-ips;PersistentKeepalivebecomeskeepalive;MTUbecomeswg-mtu;PreSharedKeybecomespreshared-key.- Only the first
[Peer]is used; extra peers are dropped with a warning.DNS,ListenPort,Table,FwMark,SaveConfigand thePreUp/PostUp/PreDown/PostDownhooks have no counterpart in a policy and are dropped with a warning. - The app then writes rules from
AllowedIPs:0.0.0.0/0, both0.0.0.0/1and128.0.0.0/1, or noAllowedIPsat all sends everything through the node withFINAL; a split tunnel writes oneIP-CIDR/IP-CIDR6per network through the node and thenFINAL,DIRECT. A bare address becomes/32or/128.::/0alone carries no IPv4, so it is a split tunnel too: it becomesIP-CIDR6,::/0,<node>and thenFINAL,DIRECT. - After the import the app shows Routing Rules Added, saying whether all traffic or only the listed networks go through the tunnel, and that this can be changed in the profile's rules. Chute tvOS shows the same text under Saved, or under Upload received: and the file name for a file sent from the Wi-Fi upload page.
The import reaches it wherever it reaches a profile: a picked or opened file, Import from URL, a subscription address, Import from Clipboard, a QR code on iOS and Android, the Wi-Fi upload page, the setup assistant and chute:// links.
AmneziaWG Section
Chute also supports AmneziaWG, a WireGuard variant with traffic obfuscation. An [AmneziaWG <name>] section accepts the same keys as a [WireGuard] section, plus the following obfuscation parameters:
jc,jmin,jmax— junk packet count and size range. Withjcabove zero,jminandjmaxmust both be set, andjmaxmust not be smaller thanjmin, or the tunnel is refused.s1,s2,s3,s4— junk prepended to init/response/cookie/transport packets.s1–s3may not exceed 64 bytes (s432), ands1 + 148must differ froms2 + 92, or the tunnel is refused.h1,h2,h3,h4— custom message-type header values. Each is a decimal number or astart-endrange within 32 bits, and must be greater than 4, since 1–4 are WireGuard's own message types; the four may not overlap, or the tunnel is refused.i1,i2,i3,i4,i5— special junk packet definitions. A definition that does not parse refuses the tunnel. Its tags are separated by spaces, so write a definition in double quotes, as ini1 = "<b 0xf6ab3267fa> <r 16>": unquoted, the spaces are dropped and the tunnel is refused.
A refused parameter combination is logged as WireGuard: AmneziaWG parameters rejected: <reason>, and the tunnel then fails with Failed to create BoringTun tunnel.
A policy references the section with type amneziawg (alias awg):
[AmneziaWG awg0]
private-key = base64_private_key
peer-public-key = base64_peer_public_key
self-ip = 10.0.0.2
server = example.com
port = 51820
jc = 4
jmin = 40
jmax = 70
s1 = 15
s2 = 60
h1 = 123456
h2 = 67543
h3 = 32345
h4 = 123123
[Proxy]
AWG = amneziawg, section-name=awg0
Cross-validation rules:
- AmneziaWG parameters in a plain
[WireGuard]section are a configuration error — use an[AmneziaWG]section instead. reservedcannot be used in an[AmneziaWG]section: it writes the same header bytes thath4replaces, so the combination is rejected as an error.- An
[AmneziaWG]section with no obfuscation parameters gets an advisory — it behaves as plain WireGuard.