When your phone leaves Wi-Fi and switches to mobile data, it gets a completely new path to the internet — and a new public IP address. Your VPN has to notice the change and carry on over the new network. With a modern protocol such as WireGuard, that usually happens within moments and you won’t see anything at all. Sometimes, though, the VPN pauses, shows a reconnecting state, or appears connected while traffic has stalled. And in the short window while the phone moves between networks, some traffic may not be covered by the VPN, depending on your settings.

This guide explains what really happens during the switch, how different VPN protocols cope with it, where the gaps are, and what you can set on Android and iPhone to keep the VPN steady as you move.

What changes when your phone switches networks

From the outside, a network switch looks like a small icon changing at the top of your screen. Underneath, quite a lot happens:

  • Your phone gets a new local address on the mobile network, and the Wi-Fi one disappears.
  • Your public IP address changes. On Wi-Fi it belongs to the router’s internet provider. On mobile data it belongs to your carrier — often a shared address at a gateway in another city, because many carriers use carrier-grade NAT (the shared address range reserved in RFC 6598). This is also why your apparent location can change; see why your IP address shows the wrong location.
  • Existing connections are cut. Every connection your apps had open was tied to the old address, so ordinary apps have to reconnect. Most do this silently.
  • The VPN’s own connection has to move. The encrypted connection between your phone and the VPN server was also using the Wi-Fi path. It now has to continue from the new address.

The last point is where VPN protocols differ.

How VPN protocols handle a network change

WireGuard was designed with roaming built in. The server doesn’t rely on your phone keeping the same address; it simply sends replies to wherever the last valid, authenticated packet came from. The WireGuard project describes it this way: both sides “send encrypted data to the most recent IP endpoint for which they authentically decrypted data,” giving “full IP roaming on both ends.” The WireGuard whitepaper explicitly mentions roaming “between mobile networks” as a goal. So as soon as your phone sends its first encrypted packet over mobile data, the server switches to the new path. There’s no new login and no new session to negotiate.

IKEv2, common on iPhone and in workplace VPNs, can handle address changes through an extension called MOBIKE. RFC 4555 describes it as allowing a remote-access VPN user to “move from one address to another without re-establishing all security associations with the VPN gateway.” It works well when both the app and server support it.

OpenVPN can accept a client’s new address over UDP with its float option — its manual notes that “--float only works when using UDP transport.” Over TCP, a network change breaks the underlying connection, so the client has to reconnect from scratch, which can take noticeably longer.

How VPN protocols handle network changes
Protocol Built-in handling What you might notice
WireGuard Roaming by design: the server follows the newest authenticated address Usually nothing; occasionally a short stall
IKEv2 with MOBIKE Negotiated address update for the existing session Usually a brief pause
OpenVPN over UDP Can accept the new address with float Brief pause, or a reconnect if not enabled
OpenVPN over TCP Connection breaks; client reconnects A visible “reconnecting” state

Protocol design is only part of the story. The app still has to be running, the phone has to hand the new network to the VPN, and the new network has to allow VPN traffic. That’s where problems appear.

Why your VPN can still drop or stall

Even with a roaming-friendly protocol, several things can interrupt the session:

  • The phone hasn’t sent anything yet. WireGuard’s server learns the new address from the phone’s next packet. If the app was suspended or the phone was idle, nothing goes out until something wakes it, and incoming messages can’t reach you in the meantime.
  • The mobile network forgets idle connections. Mobile carriers and routers translate addresses (NAT) and drop idle mappings after a timeout. WireGuard’s quickstart explains that a device behind NAT “must keep the NAT/firewall mapping valid, by periodically sending keepalive packets,” and suggests 25 seconds as an interval that works with a wide variety of firewalls. For comparison, the internet standard for NAT behavior (RFC 4787) says a UDP mapping should not expire in under two minutes, but real networks don’t always follow it.
  • The new network blocks VPN traffic. WireGuard uses UDP. Some Wi-Fi networks and a few mobile networks restrict it, so the switch can land you on a network where the VPN can’t get through.
  • Wi-Fi that’s connected but useless. The worst case is often not a clean switch but a weak or captive Wi-Fi network your phone keeps clinging to — such as a café network you walked away from, or one that wants you to sign in again.
  • Battery management. Android phone makers often restrict background apps. If the VPN app’s service is put to sleep around a network change, it may not recover until you open it.

