Skip to content

feat: traceroute support for WireGuard and Tailscale tunnels#4108

Open
xdqi wants to merge 77 commits into
SagerNet:testingfrom
xdqi:feature/mtr-support
Open

feat: traceroute support for WireGuard and Tailscale tunnels#4108
xdqi wants to merge 77 commits into
SagerNet:testingfrom
xdqi:feature/mtr-support

Conversation

@xdqi

@xdqi xdqi commented May 4, 2026

Copy link
Copy Markdown

Add traceroute/mtr support for WireGuard and Tailscale TUN tunnels, enabling ICMP, UDP and TCP traceroute modes to work through proxy tunnels.

Features

  • WireGuard DirectRoute: Enable DirectRoute on WireGuard device stacks to support traceroute through WG tunnels
  • NAT device TTL forwarding: Forward TTL from incoming packets to outbound connections in WireGuard NAT device
  • Configurable hop limit: Add max_traceroute_hop_limit option to TUN inbound configuration
  • Configurable TTL decrement: Add decrement_ttl option for DirectRoute behavior
  • Group outbound support: Selector and URLTest groups propagate DirectRoute and TTL settings to selected outbounds

Dependencies

Changes

  • transport/wireguard/: DirectRoute integration in device_stack and device_nat
  • protocol/direct/outbound.go: Pass TTL to direct outbound connections
  • protocol/group/: Selector and URLTest DirectRoute propagation
  • protocol/tun/inbound.go: Configurable max traceroute hop limit
  • option/tun.go: New TUN option fields
  • route/route.go: DirectRoute connection handling

@nekohasekai nekohasekai force-pushed the testing branch 8 times, most recently from 8ea55ff to a9fe3f3 Compare June 17, 2026 06:56
@nekohasekai nekohasekai force-pushed the testing branch 5 times, most recently from 2ee20d0 to ecc4776 Compare June 25, 2026 09:40
@nekohasekai nekohasekai force-pushed the testing branch 3 times, most recently from 6b41423 to 585d3e6 Compare July 5, 2026 04:47
@nekohasekai nekohasekai force-pushed the testing branch 14 times, most recently from 1eb1a6c to 1a8f5cd Compare July 8, 2026 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants