Protocols

WireGuard VPN blocked? Why DPI spots it and what to do

WireGuard is a fast, lean VPN protocol with modern cryptography, but it was never designed to hide. Every WireGuard handshake has the same fixed shape, with a known message type, three zero bytes and an exact length, so deep packet inspection (DPI) can recognise a WireGuard VPN on any port and block it. When WireGuard stops connecting on some networks, the usual fix is an obfuscating protocol such as VLESS + REALITY or Hysteria2, or a different network.

Published 26 November 20269 min readBy the Phoenix VPN team

WireGuard VPN illustration: a shield with a check mark sends a connection towards a dashed barrier, where a cross stops it
On this page

WireGuard is a VPN protocol and the open-source software that implements it. The Linux kernel describes it as “a secure, fast, and easy to use replacement for IPSec that uses modern cryptography and clever networking tricks” (kernel configuration), and it has been part of Linux itself since version 5.6 (WireGuard project). Several things explain its popularity:

  • Fast and light. It adds little overhead to each packet, and on Linux it runs inside the kernel rather than as a separate program.
  • Small and simple. A profile needs little more than two keys, the server’s address and the IP ranges to route through the tunnel. The whitepaper describes a Linux implementation of under 4,000 lines of code, small enough to audit.
  • Modern cryptography, nothing to choose. The handshake follows the Noise protocol framework (the Noise_IKpsk2 pattern), with Curve25519 for key exchange, ChaCha20-Poly1305 for encryption and BLAKE2s for hashing (wireguard-go source). There is no cipher negotiation: every connection uses the same fixed set.
  • UDP only. WireGuard sends everything over UDP and has no TCP mode.

The same simplicity (one fixed format, no disguise) is what makes it easy to spot.

Why DPI recognises WireGuard so easily

Deep packet inspection looks beyond a packet’s addresses and ports into its contents, searching for patterns that identify a protocol. WireGuard’s encrypted payload looks random, but the frame around it is fixed and readable.

A connection starts with a two-message handshake: your device sends an initiation, and the server answers with a response. Data packets follow. Each message type has a fixed layout (Linux kernel source):

Message First 4 bytes Size Sent unencrypted
Handshake initiation 1, then three zero bytes Always 148 bytes Sender ID, temporary public key
Handshake response 2, then three zero bytes Always 92 bytes Sender and receiver IDs, temporary public key
Cookie reply (only when the server is busy) 3, then three zero bytes Always 64 bytes Receiver ID
Data 4, then three zero bytes 32 bytes or more, padded in 16-byte steps Receiver ID and a packet counter that counts up from zero

That gives a filter easy tests. The first byte is 1, 2, 3 or 4, and the next three are zero. A 148-byte packet gets a 92-byte answer. Unless the server is under load, the last 16 bytes of both handshake messages, a field kept for an anti-flooding cookie, are zeros too. And while data flows, the same exchange repeats about every two minutes, when WireGuard renews its session keys (wireguard-go constants).

None of this depends on the port. The free network analyser Wireshark, for example, recognises WireGuard on any UDP port by checking little more than the first byte and the packet length (Wireshark’s WireGuard dissector). A filtering system can run the same kind of checks on every UDP packet crossing a network.

Once a network has recognised WireGuard, it can drop the packets, block the server’s IP address or slow the traffic down. If the handshake is dropped, the tunnel never starts. Being recognised doesn’t break the encryption, though: the network learns that you use WireGuard and which server you connect to, not what you send.

WireGuard

  1. Your deviceStarts a standard WireGuard handshake
  2. Fixed-shape handshakeFirst byte 1, then three zeros, always 148 bytes
  3. The network's DPIRecognises the pattern on any port
  4. BlockedThe handshake never gets an answer

Obfuscated protocol

  1. Your deviceVLESS + REALITY or Hysteria2
  2. The networkSees what looks like ordinary HTTPS or HTTP/3
  3. ConnectedYour traffic goes on to the internet
A standard WireGuard handshake has a shape DPI can recognise on any port, while an obfuscated protocol looks like ordinary web traffic.

WireGuard doesn’t try to hide

This is a deliberate choice, not a flaw. WireGuard’s list of known limitations says the project does not focus on obfuscation: disguising traffic is meant to happen in a separate layer on top, so WireGuard can stay focused on solid cryptography and a simple implementation. The same page explains the missing TCP mode: tunnelling TCP inside TCP performs badly, so turning WireGuard’s UDP packets into TCP is left to separate tools as well.

