Configuration Reference

What each setting of the server's awg0.conf and each line of a phone's .conf file does for the app. The cases are the rows of Test results that show it, on both phones unless a row says otherwise.

Where this page comes from

The behaviour comes from the cases named in each row, run against our amneziawg-go fork on Ubuntu 24.04 as AmneziaWG server sets it up, with the server's own view of each (awg show and its log); the RandomTrailers row also from the same cases against AmneziaWG's kernel module, unchanged; from a client with amneziawg-go as Amnezia releases it on the server itself (the lab rows, which show what AmneziaWG's own releases do); and from the source code of both apps and of AmneziaWG.

The generations of AmneziaWG

AmneziaWG added settings in steps; a server and a phone that share a step's settings connect. The app takes every step's settings, and a file of any step.

StepSettings that must match the serverThe phone's own settingsCases
1.0S1, S2; H1 to H4 as single numbersJc, Jmin, Jmaxawg-gen-1-0
1.5as 1.0as 1.0, and I1 to I5awg-gen-1-5
2.0S1 to S4; H1 to H4 as rangesJc, Jmin, Jmax, I1 to I5awg-download and the other cases on awg0
3.0as 2.0, and HeaderProtectionKeyas 2.0, and ContentPaddingAddition, the five timings and a PersistentKeepalive rangeawg-gen-3-0
3.1as 3.0, and RandomTrailersas 3.0, and DisableCookiesawg-gen-3-1, awg-gen-3-1-ranges
nonenone: WireGuard's own formatnoneawg-gen-none

The server (awg0.conf)

SettingWhat it does for the appCases
ListenPortThe UDP port of the phones' Endpoint. A phone whose file names another port gets no answer: The server did not answer the AmneziaWG handshake …awg-download, awg-closed-port
AddressThe server's address in the tunnel; the phones get one address each of its network.awg-download
S1, S2The random bytes in front of the handshake's first message and of its answer. A phone with another value gets no answer.awg-download, awg-s1-mismatch
S3, S4The random bytes in front of a cookie message and of every data packet. A phone with another S4 (or without S3 and S4) gets its handshakes answered and none of its traffic: the app ends the VPN with The server answers the AmneziaWG handshake but none of the traffic: S3, S4 or H4 may differ from the server's.awg-download, awg-life-s4-mismatch, awg-life-s4-mismatch-no-reconnect
H1, H2The ranges the first four bytes of the handshake's messages are drawn from (a single number in AmneziaWG 1.0). Another H1 gets no answer.awg-download, awg-gen-1-0, awg-h1-mismatch
H3, H4The same for cookie messages and data packets. Another H4 is answered like another S4: the handshake, none of the traffic.awg-download, awg-life-h4-mismatch
HeaderProtectionKeyEncrypts the header fields WireGuard sends in the clear; the phone needs the same key. A phone with another key, or none, gets no answer.awg-gen-3-0, awg-hpk-mismatch, awg-hpk-missing
RandomTrailers = onRandom bytes after each packet; the phone must have it too, or the server does not answer. With RandomTrailers on and ranges in H1, H2 or H3, AmneziaWG as Amnezia releases it, the kernel module and amneziawg-go alike, takes data packets whose bytes at a handshake message's offset fall in that message's range for handshake messages and drops them: with ranges of 100,000,001 values, 12 to 15% of the pings through the tunnel were lost in the lab. Our amneziawg-go fork, in the app and on the server AmneziaWG server sets up, keeps them: with such ranges the iPhone downloaded at 185 and uploaded at 214 Mbit/s (211 and 219 without RandomTrailers), and Android took 3.9 s for its downloads and 8.4 s for its uploads (4.0 and 8.3 s), with or without a HeaderProtectionKey. Against the kernel module the app still gets every packet, and with a HeaderProtectionKey the module reads the phone's packets right too; without one it drops some of them, and uploads fell to 31 Mbit/s on the iPhone and 36.7 s on Android. On such a server a HeaderProtectionKey is enough for the app; single values in H1 to H4 avoid the loss for every client.awg-gen-3-1, awg-gen-3-1-ranges, awg-ranges-trailers-…, awg-kernel-module-…, awg-trailers-missing
DisableCookies = onThe server sends no cookie messages when it is under load. It changes nothing for a phone.awg-gen-3-1
MTUThe server's tunnel MTU. With S4, data packets are S4 bytes longer: 1420 less S4 keeps a full packet within a 1500-byte path, in both directions.awg-download
PostUp forwarding and NATThe phones reach the internet through the server, with its address: a DNS question over UDP to OpenDNS for the asker's own address came back with the server's address.awg-udp-probe
SaveConfig = trueawg-quick save keeps the phones that awg set added, and the obfuscation values: after a restart of awg-quick@awg0 the server still has both.The guide's server (AmneziaWG server, its source note)
A [Peer] with AllowedIPs = the phone's addressOne peer per phone: the server takes a handshake only from a key it has as a peer. A key it does not have gets no answer.awg-download, awg-unknown-client-key, awg-guide-removed
The peer's PresharedKeyOptional; when the server has one for a phone, the phone's file must have the same. A different one gets no answer.awg-no-psk, awg-wrong-psk

The phone's file

LineWhat it does for the appCases
[Interface] PrivateKeyThe phone's key; the server must have its public key as a peer. A damaged key: Invalid AmneziaWG config: a key is not valid base64 (32 bytes).awg-unknown-client-key, awg-bad-key
AddressThe phone's address in the tunnel. Without it: Invalid AmneziaWG config: The config has no [Interface] Address.awg-download, awg-no-address
DNSThe name servers the phone asks while connected, through the tunnel.awg-download
MTUThe tunnel's MTU on the phone. Without one, the app takes 1420 less S4 (1420 without S4), so a full data packet fits a 1500-byte path.awg-no-mtu, awg-mtu-1280
S1 to S4, H1 to H4, HeaderProtectionKey, RandomTrailersThe server's values (see above). S1 to S4 are whole numbers from 0 to 65535, H1 to H4 numbers or ranges up to 4294967295; another value is refused before connecting: Invalid AmneziaWG config: H1 must be a number or a range such as 1000000-1999999. A damaged key: Invalid AmneziaWG config: the HeaderProtectionKey is not valid base64 (32 bytes).awg-invalid-h1, awg-invalid-header-protection-key
Jc, Jmin, JmaxJc junk packets of Jmin to Jmax random bytes before every handshake; the server drops them. Keep Jmax under the path's MTU.awg-download, awg-gen-1-0
I1 to I5Packets made from a pattern, sent before the junk packets: <b 0x…> bytes as written, <r N> random bytes, <rc N> random letters, <rd N> random digits, <t> the time. A pattern AmneziaWG cannot read is refused with its reason: AmneziaWG refused the configuration: failed to parse I1: unknown tag <x>awg-gen-1-5, awg-download, awg-invalid-i1
ContentPaddingAdditionRandom bytes added inside data packets, up to the largest packet sent so far.awg-gen-3-0, awg-idle-padding
RekeyAfterTime, RekeyTimeout, RejectAfterTime, KeepaliveTimeout, MaxHandshakeAttemptsWireGuard's timings (120, 5, 180 and 10 seconds, and 18 attempts), changed or randomized: a range picks a value each time.awg-gen-3-0
[Peer] PublicKeyThe server's public key (server.pub). Another key gets no answer.awg-wrong-server-key
PresharedKeyAs the server's for this phone; a damaged one: Invalid AmneziaWG config: the PresharedKey is not valid base64 (32 bytes).awg-download, awg-bad-preshared-key
EndpointThe server's name or address and its port, which fill Server and Port on import; changed in the editor, they replace it. A name the app cannot look up: The AmneziaWG endpoint … could not be resolved. The app looks the name up for an IPv4 address.awg-endpoint-ip, awg-port-field-overrides-profile, awg-server-field-overrides-profile, awg-unknown-host
AllowedIPs = 0.0.0.0/0All of the phone's IPv4 traffic goes through the VPN.awg-download, awg-udp-probe
AllowedIPs = 10.67.0.0/24Only that network goes through the VPN, the rest the usual way.awg-split-tunnel
PersistentKeepaliveA keepalive every so many seconds when nothing else goes; AmneziaWG also takes a range (20-30). Without it the VPN works the same. With padding and random trailers a keepalive is as long as a data packet; the app's check for a server that stopped answering allows for that, and idle sessions stayed up.awg-download, awg-no-keepalive, awg-idle-padding, awg-idle-trailers

WireGuard's files

An AmneziaWG profile connects with a plain WireGuard file to a server without obfuscation (awg-gen-none); to an AmneziaWG server such a file gets no answer (awg-wireguard-file). A WireGuard profile does not take a file with AmneziaWG settings: the editor refuses it at import, and a profile that has one ends with This configuration has AmneziaWG settings (…): use the AmneziaWG VPN protocol for it.

What the app always does