How to Inspect Status and Troubleshoot¶
Three commands tell you what wgpathd is doing and what it needs:
service wgpathd status # state of every peer
service wgpathd check # configuration and substrate
logread -e wgpathd # what happened
To watch every message as it happens, including routine detail, stop the service and run the daemon in the foreground, where it also writes to the terminal: service wgpathd stop; /usr/libexec/wgpathd/daemon.uc. Press Ctrl+C and run service wgpathd start when done.
ubus call wgpathd status has every field, such as up_streak, ready and backoff. The output of each is described in Service commands, ubus status and Log messages. This guide goes from symptom to cause.
The service is not running¶
service wgpathd status does not print running.
- If it prints
disabled (option enabled in /etc/config/wgpathd), setoption enabled '1'and runservice wgpathd start. - Run
service wgpathd checkand fix everyFAILline.startrefuses a configuration that fails the check, and says so withinvalid configuration, not starting; nothing retries it. - If the check passes, look at the last lines of
logread -e wgpathd. Astartup failed:line names the problem as an error code, and procd retries every 5 seconds.INTERFACE_MISSING: the interface is not up; checkubus call wireguard status.PUBLISHER_LISTEN_FAILEDon a hub:serve_addris not assigned on this host, often becausewg_hubis down, or another process holds the port.
- Fix the cause and run
service wgpathd start.
A peer is missing from peers¶
The peer is not managed. Find it under unmanaged in the status, or in the peer lines of service wgpathd check; the reason says why. The reasons are listed in Managed and unmanaged peers.
not configured: the peer has nopeersection in/etc/config/wgpathd, or itspublic_keythere differs from the one in/etc/config/network. Add or fix it as in How to configure a spoke, then runservice wgpathd reload. Ifservice wgpathd checkwarns about options left over in/etc/config/network, see How to upgrade from a release that kept peer settings in the network configuration.fixed endpoint: asnot configured, for a peer with anendpoint_hostin/etc/config/network. For the hub peer that is right, and nothing needs fixing. For another spoke, add itspeersection: wgpathd then steers it in place of the fixed endpoint.configured more than once: twopeersections have the peer's key. Remove one, then runservice wgpathd reload.missing ...orinvalid ...: fix therelayortunnelof the peer'speersection in/etc/config/wgpathd(or itspublic_keyin/etc/config/network), then runservice wgpathd reload.relay routes into wg_mesh: somewg_meshpeer'sallowed_ipscovers the relay address. Remove it and make sure the hub'swg_hubpeer holds the transit range. Check withip route get <relay address>; it must saydev wg_hub, andservice wgpathd checkmust show the peer asok. Then runservice wgpathd reload: the reload guards the peer again and logspeer <section> (<key prefix>): relay route found, now managed.relay route lookup failed: ...: usuallywg_hubwas not up yet. wgpathd retries every cycle and logsrelay route found, now managedwhen it succeeds.
A managed peer that is missing from the kernel's peer table is skipped and logged as absent from wg_mesh, skipped. Check wg show wg_mesh; the peer returns to normal once netifd has it again, logged as back in wg_mesh.
A peer never becomes ready¶
up_streak stays at 0 and ready stays false. The peer has no direct evidence.
- Roamer side (it should reach an anchor):
- Discovery is
stale(discovery.freshisfalse): the spoke cannot fetch from the hub. Seediscovery failed:lines in the log, and tryuclient-fetch -qO- <discovery URL>. AConnection refusedusually means the hub's firewall rejects the port:service wgpathd checkon the hub says so in itsfirewall:line. - The peer's key is not in the hub's published list: the hub has no IPv6 endpoint for it, or none that could be a direct path. On the hub, check
service wgpathd status. candidate_refusedis set: this router will not take the published address, and the log says why incandidate refused endpoint=<endpoint> reason=<reason>. Anown addressorroutes into <iface>usually means a route or an address on this router covers the peer's public address; see Discovery HTTP API.ping -6 <peer IPv6 address>fails: the peer's host does not answer ICMPv6 echo, for example because its firewall lost OpenWrt'sAllow-ICMPv6-Input(itsservice wgpathd checksays so), or the address is stale.
- Discovery is
- Anchor side: an anchor usually cannot ping a roamer behind a stateful firewall. Its evidence comes from the roamer's direct packets. Make sure the roamer is in steer mode and has reached DIRECT.
- Neither side is inbound-reachable: the pair stays on the relay. That is the intended result.
A peer is ready but never trials¶
modeisobserve. Trials only happen in steer mode: How to move a spoke from observe to steer. In observe mode the log saysready, steer would trial endpoint=<endpoint>when a peer becomes ready.backoffis not 0: a trial waits until the backoff since the last failure has passed.readycan betruein the meantime.
Trials time out¶
The log shows transition TRIALING -> RELAY reason=trial_timeout backoff=<s>s again and again, with the backoff growing, until the address is given up.
The direct endpoint answers ping, but WireGuard traffic does not get through both ways. Common causes:
- The anchor does not accept UDP
51820from WAN over IPv6. - The endpoint published by the hub has a port that does not reach the peer's
wg_mesh, for example because of port translation. - The peer does not answer the tunnel probe: its firewall does not accept ICMP echo requests from the zone of its
wg_mesh. Runservice wgpathd checkon the peer: itsfirewall:line for the tunnel probe says so, with the rule to add. See How to open the firewall for wgpathd. - One direction is broken. The trial needs a round trip, so one-way loss correctly fails it.
- The path drops large packets. The tunnel probe fills the
wg_meshMTU, so a direct path that only carries smaller packets, for example over a link with a lower MTU that drops what does not fit, fails the trial. Lower thewg_meshMTU on both sides until full-size packets cross, or leave the peer on the relay. - The other side is in RELAY and sends a lot of traffic through the relay. Its packets move this side's endpoint back onto the relay, and an answer that comes back that way does not count. On a healthy path a trial still gets through between those packets, and the other side then trials on the roam; if it is held by its own backoff, this side waits for that backoff to run out.
Each failed trial also cuts that peer's traffic for up to trial_window. After give_up_after of them in a row (3) on the same address, wgpathd stops testing it; see What a trial costs.
The direct address is given up¶
The log shows direct address given up endpoint=<endpoint> failed_trials=<n> pause=<s>s, and given_up is set for the peer in ubus call wgpathd status. After give_up_after trials in a row on that address timed out, wgpathd stopped testing it on the underlay echo alone, so the peer's traffic no longer pays for a failed trial every backoff. The peer stays on the relay; up_streak goes on counting the echo answers, but ready stays false.
It tests again by itself, logged as direct address trials resumed reason=<reason>, when:
- the peer's packets arrive directly, for example when the other side tests the path (
roam), - the hub publishes another address for the peer that answers ping (
new_candidate), - the time in
given_up.untilhas passed,give_up_pauseafter the give-up, 6 hours by default (pause_over). This is one trial: if it fails, the address is given up again at once.
Once you have fixed the cause, one of those in Trials time out, you need not wait: service wgpathd restart forgets the give-up, and the peer earns direct again from scratch. A reload keeps it. To give up sooner or later, see How to tune timing parameters.
A peer keeps falling back¶
The log alternates reason=trial_ok and transition DIRECT -> RELAY reason=demoted. The direct path passes a trial, then loses m_down tunnel probes in a row.
wgpathd already damps this: each demotion doubles the backoff up to 15 minutes, so a flapping path ends up parked on the relay. If the path is merely lossy, raising m_down makes it more tolerant. See How to tune timing parameters.
Endpoints change on every cycle¶
wg show wg_mesh endpoints flips between the relay and a direct address while the status says RELAY. This is normal when the other side is DIRECT and this side is not yet: this side re-asserts the relay each cycle, and the other side's direct packets roam it back. This side trials on the first such roam, so it ends within a cycle or two, or stays like this while its backoff runs. Both directions keep working. While it lasts, this side's own traffic reaches the other side through the relay and roams that side back as well, which shows there as a growing relayed_answers.
Both sides are DIRECT but traffic still uses the relay¶
Both peers show DIRECT, yet wg show wg_mesh endpoints keeps showing the relay on one side or both, and relayed_answers in ubus call wgpathd status grows every cycle. Site-to-site latency sits between the direct and the relay figures.
This is WireGuard's roaming, not a wgpathd fault. Its endpoint follows the last authenticated packet, from whichever path. When both sides switch from the relay to direct while traffic flows steadily between them, packets already on their way through the relay arrive after the switch, since the relay is slower, and move the endpoint back. Each side then sends through the relay again, and moves the other one back in turn. wgpathd re-asserts the direct endpoint every cycle, but steady traffic with no pause longer than the relay's extra latency can keep the two bouncing for as long as it lasts. In the lab, with 20 ms added to the relay round trip and a steady 100 packets/s, it did not settle within two minutes.
Nothing is lost: all traffic still arrives, part of it over the relay. It ends at the first pause in the traffic. If it persists, check that the direct path is really healthy: a direct path that died while the peer was DIRECT looks the same, since relayed answers still hold DIRECT (see Relay traffic and the proof). A short pause in the traffic, or service wgpathd restart on one side, tells the two apart: on a healthy path the endpoints settle on the direct addresses.
The log shows an outage¶
Repeated failures are logged once, when they start, and again with recovered when they end. A failed line with no recovered after it means the problem is still there.
discovery failed:: the spoke cannot fetch from the hub. Fix discovery, or wait while the hub is down; direct paths that work are not affected.watchdog ping failed:: procd does not know the service. This happens when the daemon is started by hand instead of throughservice wgpathd start.saving the discovery cache failed::/var/run/wgpathdcannot be written, usually because the tmpfs is full. The payload is used all the same.setting endpoints on <iface> failed:: the cycle's singlewg setfailed, so no endpoint was set and no tunnel probe was sent. Check thatwgis installed and the interface exists.reading the MTU of <iface> failed:: the mesh interface is missing, so no tunnel probe could be sized or sent.sending probes failed:: a probe could not be sent, for example because the mesh interface was being recreated or a probe did not fit the route's MTU.