If the VPN says Connected but nothing loads after a switch, disconnecting and reconnecting almost always fixes it. For a full troubleshooting walkthrough, see VPN connected but no internet? How to fix it on Android and iPhone.

Is your traffic exposed during the switch?

This is the question that matters most for privacy. The honest answer is: it depends on your phone’s settings, and a brief window is possible.

When the VPN is running normally, your phone sends app traffic into the VPN tunnel regardless of which network is underneath. The risk is the moment the tunnel is down — for example if the app restarts, the system briefly tears down the VPN, or you’re reconnecting. Without a setting that blocks traffic while the VPN is down, apps can send data straight over mobile data in that window. Usually that data is still encrypted by HTTPS, so the content stays private, but the carrier and the sites involved can see your real IP address for those connections.

There are also known platform limits:

  • Android can block all traffic outside the VPN (see below), but researchers have shown it still sends some system traffic, such as connectivity checks, outside the tunnel. Mullvad reported in 2022 that Android “sends connectivity checks outside the VPN tunnel,” “even when the Block connections without VPN setting is enabled.”
  • iPhone has historically allowed some connections that were open before a VPN started to continue outside it. Proton VPN disclosed in 2020 that iOS “does not close existing connections” when a VPN connects, and that some “can remain open for minutes to hours outside the VPN tunnel.” Apple also deliberately keeps some system traffic — such as Wi-Fi sign-in pages and certain cellular services — outside a fully enforced tunnel.

None of this means a VPN is pointless on a phone. It means “always protected, no exceptions” is not a promise any mobile VPN can honestly make, and the settings below narrow the gaps rather than eliminate them.

Android: keep the VPN on across network changes

Android has two system settings designed for exactly this situation:

  • Always-on VPN tells Android to start your VPN automatically and keep it running. The Android developer documentation says it “can start a VPN service when the device boots and keep it running while the device is on.”
  • Block connections without VPN stops apps from using the network whenever the VPN isn’t connected: “The system blocks any network traffic that doesn’t use the VPN.” This is Android’s built-in kill switch.

To turn them on (wording varies by manufacturer and Android version):

  1. Open Settings and search for VPN. On many phones it’s under Network & internet → VPN or Connections → More connection settings → VPN.
  2. Tap the gear icon next to your VPN app.
  3. Turn on Always-on VPN, then Block connections without VPN if you want the strictest behavior.

Know the trade-offs before enabling the block. When the VPN can’t connect, you’ll have no internet at all — Android shows a persistent notification that stays “until you reconnect”. You also won’t be able to reach a public Wi-Fi sign-in page until you turn it off temporarily. And always-on can only be active for one VPN app, so make sure it’s set for the one you use.

Also worth checking on Android:

  • Battery: set the VPN app’s battery usage to Unrestricted (Settings → Apps → your VPN → Battery). On Samsung, Xiaomi, OnePlus and others, also remove it from any “sleeping” or restricted-app lists. Don’t kill my app! has instructions by brand.
  • Automatic switching to mobile data: many phones switch to mobile data when Wi-Fi is weak (names include “Switch to mobile data”, “Adaptive Wi-Fi” or “Auto-switch to mobile network”). Leaving it on helps you avoid getting stuck on dead Wi-Fi; turning it off makes switches less frequent. Either is fine — just know it exists.
  • Private DNS: if you use a custom Private DNS hostname and the VPN stalls after switching, try Automatic as a test.

iPhone: what you can and can’t control

