LW IT Solutions logo LW IT Solutions logo LW IT Solutions
« Blog Overview /IT & Networks / WAN Failover: What Happens to Open Connections...
Read this article in other languages:

WAN Failover: What Happens to Open Connections When the Line Switches

WAN Failover: What Happens to Open Connections When the Line SwitchesWAN Failover: What Happens to Open Connections When the Line Switches

Management Summary

Internet failover switches a home or business network to a backup connection when the main line stops working. It restores a route to the internet, but existing calls, downloads or other ongoing tasks may break when the public address changes. This explains why a fast router switch can still leave work interrupted. Recovery also depends on whether each application can reconnect or resume. A backup line improves availability, but does not by itself guarantee that every activity continues without a pause.

Contents
  1. Why an address change interrupts ordinary TCP
  2. Detection, route switching and application recovery
  3. What may continue
  4. Recovery without an unnecessary second interruption
  5. A meaningful failover test
  6. Questions and answers
  7. Sources

WAN failover switches to another internet connection after a fault. A usable route does not automatically preserve open connections. The externally visible addresses, router state, transport protocol and application recovery determine the outcome.

The typical case considered here is two independent uplinks with different public IPv4 addresses and NAT. NAT translates local addresses into the public address used on the internet. The router stores which internal connection belongs to each external address and port mapping. A design retaining a stable external address or using a suitable tunnel has different conditions. A claim that every session ends at the switch would therefore be incorrect.

Route, connection and application recovery are separate stages. Detection time follows an explicitly stated example model.
Detection model: I = 5 s, T = 1 s, N = 3. Route switching and application recovery add separate delays.

Why an address change interrupts ordinary TCP

An ordinary TCP connection is identified by source and destination addresses and ports. If traffic is translated to a different public source address after failover, the server cannot treat that traffic as the original connection. A new route alone does not transfer TCP state to a new address.

The failure need not become visible at the exact switching instant. NAT state may initially remain pinned to WAN1; applications may wait for retransmissions or abort earlier through separate deadlines. If the original path returns in time with its state intact, a connection can resume. A normal switch to a different source address generally requires a new SSH or database connection.

Detection, route switching and application recovery

No formula based only on an interval and a failure count covers every router. A simple model can nevertheless be derived explicitly: probes start every I, each failed probe completes after T, and exactly N consecutive failures trigger the decision. Here T < I, and the last probe before the outage succeeded. d is the delay until the first probe starts after the outage; D is the detection time.

Text
I = 5 s, T = 1 s, N = 3
0 <= d < I
D = d + (N - 1) * I + T

11 s <= D < 16 s
mean D = 13.5 s  (uniform d)

The average assumes that an outage is equally likely at any point between two probe starts. The calculation excludes the subsequent routing change and application recovery. A different definition of tolerated failures, packet-loss evaluation over a continuously moving time window, delayed evaluation or probes scheduled after previous completion changes the model. For example, pfSense also documents loss thresholds, evaluation periods and alert intervals.

What may continue

TrafficUnder a typical NAT address change
SSH or a database over TCPThe existing connection normally cannot migrate; a new connection and possibly application recovery are needed.
HTTP/1.1 or HTTP/2 downloadThe TCP connection is affected. Range support and verification of the same file version may allow resumption if the application implements that behaviour.
HTTP/3 over QUICA path change is possible, depending on implementation, connection state, path validation and time limits.
Voice and video callsMedia may pause. Whether the call ends or finds another media path depends on signalling and mechanisms such as ICE.
DNSA UDP query can be lost and retried. DNS also uses TCP and other connection-oriented transports; universal survival is not guaranteed.
VPNInner connections can survive under suitable conditions; automatic tunnel reconnection alone does not guarantee this.

QUIC can associate packets with a connection through connection IDs. The new route must still work and undergo validation. Active migration requires a confirmed handshake and can be restricted; a NAT-induced address change needs separate consideration. HTTP/3 alone does not guarantee uninterrupted application behaviour.

A VPN must retain inner addresses and relevant state. Internet traffic through a remote VPN exit also needs a stable external mapping there. WireGuard supports roaming, while IKEv2 can use MOBIKE. If an interruption exceeds an inner application’s deadline, a stable address alone cannot preserve the application session.

Recovery without an unnecessary second interruption

Returning to WAN1 does not have to move existing connections off WAN2 immediately. A router can prefer WAN1 for new connections while existing WAN2 states expire naturally. Forced rerouting or state deletion can instead cause another interruption. The actual behaviour depends on configuration.

A recovery delay and separate failure/recovery criteria limit repeated switching. A fixed timer ratio is not a universal solution. Link stability, application requirements and state handling determine the appropriate policy.

A meaningful failover test

Monitoring traffic must demonstrably use the uplink being monitored. A responding modem does not prove internet reachability, and an unavailable monitoring target does not prove an uplink failure. Multiple suitable signals or targets can improve the decision where supported. pfSense specifies a different monitor IP for each gateway.

A planned test records the outage, gateway decision, successful new connection and recovery of ongoing applications separately. Recovery to the primary link, incoming calls and the actual protocols in use also belong in the test. Resumable downloads and backups reduce the consequences without promising survival for every session.

Questions and answers

Why can an IP phone remain unreachable after failover?

A registration or established SIP flow may still refer to the old uplink. NAT or firewall state can also pin traffic to WAN1. SIP providers differ in registration handling, flow usage, keep-alives and re-registration. A shorter registration interval therefore does not solve every case.

Selective deletion of affected states can help. Flushing the entire state table can also interrupt working connections. A false monitoring alarm does not make this action harmless. Changes belong in a tested configuration for the particular router and telephone service.

Does a shorter probe interval speed up switching?

It reduces the detection component in the stated model. With I=1 s, T=0.2 s and N=3, this component ranges from 2.2 to just under 3.2 seconds. Other monitoring models may behave differently. Over-sensitive thresholds can trigger unnecessary switches under load or after isolated probe losses.

Does using both uplinks simultaneously help?

Connection-based load balancing distributes new connections across multiple paths. When one uplink fails, connections on the other path may continue if state handling causes no additional interruption. This differs from bonding that carries individual connections across multiple paths.

IP-bound logins can encounter problems when outgoing addresses change. In pfSense, sticky connections associate a source host with the same gateway while the association remains valid. Other products may group traffic differently. This limits distribution for a single device and does not migrate open connections.

Lukas Wojcik

Lukas Wojcik

Systems architect and technology enthusiast specializing in scalable tracking solutions, GMP Stack (GA4 & GTM), and robust backend architectures. Advocate for clean code and privacy-first design.

Get in touch

A question or an idea for a web project? Tell me a little about it. This form uses reCAPTCHA and formconfirmed to protect against spam.

Write a comment

Experience with other hardware or firmware and questions about the configuration are welcome here.

The email address is not published. Required fields are marked with an asterisk.

LUKASWOJCIK.COM · NEWSLETTER

Fresh ideas in your inbox

New articles, practical tools and updates from the projects.

Choose topics (optional)
No selection: all topics.

Subscription starts after confirmation by email. · Privacy

Privacy · Newsletter

Email address, language, selected topics and subscription/confirmation dates are stored to deliver the newsletter. Double opt-in is required. Every issue includes an immediate unsubscribe link. Formconfirmed checks the signup for spam. No email open or click tracking.

Read the full privacy policy ↗