Skip to content

AmneziaWG

How the AmneziaWG protocol works in V2RayTun — a DPI-resistant modification of WireGuard with jitter-based obfuscation.

What Is AmneziaWG?

AmneziaWG is a modified version of the WireGuard protocol designed to evade Deep Packet Inspection (DPI). It adds jitter parameters to the handshake and data packets, making traffic patterns unrecognizable to network filters that block standard WireGuard.

Kernel Module

AmneziaWG requires the amneziawg-dkms kernel module on the node server. V2RayTun's node installer attempts to install it automatically. If it fails, install manually:

Bash
apt install -y linux-headers-$(uname -r)
apt install -y amneziawg-dkms

Verify the module is loaded:

Bash
modprobe amneziawg
lsmod | grep amneziawg

Jitter Parameters

The obfuscation relies on a set of parameters that alter packet structure:

ParameterDescriptionTypical Value
JcJitter packet count4
JminMinimum junk size (bytes)40
JmaxMaximum junk size (bytes)70
S1Init packet magic header0
S2Response packet magic header0
H1Handshake init header1
H2Handshake response header2
H3Cookie reply header3
H4Transport data header4

V2RayTun generates these values automatically per node. You can adjust them in the panel under the node's AmneziaWG settings.

Configuration in V2RayTun

AmneziaWG is enabled per node. When active, V2RayTun:

  1. Generates a WireGuard key pair for the node.
  2. Assigns a private subnet (default 10.8.0.0/24).
  3. Creates per-user peer configurations with unique keys.

Default port: 51820/UDP.

URI Format

Text
awg://PRIVATE_KEY@ip:51820/?publickey=SERVER_PUBLIC_KEY&address=10.8.0.2/32&mtu=1420&presharedkey=PSK&dns=1.1.1.1&jc=4&jmin=40&jmax=70&s1=0&s2=0&h1=1&h2=2&h3=3&h4=4#NAME
ParameterMeaning
PRIVATE_KEYClient's private key
publickeyServer's public key
addressClient tunnel IP
mtuMaximum transmission unit
presharedkeyPre-shared key for extra security
dnsDNS server for the tunnel
jc, jmin, jmaxJitter parameters
s1, s2, h1–h4Packet header modifications

Compatible Client

PlatformClient
AndroidAmneziaVPN
iOSAmneziaVPN
WindowsAmneziaVPN
macOSAmneziaVPN
LinuxAmneziaVPN / CLI

AmneziaVPN is the primary client. Import the subscription URL or the individual AWG config to connect.