iOS manages VPN connections at the system level, and VPN apps decide much of the behavior themselves. That means fewer switches for you to flip, and the options differ from app to app.

  • Connect On Demand. iOS lets VPN apps define rules for when the VPN should connect automatically — for example, whenever any network is available. If your VPN app has an “auto-connect” or “connect on demand” option, turning it on helps the VPN come back by itself after a network change.
  • Kill switch behavior. iOS doesn’t have a system-wide “block connections without VPN” toggle for personal VPN apps. Some apps can ask iOS to send all traffic through the tunnel; Apple’s developer documentation notes that, even then, the system keeps certain traffic outside it, such as network control traffic, Wi-Fi sign-in pages and some cellular services like VoLTE. Apple’s “Always On VPN” is mainly for phones managed by an organization.
  • Connectivity Assist (formerly Wi-Fi Assist). This uses mobile data automatically when Wi-Fi is poor. Apple notes that “with Connectivity Assist turned on, you might use more cellular data.” It helps you avoid being stuck on bad Wi-Fi, but it means more frequent network changes. Search Settings for “Connectivity Assist” or “Wi-Fi Assist”, depending on your iOS version.
  • Close sensitive sessions first. Because some connections opened before the VPN started may continue outside it, connect the VPN before opening apps you particularly want covered. Toggling Airplane mode on and off after connecting is a simple way to force apps to reconnect through the tunnel.

What you might notice in everyday use

  • Video and voice calls may freeze for a second or two and recover. Calls through the VPN depend on the tunnel moving quickly; calls in apps that handle network changes well usually pick up again on their own.
  • Downloads and streams may pause and resume, or restart if the app doesn’t support resuming.
  • Websites and apps rarely log you out during a switch, because with a VPN your public address stays the VPN server’s address. Without a VPN, your public IP changes each time you switch networks, and some security-sensitive services may ask you to sign in again.
  • Your location may change without a VPN, because mobile data is often geolocated to a different city than your home broadband.

That last pair is an underrated benefit of a VPN on a phone: a consistent public address across networks. With the VPN on, sites keep seeing the same server address whether you’re on home Wi-Fi, a café network or mobile data.

How to test it on your own phone

  1. Connect the VPN on Wi-Fi and open VVPN’s IP checker. Note the address and location.
  2. Turn Wi-Fi off (or walk out of range) so the phone moves to mobile data. Watch the VPN status.
  3. Reload the IP checker. If the VPN followed you, the address should still be the VPN server’s — not your carrier’s.
  4. Repeat in the other direction, mobile data to Wi-Fi.
  5. If the page doesn’t load, or shows your carrier’s address, reconnect the VPN, then review the settings above.

Run the test a few times. A single smooth switch doesn’t prove every switch will be, and one stall doesn’t mean something is broken. For what an IP check can and can’t prove, see how to check whether your VPN changed your IP address.

Frequently asked questions

Does a VPN work on mobile data?

Yes. A VPN works over any internet connection, including 4G and 5G. It uses some extra data for encryption overhead, and most phones keep the same VPN session when moving between Wi-Fi and mobile data.

Why does my VPN disconnect when I leave Wi-Fi?

The network underneath changed. Most of the time the VPN recovers on its own. If it doesn’t, the usual causes are battery restrictions suspending the app, a mobile network blocking VPN traffic, or a session stuck on a Wi-Fi network that no longer works. Reconnecting fixes most cases.

Do I need to reconnect my VPN every time I switch networks?

Not normally. Protocols such as WireGuard and IKEv2 with MOBIKE are designed to carry on across network changes. If you find yourself reconnecting every time, check battery settings and turn on always-on or auto-connect options.

Is a VPN on mobile data less private than on Wi-Fi?

Neither is automatically safer. On Wi-Fi, the network owner and its provider could see your traffic’s destinations without a VPN; on mobile data, your carrier can. A VPN moves that visibility to the VPN provider in both cases. See do you need a VPN on public Wi-Fi? for more.

Will the switch slow my VPN down?

The switch itself causes at most a brief pause. Afterwards, speed depends on the new network: mobile data and Wi-Fi can differ greatly. Our guide on whether a VPN slows down your internet explains how to measure it.

Try it with VVPN

VVPN is free to download for Android and iPhone, with no account registration needed to start, and uses the WireGuard protocol. Connect on Wi-Fi, walk out the door, and use the IP checker to see what happens on your own phone. If the connection doesn’t recover after a switch, email support@vvpn.pro with your phone model, OS version, app version and what you saw.

Sources