mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2026-12-03 19:11:53 +07:00
[PR #6958] feat(amneziawg): add opt-in IPv4 echo relay with client policies #6543
Labels
No labels
backlog
bug
clarification needed
documentation
duplicate
enhancement
github_actions
good first issue
invalid
javascript
New Feature
PR welcomed
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
MHSanaei/3x-ui#6543
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/MHSanaei/3x-ui/pull/6958
Author: @Vaso73
Created: 10/26/2026
Status: 🔄 Open
Base:
main← Head:amneziawg-ipv4-echo📝 Commits (4)
4d99f93feat(amneziawg): add per-client IPv4 echo forwarding91ac7f1docs(api): sync AWG IPv4 echo referencebf6c6c2fix(amneziawg): preserve offline node account edits04da9a8Merge upstream main and preserve AWG tunnel health checks📊 Changes
63 files changed (+3152 additions, -17 deletions)
View changed files
📝
docs/content/docs/en/config/amneziawg.mdx(+66 -0)📝
docs/content/docs/en/reference/api/clients.mdx(+9 -0)📝
docs/content/docs/en/reference/api/inbounds.mdx(+12 -1)📝
docs/public/openapi.json(+86 -1)📝
frontend/public/openapi.json(+86 -1)➕
frontend/src/api/queries/useAmneziawgPingReadiness.ts(+18 -0)📝
frontend/src/generated/examples.ts(+11 -0)📝
frontend/src/generated/schemas.ts(+48 -0)📝
frontend/src/generated/types.ts(+8 -0)📝
frontend/src/generated/zod.ts(+9 -0)📝
frontend/src/pages/api-docs/endpoints.ts(+8 -1)📝
frontend/src/pages/clients/ClientFormModal.tsx(+75 -0)📝
frontend/src/schemas/client.ts(+2 -0)➕
frontend/src/schemas/primitives/awg-ping.ts(+28 -0)📝
frontend/src/schemas/protocols/inbound/amneziawg.ts(+2 -0)➕
frontend/src/test/awg-ping-ui.test.tsx(+80 -0)➕
frontend/src/test/awg-ping.test.ts(+48 -0)📝
go.mod(+1 -1)📝
internal/amneziawgnet/device.go(+2 -1)➕
internal/amneziawgnet/echo.go(+421 -0)...and 43 more files
📄 Description
feat(amneziawg): add opt-in IPv4 echo relay with client policies
Embedded AmneziaWG forwards TCP/UDP through Xray but cannot relay a client's IPv4 ping to a remote destination. Add a disabled-by-default Echo relay with per-client allow/deny CIDRs, fresh account and quota checks in both directions, and native durable traffic accounting. Only a matching real target reply is returned; generated client profiles remain unchanged.
Preserve existing tunnel-health checks: Echo to an exact configured server tunnel address is still answered by gVisor independently of the remote forwarding grant. Other unfragmented IPv4 ICMP messages continue to reach the stack. Remote Echo is intercepted before gVisor, so an unreachable remote destination cannot receive a fabricated local success. Fragmented remote ICMP, IPv6 Echo, traceroute and ICMP over VLESS/Hysteria are outside this feature.
This revision merges current main, preserving its peer-attribution, flow teardown, forwarded-port omission and shared-client lifecycle fixes. Both OpenAPI copies and the API reference are regenerated from the merged models and endpoint descriptions.
Policy and lifecycle:
awg-ping4support before new or changed enabled grants. Unchanged account edits can be saved while a node is offline and queued for reconciliation. Kernel mode is not supported by this relay.Validation on this revision:
Test-environment notes: the host timezone database disagrees with the toolchain's about Havana in November 2026.
TestNextWeeklyRenewal_RepeatedMidnightfails identically on unmodified main with host tzdata; the full successful Go/race runs explicitly use the timezone database bundled with Go 1.27.3. An earlier concurrent race run had an intermittent MTProto no-op-process test failure; the final full race run passed, as did ten repetitions of that test with a private PID namespace. No renewal or MTProto source was changed.All validation above uses synthetic data and local test processes. This revision has not been deployed to a production server and makes no new external-client acceptance claim.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.