This guide is for users who have received a WireGuard configuration from their own provider and want to check each setting in Shadowrocket. First, distinguish your local identity and tunnel address from the remote Peer. Then learn how Allowed IPs differ from app routing rules, and troubleshoot MTU in stages: handshake, light traffic, then larger transfers. Example addresses are for explaining fields only; they are not connectable servers.
1. Understand the local Interface and remote Peer
WireGuard in Shadowrocket should not be treated as “a server address and a password.” WireGuard identifies peers by public keys: your device keeps its own Private Key, and the corresponding Public Key must be registered on the remote side. Your local Peer entry uses the remote Public Key. The keys must match on both sides; a server address alone is not enough to establish a working tunnel.
A standard WireGuard configuration file usually has [Interface] and [Peer] sections. The first describes your device’s identity and tunnel address; the second describes the remote peer and the address ranges allowed through it. Shadowrocket may split these fields across several inputs. Match them by meaning, and do not paste the entire file into a key field.
2. What to enter for Private Key, Address, and Peer
Private Key is your local private key, not a remote password. It is paired with your local Public Key. If you replace the local private key without having the remote side register the new public key, the remote side can no longer recognize your device under its previous identity. Do not generate or replace keys just to “try again.” First check that the provider’s configuration is complete and still assigned to this device.
Address is the tunnel address, not the Endpoint. For example, 10.66.66.2/32 indicates your device’s IPv4 address and prefix inside the tunnel. Do not enter the server’s public IP, your current Wi-Fi address, or a destination website address here. If your provider gives you both IPv4 and IPv6 addresses, enter them separately as the form allows; do not guess an unassigned address.
Local Interface
- Private Key
- Enter the local private key from your provider’s configuration, preserving the Base64 characters and any trailing padding
- Address
- For example, 10.66.66.2/32; an example format for a tunnel address only
- MTU
- Sets the IP packet size allowed on the tunnel interface; use the configured value when available
- DNS
- If the original configuration includes this setting, also check whether Shadowrocket’s DNS settings carry it over
Address, DNS, and MTU are configuration parameters; they do not replace key-based authentication.
Remote Peer
- Public Key
- Enter the remote public key—not your local public key or either side’s private key
- Endpoint
- For example, 192.0.2.10:51820; both the address and port are for illustration
- Allowed IPs
- For example, 0.0.0.0/0; use the range specified by your provider for your intended use
- Preshared Key
- An optional extra shared key; if enabled on the remote side, it must match on both ends
Compact names in the original file, such as PublicKey and AllowedIPs, correspond to the fields listed here by meaning.
Preshared Key and Private Key are different fields. The former is an additional shared secret agreed by both sides; the latter belongs only to your local identity. If the original configuration does not include a Preshared Key, do not make one up. Similar-looking keys are not interchangeable.
3. Endpoint address, port, and UDP connectivity
Endpoint is the outer network destination used to establish WireGuard communication. If the form splits it into Address or Server and Port, enter only the hostname or IP in the address field and the port number supplied by your provider in the port field. Do not add https:// or a web path. For an IPv6 Endpoint in the original file, the common format is [2001:db8::10]:51820; the brackets distinguish the address’s colons from the port separator.
- Hostname Endpoint: DNS resolution must work first. If the hostname cannot be resolved, WireGuard has not yet reached the key verification stage.
- Port: Use the value in your configuration. Changing 51820 to 443 will not automatically make the connection work or turn WireGuard into HTTPS.
- UDP reachability: Your current Wi-Fi or cellular network, router, and the remote firewall can all affect UDP. Being able to open a regular webpage does not mean the UDP port is reachable.
- Changing networks: If results differ when switching from Wi-Fi to cellular, record the network, Endpoint address family, and test results separately. Do not change the keys at the same time.
Persistent Keepalive sends periodic packets to help maintain a NAT mapping. PersistentKeepalive = 25 is a common example that sends a packet every 25 seconds, not a value required on every network. It cannot fix an incorrect Public Key, a closed remote port, or expired account access.
4. Allowed IPs are not Global Routing rules
In WireGuard, Allowed IPs help select the Peer for traffic to a destination address and also restrict the inner source addresses accepted from that Peer. 0.0.0.0/0 covers all IPv4 addresses, while ::/0 covers all IPv6 addresses; entering only the former does not include the latter. If your provider gives you only a private subnet, the configuration is usually intended for access to a specific private network. Expanding the range yourself does not mean the remote side can route the entire internet.
Shadowrocket adds another layer of routing decisions: Global Routing and Config rules determine whether traffic is sent to this node. Even if the Peer’s Allowed IPs include the default route, traffic matching DIRECT will not automatically use the node. Conversely, routing traffic to WireGuard in the app does not mean the remote side is configured to forward it or provide the required routes and internet access.
| Setting layer | Example | What it controls |
|---|---|---|
| Peer Allowed IPs | 10.20.0.0/16 | Specifies the inner address ranges for that Peer; these are not domain rules |
| Peer default route | 0.0.0.0/0, ::/0 | Covers both IP address families; the remote side must still be able to forward the traffic |
| Config domain rule | DOMAIN-SUFFIX,example.com,DIRECT | Routes traffic for matching domains using the DIRECT policy |
| Config address rule | IP-CIDR,192.0.2.0/24,DIRECT | Selects a policy by destination IPv4 range without changing Peer keys |
In Global Routing, Proxy routes traffic through a proxy, Direct connects without one, Config follows the active configuration’s rules, and Scene follows its configured scenario. Record the current mode before troubleshooting. If you test an external website in Direct mode, the result does not show whether the WireGuard node works. In Config mode, check which rule and policy actually match your test destination.
5. Add and test the settings in Shadowrocket
The steps below use the Home node editor on iPhone or iPad. Keep the provider’s original configuration and any currently working configuration, then enter the values one at a time. The form layout may change, but the relationship between the local Interface and Peer stays the same. If your WireGuard node was imported from a subscription, open its edit screen to check the settings rather than creating multiple nodes with similar names and different parameters.
Gather the settings
Get the configuration from your provider. Identify the Interface and Peer sections, and note the Endpoint, port, Address, Allowed IPs, and MTU. Do not copy keys into publicly visible notes.
Choose the protocol
Home → “+” in the upper-right corner → Type → WireGuard. Use the form to distinguish local settings from Peer settings; do not paste the whole configuration into Private Key.
Enter each field
Enter the local Private Key and Address, then the Peer’s Public Key and the Endpoint address and port. Fill in the remaining options from the original configuration and save.
Select the node
Return to Home and tap the circle to the left of the server. Check Global Routing. To rule out routing rules as a cause, you can briefly switch to Proxy for a test, then restore the previous mode.
Test traffic
Turn on the connection. If prompted to add a VPN configuration for the first time, follow the system instructions. Run Connectivity Test, then test a small webpage and a larger transfer, recording each result.
A successful Connectivity Test confirms only the connectivity covered by the selected test method; it does not replace testing actual traffic through the tunnel. A system status showing VPN connected does not prove that a valid handshake with the remote side has completed. If the interface or available logs show the handshake time, sent bytes, and received bytes, use those as additional clues. A growing sent counter alone does not confirm two-way communication.
6. MTU symptoms and how to change one setting at a time
MTU limits the size of IP packets on the tunnel interface, in bytes. WireGuard adds encryption and UDP/IP encapsulation around inner IP packets, and the outer path may pass through other tunnels. So you cannot simply use the 1500 value common on physical network interfaces. 1420 is a common setting, not a universal answer; the usable value depends on the outer address family and the capacity of the network path.
A typical MTU or Path MTU Discovery problem looks like this: the handshake and small transfers seem fine, and small webpages load, but larger responses, uploads, or sustained transfers stall. Packet loss, DNS problems, remote restrictions, or app timeouts can cause similar symptoms, so treat this only as a troubleshooting clue. If there is no handshake at all, check the keys, Endpoint, and UDP first rather than changing MTU.
Use the configured MTU
RecommendedStart with the value explicitly supplied by your provider to establish a baseline for comparison. If the original configuration does not specify MTU, keep the client’s default behavior; do not guess based on network speed.
Best for: first-time setup or when no large-transfer issue has been confirmed
Compare with a lower MTU
If the original value is 1420, try 1380 and 1280 as separate diagnostic comparisons, leaving all other settings unchanged. Save and reconnect after each change. Do not assume a test value is the best permanent setting.
Best for: small transfers work, but larger transfers repeatedly stall
Increase the MTU
Consider this only when path conditions and test results support it. A larger number does not mean faster speeds; exceeding the path’s capacity can cause fragmentation, packet loss, or connection delays.
Best for: advanced testing with a stable baseline and controlled conditions
- Compare results on the same network, to the same destination, using the same transfer. Do not change the Peer or DNS while adjusting MTU.
- The minimum link MTU for IPv6 is 1280. If IPv6 must work, lowering MTU below 1280 is not a general-purpose fix.
- Record the original value, changed value, whether you reconnected, and the results for small and large transfers. Avoid drawing conclusions from a single page load.
- If lowering MTU does not produce a consistent improvement, restore the original value and continue checking for packet loss, network restrictions, and server-side forwarding issues.
7. Troubleshoot by failure stage, not just by blaming the keys
Troubleshoot from the outside in: first confirm that the Endpoint resolves and is configured correctly, then check UDP connectivity and identity settings, followed by the inner address, routing, DNS, and app rules. Do not change five fields at once. Even if the connection starts working, you will not know which change helped, and you could leave an incorrect address range or unnecessary keepalive setting behind.
| Symptom | Check first | Next step |
|---|---|---|
| Endpoint hostname does not resolve | Hostname spelling, current DNS, network connection | Restore hostname resolution without changing Private Key |
| No valid handshake or two-way traffic | UDP port, remote Public Key, registration of the local key, Preshared Key | Check each item with your provider; do not send your private key |
| Handshake works, but destination is unreachable | Address, Allowed IPs, remote forwarding, Global Routing, and rules | Confirm that this node is meant to carry traffic to the destination |
| IP address works, but domain name fails | DNS resolution and the route used by DNS requests | Check DNS resolution separately; do not rebuild the Peer first |
| Small requests work, but larger transfers stall | MTU, packet loss along the path, remote restrictions | Keep other conditions fixed and lower MTU one step at a time for comparison |
| Original settings return after a subscription update | Whether the node is managed by a subscription | Ask your provider to confirm the source configuration and distinguish subscription-managed nodes from manual nodes |
A subscription update may reapply node settings supplied by your provider. If you manually changed a field for troubleshooting, record the change and check whether a later refresh will overwrite it. Do not ignore an error in the source configuration just because a local change temporarily helped, and do not stop necessary configuration updates indefinitely just to preserve a test value.