Configuration Reference

What each setting of the server's wg0.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 WireGuard on Ubuntu 24.04 with the server's own view of each (wg show and its log), and from the source code of both apps.

The server (wg0.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 WireGuard handshake …wg-download, wg-closed-port
AddressThe server's address in the tunnel; the phones get one address each of its network.wg-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.wg-udp-probe
SaveConfig = truewg-quick save keeps the phones that wg set added: after a restart of wg-quick@wg0 the server still knows them.The guide's server (WireGuard 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, and sends that phone only its own address. A key it does not have gets no answer.wg-download, wg-unknown-client-key, wg-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.wg-no-psk, wg-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 WireGuard config: a key is not valid base64 (32 bytes).wg-unknown-client-key, wg-bad-key
AddressThe phone's address in the tunnel. Without it: Invalid WireGuard config: The config has no [Interface] Address.wg-download, wg-no-address
DNSThe name servers the phone asks while connected, through the tunnel.wg-download
MTUThe tunnel's MTU on the phone; 1420 when the file has none.wg-mtu-1280
[Peer] PublicKeyThe server's public key (server.pub). Another key gets no answer.wg-wrong-server-key
PresharedKeyAs the server's for this phone; a damaged one: Invalid WireGuard config: the PresharedKey is not valid base64 (32 bytes).wg-download, wg-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 WireGuard endpoint … could not be resolved. The app looks the name up for an IPv4 address.wg-endpoint-ip, wg-port-field-overrides-profile, wg-server-field-overrides-profile, wg-unknown-host
AllowedIPs = 0.0.0.0/0All of the phone's IPv4 traffic goes through the VPN.wg-download, wg-udp-probe
AllowedIPs = 10.66.66.0/24Only that network goes through the VPN, the rest the usual way: a DNS question over UDP left from the phone's own network, while the server's tunnel address answered through the tunnel.wg-split-tunnel
PersistentKeepaliveA keepalive every so many seconds when nothing else goes. Without it the VPN works the same; the app's handshake check switches a keepalive on only until the first handshake.wg-download, wg-no-keepalive

One key per phone

SettingWhat it does for the appCases
The same file on two phonesOne key is one peer to the server, which sends to the address it last heard that key from: with two phones on it at once, each loses the traffic the server sends to the other. While Android used the iPhone's file, the server's endpoint for that peer moved to Android for 14 seconds, and four of the iPhone's downloads timed out. Give each phone its own file (add-phone.sh).The guide's server, with the iPhone downloading with phone1.conf when Android connected with the same file

What the app always does