Skip to content

feat(wireguard): support native AmneziaWG 3.1 tunnels - #139

Open
Intteger157 wants to merge 1 commit into
PasarGuard:devfrom
Intteger157:codex/amneziawg
Open

Intteger157 wants to merge 1 commit into
PasarGuard:devfrom
Intteger157:codex/amneziawg

Conversation

@Intteger157

@Intteger157 Intteger157 commented Nov 25, 2026 •

Copy link
Copy Markdown

Summary

Add optional native AmneziaWG 3.1 support to the Linux WireGuard backend. A native WireGuard core selects the embedded amneziawg-go engine by providing an amnezia object. The existing peer synchronization, interface addressing, MTU, host routing and traffic accounting apply to the userspace tunnel. The kernel backend remains the default for existing core configurations.

The implementation uses the upstream AmneziaWG UDP and Noise handshake. It requires /dev/net/tun and CAP_NET_ADMIN and does not require an AmneziaWG kernel module or external executable. The README documents the core JSON and Compose device mapping.

PasarGuard/panel#932 and PasarGuard/panel#976 cover client-side work. This change provides the server engine for native Node deployments. PasarGuard/panel#1271 generates matching .conf profiles from native cores.

Testing

  • Established a local AmneziaWG 3.1 session ten times in an isolated Linux network namespace. The test uses header protection, randomized padding and trailers, verifies bidirectional ICMP traffic and peer counters, and checks TUN cleanup.
  • make test passed on Linux with Xray and the repository's generated test certificates.
  • Run the privileged test with PG_NODE_TEST_AMNEZIAWG=1 go test ./backend/wireguard -run TestAmneziaLocalTunnel inside an isolated network namespace with loopback configured.

@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 58be8bc6-14c0-4538-bab6-f2cbba77f415

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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.

1 participant