Signs that WireGuard is being blocked

A blocked WireGuard tunnel rarely shows a clear error. WireGuard has no separate “connecting” stage: the tunnel switches on at once and only performs a handshake when your device has something to send. So the app can show the tunnel as active while nothing loads. Look for these signs instead:

  • No “Latest handshake”. The official WireGuard apps for Windows and Android, and the wg show command, report when the last handshake happened. If that line never appears, the server’s answers aren’t reaching you.
  • Data sent, nothing received. The Transfer line shows outgoing data growing while incoming data stays at or near zero.
  • Retries in the log. If your app keeps a log, it repeats that the handshake did not complete after 5 seconds and is being retried. After 20 attempts, WireGuard gives up until there’s new traffic to send.
  • It depends on the network. The same profile works at home but not on mobile data, or on mobile data but not on office, school or hotel Wi-Fi. That points to the network rather than your settings; see VPN blocked on Wi-Fi or mobile data.

WireGuard not connecting? What to do

Rule out the usual suspects

These signs aren’t proof: a wrong key or a server that’s down looks much the same from your side. Check these first:

  • Does it fail on every network? Then the problem is probably the profile or the server: a wrong key, address or port, or a server that isn’t running.
  • Is UDP allowed at all? Some guest and office networks allow little beyond web browsing. WireGuard has no TCP fallback, so it can’t work there.
  • Is only the port blocked? Many guides use port 51820, the example in the wg(8) manual. Moving to another port can get past a port block, but not past DPI.
  • Handshake fine, but pages hang? Then the tunnel is up; check your DNS or packet size (MTU) settings instead.
  • Drops after idling on mobile data? Networks that use NAT, as many mobile networks do, can forget quiet connections. WireGuard’s PersistentKeepalive option is meant for this; its manual suggests 25 seconds.

Try a different network

If WireGuard works on one network but not another, switching between Wi-Fi and mobile data is the quickest test and often the quickest fix. But it’s a workaround: the same block will be there next time.

Switch to an obfuscating protocol

The more lasting fix is a protocol that doesn’t carry a fixed signature:

  • VLESS + REALITY makes your connection look like a TLS 1.3 connection to a regular website. It runs over TCP, so it’s also the one to try when a network blocks UDP.
  • Hysteria2 runs over a customised QUIC. By default it imitates HTTP/3, and with Salamander enabled it turns packets into outwardly random data (Hysteria). It needs UDP.
  • Shadowsocks: with AEAD ciphers, both the data and the proxy’s control fields are protected, and the 2022 edition’s traffic is designed to be indistinguishable from random bytes (Shadowsocks 2022 specification).

None of them is invisible. A server’s IP address can still be blocked, and traffic volume and timing can still be analysed. What they remove is the fixed signature that gives WireGuard away.

WireGuard obfuscation: forks and wrappers

If you run your own WireGuard server, some projects change how its packets look. Each needs extra software with matching settings on both ends:

  • AmneziaWG, a fork of wireguard-go built to resist DPI, can replace the message-type values, pad handshake messages to other sizes and send junk packets before each handshake (AmneziaWG). Most settings must match on the client and the server (AmneziaWG kernel module), and it uses its own tools and client apps.
  • swgp-go is a small proxy that runs next to WireGuard at both ends. It encrypts the first 16 bytes of every packet, where WireGuard’s readable header fields sit, and pads handshakes randomly; a stricter mode pads every packet to full size (swgp-go).
  • udp2raw wraps UDP traffic, such as WireGuard’s, in fake TCP or ICMP headers for networks that block or throttle UDP (udp2raw). It needs root-level access on Linux, with a separate version for Windows and macOS.

They can work well, but they add moving parts at both ends, and a popular disguise can become a signature of its own.

When WireGuard is still the best choice

Being easy to recognise only matters on networks that check for it. Elsewhere, WireGuard is often the best option:

  • Open networks. Home broadband and many office and mobile connections don’t filter VPN protocols at all, so WireGuard’s lack of disguise costs you nothing.
  • Speed. Low overhead leaves more of your connection for video calls, gaming and large downloads.
  • Battery. An idle tunnel sends nothing unless you turn on the keepalive option, which is off by default, and that tends to make WireGuard easy on a phone’s battery.
  • Moving between networks. When your phone switches between Wi-Fi and mobile data, the tunnel carries on: the server learns your new address from your next authenticated packet.

