VPN works on Wi-Fi but not on mobile data

Mobile data is a different network: another provider, other filters, often IPv6 only and smaller packets. Most often the carrier doesn't pass the UDP that WireGuard, AmneziaWG and Hysteria2 run on, while a TCP protocol such as VLESS Reality gets through. Less often it's Private DNS, the packet size, or the phone stopping the VPN app to save battery. Below are the signs and the order to try things in.

Updated

On this page

Why the same VPN behaves differently

On Wi-Fi your traffic goes through your home or office provider, on mobile data through the carrier. The carrier has its own equipment and shapes traffic in its own way: it may let ordinary web pages through and limit what it doesn't recognize. A VPN that works at home proves the server and the profile are fine. The question is only what this network lets through.

Mobile networks have their own habits too: IPv6-only addresses, smaller packets, and one public address shared by many subscribers behind the carrier's NAT, which may forget an idle UDP connection after a short pause.

Tell the cause by what you see

  • WireGuard, AmneziaWG or Hysteria2 don't connect, VLESS Reality or Trojan do

    CauseThe carrier limits UDP or recognizes the protocol

    What to doOn mobile data, use a profile over TCP

  • It connects, then goes silent after a minute without traffic

    CauseThe carrier's NAT forgets the idle UDP connection

    What to doPersistentKeepalive = 25 in a WireGuard profile, or a TCP protocol

  • Small pages open, big pages and video hang

    CausePackets are too big for the mobile path (MTU)

    What to doLower the MTU in a WireGuard profile, to 1280 for a start

  • Sites by IP open, by name they don't

    CauseAndroid's Private DNS points to a server that doesn't answer on this network

    What to doSet Private DNS to Automatic or Off

  • The server doesn't answer at all, the phone has only IPv6

    CauseThe carrier's IPv6-to-IPv4 translator handles the VPN poorly

    What to doThe server's IPv6 address, or the APN protocol set to IPv4/IPv6

  • The VPN turns off by itself while the screen is off

    CauseBattery saving stops the VPN app in the background

    What to doRemove the battery limits for the VPN app

  • On mobile data the app says there is no network

    CauseThe phone forbids the app mobile or background data

    What to doAllow the app background data and unrestricted data usage

  • Only a few services work, even without the VPN

    CauseThe regular data is used up and only bundled apps are free, or the network lets only allowlisted sites through

    What to doCheck the balance: VPN traffic counts as ordinary data

What to try, in order

  1. 1

    Switch to a TCP protocol

    Connect a VLESS Reality or Trojan profile on mobile data. If it works, the carrier limits UDP or recognizes your protocol. Keep profiles of both kinds: UDP for Wi-Fi, where it's often faster, TCP for mobile data.

  2. 2

    Try another server or port

    Some carriers block particular addresses or ports. A server on port 443 looks like an ordinary website and gets limited less often.

  3. 3

    Check Private DNS

    On Android: Settings → Network & internet → Private DNS (names differ a little between brands). A server name typed there must answer on this network and through the tunnel. For a test, set it to Automatic.

  4. 4

    Remove battery and data limits

    Settings → Apps → the VPN app: battery usage “Unrestricted”, background data on, unrestricted data usage on. Some brands keep their own lists of apps allowed in the background: add the VPN app there too.

  5. 5

    Lower the MTU

    For WireGuard and AmneziaWG it's the MTU line in the [Interface] section of the .conf file. 1280 fits almost any path; if the speed comes back, raise it in steps.

  6. 6

    Reconnect after switching networks

    Moving from Wi-Fi to mobile data, the tunnel has to come up again over the new network. If the client stays “connected” with nothing flowing, turn the VPN off and on.

Why UDP suffers first

WireGuard, AmneziaWG, Hysteria2 and TUIC run over UDP. On a carrier's network UDP is mostly calls, games and QUIC, and some networks throttle or close UDP they can't classify; some block QUIC on port 443 so that browsers fall back to TCP. WireGuard's handshake is recognized by its first packets. AmneziaWG changes them, but a serious filter finds it over time.

VLESS Reality and Trojan run over TCP and look like a visit to an ordinary HTTPS website, so they get through where UDP doesn't. The flip side: on a lossy link where UDP does pass, Hysteria2 often keeps its speed better. Two profiles, one of each kind, cover both cases.

IPv6-only networks and the packet size

Many carriers give phones only IPv6 and reach IPv4 addresses through a translator, NAT64; on Android the 464XLAT layer lets IPv4 apps work over it. Usually you don't notice, but VPN traffic to an IPv4 server goes through the translator too, and some handle long UDP sessions badly. If the server has an IPv6 address, a profile with it avoids the translator. Some phones let you pick the protocol in the access point (APN) settings: IPv4, IPv6 or IPv4/IPv6.

Every layer of a mobile network adds headers, and the translator adds more. A VPN packet that fits on Wi-Fi can be too big there, and if the network silently drops it, the signs are odd: the handshake goes through, small pages open, big ones hang.

The two lines in wg0.conf

If the service gave you a WireGuard or AmneziaWG file, these are the lines to change before importing it, or to ask the service for. MTU goes in [Interface], PersistentKeepalive in [Peer]: every 25 seconds it sends a tiny packet so the carrier's NAT doesn't forget the connection.

wg0.conf
[Interface]
MTU = 1280
[Peer]
PersistentKeepalive = 25

What the phone itself does

  • Battery saving — Android stops background apps to save power, and some brands do it hard. A stopped VPN app takes the tunnel down with it.
  • Always-on VPN — Settings → Network & internet → VPN → the gear next to the app. With “Always-on VPN” the system starts the VPN at boot and keeps it running.
  • Only one VPN at a time — if another VPN app turns on, the first one disconnects.

In Veli

Two kinds of profiles and the phone's settings

On Android, Veli connects VLESS, VMess, Trojan, Shadowsocks, Hysteria2, WireGuard and AmneziaWG. Keep profiles of both kinds in Profiles: WireGuard or Hysteria2 for Wi-Fi, VLESS Reality or Trojan for mobile data. “Fastest” picks a server by ping, and a ping shows that the server is reachable, not that the protocol gets through: if nothing opens on mobile data after connecting, pick a TCP profile yourself. If the link goes when the phone changes networks, the app reconnects by itself and shows the attempt and the reason in the notification.

On the first run the app asks for “No battery restrictions”: choose Veli → “Don't optimize”, so the system doesn't stop the VPN in the background. The Kill switch row in Settings tells you to turn on Android's own “Always-on VPN” and “Block connections without VPN” for Veli. Diagnostics → “Check everything” on mobile data checks DNS, internet access, the clock and the VPN server; the next tab is the connection log.

FAQ

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

The carrier is a different network: it often limits UDP or recognizes certain protocols. Try a TCP protocol such as VLESS Reality on mobile data, then check Private DNS and the battery limits.

Which protocol is best for mobile data?

Where UDP passes and the link loses packets, Hysteria2. Where the carrier limits UDP, VLESS Reality or Trojan over TCP. Keep one of each.

Why does the VPN turn off when the phone is locked?

The system stops it to save battery. Turn off battery optimization for the VPN app and turn on Always-on VPN in Android's VPN settings.

Does a VPN use more mobile data?

A little: every packet carries extra headers. Speed tests use data too, so run them only when you need them.

Keep a profile for every network

Veli on Android connects WireGuard, Hysteria2, VLESS Reality and Trojan side by side: keep a UDP and a TCP profile in Profiles and switch when mobile data won't let one through.