WireGuard Packet Loss Investigation Report

1. Environment

Hardware

Software

Network Topology

  1. Local Network (10.0.0.x):
  2. WireGuard Setup:

2. Problem Statement

After migrating to OpenWrt, devices within the local network experience 25-37% packet loss when communicating through WireGuard, while external WireGuard clients maintain perfect connectivity. The issue affects both wired and wireless clients.

3. Initial Configuration

WireGuard Client (Alexandria)

[Interface]
PrivateKey = [REDACTED]
Address = 10.1.1.11/24
[Peer]
PublicKey = [REDACTED]
PresharedKey = [REDACTED]
AllowedIPs = 10.1.1.0/24
PersistentKeepalive = 45
Endpoint = URL:51820

WireGuard Server

Environment:
  WG_HOST: URL
  WG_PORT: 51820
  WG_DEFAULT_ADDRESS: 10.1.1.x
  WG_DEFAULT_DNS: 10.1.1.11
  WG_PERSISTENT_KEEPALIVE: 90
WireGuard Packet Loss Investigation Report

WireGuard Packet Loss Investigation Report

4. Tests Performed

Test Series 1: MTU Adjustments

1.1 Initial Test

WAN: 1420, br-lan: 1200
Alexandria:

Summary: 16-33% loss, latency stable 48-50ms, best performance to 10.1.1.2

PC:

Summary: Consistent 25% loss, first packet typically lost, latency 50-100ms

1.2 Matched MTU Test

WAN: 1400, br-lan: 1400
Alexandria:

Summary: 16-33% loss, latency consistent ~49ms, improved stability to 10.1.1.2/3

PC:

Summary: Variable performance, occasional perfect runs to 10.1.1.2, latency 50-100ms

1.3 Higher MTU Test

WAN: 1500, br-lan: 1480
Alexandria:

Summary: 16-50% loss, latency stable 48-50ms, worst performance to 10.1.1.4

PC:

Summary: Highly variable 0-50% loss, latency 50-85ms, best performance to 10.1.1.4

1.4 Differential MTU Test

WAN: 1400, br-lan: 1380
Alexandria:

Summary: Increased loss 16-50%, latency stable 48-50ms when connected

PC:

Summary: Consistent 25-33% loss, latency more variable 50-120ms

Test Series 2: MSS Clamping

WAN: 1420, br-lan: 1420
MSS Clamping: ON for LAN
Alexandria:

Summary: Improved stability, 0-33% loss, latency consistent 48-50ms

PC:

Summary: Better performance to some endpoints, latency 50-100ms, perfect runs to 10.1.1.2/3

Test Series 3: Flow Offloading

WAN: 1420, br-lan: 1420
MSS Clamping: ON
Software Flow Offloading: ON
Alexandria:

Summary: Inconsistent performance between tests, 0-33% loss, latency stable when connected

PC:

Summary: Extreme variation, perfect to some endpoints, poor to others, latency 50-150ms

Test Series 4: Final Configuration

WAN: 1400, br-lan: 1400
MSS Clamping: ON
Flow Offloading: OFF
Traffic Rules: WG UDP + ICMP enabled

First Run:

Alexandria:

Summary: Perfect connectivity, latency 48-50ms (82ms to 10.1.1.4)

Second Run:

Alexandria:

Summary: Significant regression, 16-50% loss, latency stable when connected

PC:

Summary: Mixed results, perfect connectivity to some endpoints, latency 46-103ms, occasional high spikes

Key Observation: Perfect connectivity achievable but not maintainable, suggesting system-level inconsistency rather than pure configuration issue.

5. Findings

  1. Issue is specific to OpenWrt implementation
  2. External WG clients maintain perfect connectivity
  3. MTU adjustments affect but don't solve the problem
  4. MSS clamping improves stability
  5. Flow offloading potentially causes more issues
  6. Perfect connectivity is possible but not consistent
  7. Both wired and wireless clients affected similarly
  8. First packets often lost after idle periods
  9. Latency stable when packets successfully transmitted
  10. Performance varies between test runs with identical settings

6. Recommendations

  1. Keep current configuration:
  2. Consider:
  3. Further investigation needed:

7. Additional Notes

The fact that perfect connectivity is achievable but not maintainable suggests a potential race condition or resource management issue in OpenWrt's network stack rather than a pure configuration problem. The inconsistency between test runs with identical settings points to a deeper system-level issue.