NebulaVPN · Guides

How VPN blocking works: deep packet inspection explained simply

Updated: 6 min read

Your VPN encrypts everything, so how can a network still tell that you are using one, and block it? The answer is that encryption hides what you send, but not how you send it. This guide explains, without jargon, the techniques networks use to detect and block VPNs, and what that means when you pick a protocol or an app.

What a network can see, even when traffic is encrypted

Think of a VPN as a sealed envelope. Nobody on the way can read the letter inside. But the post office can still see:

Deep packet inspection, usually shortened to DPI, is simply the practice of looking at all of these clues at once, at high speed, on every connection that passes through a network.

The five main ways VPNs are detected

1. Blocking known server addresses

The simplest method does not look at packets at all. Many commercial VPNs use a list of data-centre IP addresses that can be discovered by anyone who signs up. A network operator can collect those addresses and block them. This is cheap and effective against large public VPN brands, but it does nothing against a server nobody has listed yet.

2. Port blocking

Older VPN protocols use well-known ports: OpenVPN usually uses 1194, IPsec uses 500 and 4500, and WireGuard is often set up on 51820. Blocking those ports stops many default installations. Moving a VPN to a different port defeats this, which is why port blocking alone is rarely used any more.

3. Protocol signatures

This is the core of DPI. Many protocols announce themselves in the first packets of a connection. For example:

A DPI box does not need to break the encryption to match these patterns. It only needs to compare the first packet of a new connection against a list of fingerprints, which modern hardware can do at line speed.

4. Statistical analysis

When the first packets are disguised, a filter can still look at behaviour over time: the distribution of packet sizes, how evenly packets are spaced, and how "random" the bytes look. Encrypted VPN traffic tends to be very uniform and very random, which is different from, say, a video stream or a web page loading. This method is less certain, so it is often used to slow down suspicious traffic rather than block it outright.

5. Active probing

Some advanced filters go one step further. When they see a connection they suspect, they connect to the same server themselves and send test messages. If the server answers the way a known VPN or proxy would, its address is blocked. Well-designed tools defend against this by not answering at all to anyone who does not already have the right key, and WireGuard-based servers naturally stay silent to unauthenticated packets.

Blocking, throttling and whitelisting

Detection is only half the story. Once a connection is classified, a network can respond in different ways:

This explains a frustrating experience many people have: a VPN works perfectly one week and badly the next, without any change on your side. The filter's rules changed.

How VPN protocols fight back

There are two broad strategies to avoid detection:

Look like nothing

The idea is to remove every fixed pattern so the traffic looks like random noise with no recognizable start. AmneziaWG takes this approach: it sends a few random "junk" packets before the handshake, pads the handshake to random sizes, and replaces the fixed message type numbers with custom values agreed between client and server. The encryption stays the same as WireGuard; only the visible fingerprint disappears. Our protocol comparison covers the details.

Look like something allowed

The other strategy is to disguise the VPN as ordinary HTTPS traffic to a popular website, so that blocking it would also break normal browsing. Tools in this family wrap the tunnel inside real TLS. This works well against whitelisting, at the cost of more complexity and usually a bit less speed.

Neither approach is permanent. Filters adapt, then tools adapt. That is why it is worth using a provider that can change configs when the situation changes, instead of a static setup you cannot update.

What this means for you in practice

  1. If a VPN never completes the handshake (in the WireGuard or AmneziaWG app, "latest handshake" never appears), the network is probably dropping that protocol. Try a disguised protocol like AmneziaWG.
  2. If it connects but is extremely slow, you may be throttled. Try another server or protocol, and run a speed test with and without the VPN to compare.
  3. If it works on Wi-Fi but not on mobile data (or the other way round), the two networks apply different rules. That is normal and not a fault in your device.
  4. If everything stopped working at once, check the news or your provider's channel before reinstalling anything. A network-wide change affects everyone at the same time.

Our troubleshooting guide, VPN connected but no internet, walks through these checks step by step.

A note on privacy

Even when a network can tell that you use a VPN, it still cannot see the websites you visit or the content you send, as long as the VPN's encryption is sound. Detection reveals the fact of using a VPN, not what you do through it. If you also want to be sure nothing leaks outside the tunnel, read how to test your VPN for leaks.

More guides