A sensible rule: use WireGuard where it connects, and switch to an obfuscating protocol where it doesn’t.

WireGuard compared with obfuscating protocols

No protocol wins on every network. The table shows typical behaviour; real results depend on configuration and on the network. For a broader overview, see VPN protocols compared.

Protocol Transport What a network observer sees Best for
WireGuard UDP A recognisable WireGuard handshake and packet format Speed and battery on networks that don’t block VPNs
VLESS + REALITY TCP A TLS 1.3 connection to a well-known site, with a browser-like handshake Networks that block VPN protocols but allow ordinary HTTPS, or that block UDP
Hysteria2 UDP (QUIC) Traffic that looks like HTTP/3; random-looking UDP with Salamander Lossy or unstable links where UDP gets through
Shadowsocks 2022 TCP and UDP A stream of random-looking bytes with no recognisable protocol Simple, low-overhead proxying where random-looking traffic isn’t treated as suspicious

Fix a blocked WireGuard VPN yourself or use an app

Fixing it yourself makes sense if you already run a server and enjoy the work: you control every setting. Here is what each route takes.

Fix it yourself Phoenix VPN
When WireGuard gets blocked Add VLESS + REALITY, Hysteria2 or Shadowsocks to your server, or a wrapper such as AmneziaWG, swgp-go or udp2raw at both ends Switch to VLESS + REALITY, Hysteria2 or Shadowsocks in the same app; all four protocols are in every plan
Finding what gets through Test each protocol by hand, network by network Smart Connection checks which protocols get through on your network, picks the best country and connects; you can also pick the protocol and country yourself
Server Rent a VPS outside the restricted network and keep it patched Phoenix’s dedicated servers with multi-gigabit links
Apps A separate client or profile for each protocol or wrapper, kept up to date VPN apps for Windows, Android and Android TV; iPhone/iPad and macOS coming soon
Logs You decide what your server logs; you also rely on your hosting provider No activity logs: browsing history, DNS queries and traffic content are not stored
Devices As many as your server and setup handle Ember 3, Phoenix 6, Inferno 10

Standard WireGuard isn’t designed to mask traffic from DPI — Phoenix has other approaches for that. Phoenix VPN, an obfuscated VPN for networks that block VPNs, offers WireGuard as the fast option for open networks and VLESS + REALITY, Hysteria2 and Shadowsocks for networks that block it, all four in every plan. Tap Smart Connection and the app checks which protocols get through on your network, picks the best country and connects, with nothing to configure. To try it on the network where WireGuard fails, the Phoenix and Inferno plans come with a 3-day free trial, and you can cancel anytime. Compare plans or download Phoenix VPN.

Frequently asked questions

Can DPI detect WireGuard?

Yes. Standard WireGuard packets start with a fixed message type followed by three zero bytes, and the two handshake messages always have the same sizes (148 and 92 bytes), so DPI can recognise them on any port. It can tell that you use WireGuard, but it cannot read the encrypted content.

Why does WireGuard work on Wi-Fi but not on mobile data?

Networks filter traffic differently: one may block UDP or recognise WireGuard's handshake while another lets it through, and it can just as well be the other way round. If the same profile works on one network and fails on another, try an obfuscating protocol such as VLESS + REALITY. Phoenix VPN includes it alongside WireGuard in every plan.

Does changing the WireGuard port help?

Only against a simple port block, for example on 51820, the port many guides use. DPI that recognises WireGuard's packet format finds it on any port, so a new port won't get past it.

Can WireGuard run over TCP?

Not by itself: WireGuard only uses UDP. Tools such as udp2raw can wrap its packets in fake TCP headers, but you need them on both your device and the server. On networks that block UDP, a TCP-based protocol such as VLESS + REALITY is usually simpler.

Is WireGuard still secure if DPI can detect it?

Yes. Detection shows that you use WireGuard, which server you connect to and how much data you send, but it doesn't break the encryption, so the content stays private. The risk is that the connection gets blocked or slowed down, not that it gets read.

Phoenix VPN team · Written and fact-checked by the people who build Phoenix VPN.

Skip the setup
One tap to a protocol that works

Smart Connection checks which protocols get through on your network, picks the best country and connects. Phoenix and Inferno plans come with a 3-day free trial.