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)
| Setting | What it does for the app | Cases |
|---|---|---|
ListenPort | The 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 |
Address | The server's address in the tunnel; the phones get one address each of its network. | wg-download |
PostUp forwarding and NAT | The 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 = true | wg-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 address | One 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 PresharedKey | Optional; 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
| Line | What it does for the app | Cases |
|---|---|---|
[Interface] PrivateKey | The 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 |
Address | The phone's address in the tunnel. Without it: Invalid WireGuard config: The config has no [Interface] Address. | wg-download, wg-no-address |
DNS | The name servers the phone asks while connected, through the tunnel. | wg-download |
MTU | The tunnel's MTU on the phone; 1420 when the file has none. | wg-mtu-1280 |
[Peer] PublicKey | The server's public key (server.pub). Another key gets no answer. | wg-wrong-server-key |
PresharedKey | As 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 |
Endpoint | The 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/0 | All of the phone's IPv4 traffic goes through the VPN. | wg-download, wg-udp-probe |
AllowedIPs = 10.66.66.0/24 | Only 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 |
PersistentKeepalive | A 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
| Setting | What it does for the app | Cases |
|---|---|---|
| The same file on two phones | One 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
- WireGuard over UDP, straight to the server: no proxy, no TCP.
- Connected only after a handshake: up to 10 seconds per attempt (Auto Reconnect and Retry Times).
- New sockets on every change of network, and the server's name looked up again.