About this project
awgctrl-go is a Go library for controlling WireGuard and AmneziaWG devices on Linux. It is a fork of WireGuard/wgctrl-go extended with complete AmneziaWG v2 support, including reading and writing AWG obfuscation parameters via netlink, parameter validation, auto-generation, and userspace daemon support.
Compared with the upstream wgctrl-go, the fork adds the ability to write and read AmneziaWG parameters, peer-level AdvancedSecurity, automatic generation and validation of AWG parameters, userspace AWG daemon support, a context.Context API, and a single netlink round-trip.
Platform support: Linux supports kernel WireGuard, kernel AmneziaWG, userspace WireGuard and userspace AmneziaWG. FreeBSD and OpenBSD support kernel and userspace WireGuard only. Windows supports userspace WireGuard only. AWG kernel and userspace support is Linux-only.
Requirements include Go 1.26 or later, a Linux kernel with the AmneziaWG module (modprobe amneziawg) or the amneziawg-go userspace daemon, and root privileges or the CAP_NET_ADMIN capability. The library is stated to work with any AmneziaWG v2 kernel module, including the upstream module; the README recommends a patched fork for production because it validates AWG parameters before applying them, serves plain WireGuard, AWG 1.0 and AWG 2.0 clients on one interface, fixes netlink dumps with many peers, and builds on newer Linux kernels and RHEL 10. Only that module reports the detected peer type via fields such as Peer.AWGPeerFlagsKnown, FixedHeaders and NoS4.
Installation is via go get github.com/advanced-wg/awgctrl-go. The README shows quick-start snippets for reading a device (listing interface name, IsAmnezia flag, peers, AdvancedSecurity, RX/TX counters), enabling AWG obfuscation by calling GenerateAmneziaParams and Validate before ConfigureDevice, and adding a peer with AdvancedSecurity enabled.
Documentation links cover an AWG parameter reference (Jc, Jmin, Jmax, S1-S4, H1-H4, I1-I5 with limits, rules and examples), peer advanced security, practical examples, and the full API reference on pkg.go.dev. The project is MIT licensed, with copyright attributed to Matt Layher (2018-2022) and Advanced-WG, V. Bantserov (2025).
Comments
0 people shared their preference · Deer Point appears after 10 participants
Sign in to join the discussion.