{"article":{"id":360052548713,"url":"https://ubnt.zendesk.com/api/v2/help_center/en-us/articles/360052548713.json","html_url":"https://help.ui.com/hc/en-us/articles/360052548713-WAN-Failover-Load-Balancing-and-Port-Remapping-on-UniFi-Gateways","author_id":11576377939095,"comments_disabled":false,"draft":false,"promoted":false,"position":35,"vote_sum":275,"vote_count":2263,"upvote_count":1269,"downvote_count":994,"section_id":27826470313623,"created_at":"2020-08-03T07:23:24Z","updated_at":"2026-11-29T14:10:23Z","name":"WAN Failover, Load Balancing and Port Remapping on UniFi Gateways","title":"WAN Failover, Load Balancing and Port Remapping on UniFi Gateways","source_locale":"en-us","locale":"en-us","outdated":false,"outdated_locales":[],"edited_at":"2025-07-10T12:47:06Z","user_segment_id":null,"user_segment_ids":[],"permission_group_id":4235054,"content_tag_ids":[],"label_names":["security gateway","load balancing","unifi","usg","udm","dual wan","multiple wan","failover","bot"],"body":"<p>UniFi Gateways support Multi-WAN configurations to improve internet reliability and performance. You can connect up to <strong>eight WAN interfaces</strong>, limited only by the total number of physical ports on your device (with at least one reserved for LAN), and assign each to either <strong>Failover</strong> or <strong>Load Balancing</strong> mode.</p>\n<p>This article explains how these modes work, how WAN health is monitored, and how to set up port roles and backup connectivity—including LTE—for different use cases.</p>\n<h2 id=\"h_01JZQPF6CR18W7E17ZASJB2VY8\">WAN Modes</h2>\n<p>WAN interfaces in UniFi Network can be assigned to one of two operational modes:</p>\n<ul>\n<li>\n<strong>Failover</strong>, which prioritizes a single WAN and uses others only when needed.</li>\n<li>\n<strong>Load Balancing</strong>, which distributes new connections across multiple WANs based on configured weights.</li>\n</ul>\n<p>Both modes can be combined in flexible ways to match your network goals.</p>\n<h3 id=\"h_01JZST3N1SK4N4XYZZPN9JKZ6X\">WAN Failover</h3>\n<p>Failover mode is designed to prioritize one active WAN connection, while others remain on standby. If the primary WAN becomes unreachable, UniFi automatically reroutes traffic to the next highest-priority WAN. Once the primary WAN recovers, traffic returns to it.</p>\n<p>This is ideal for networks with a main ISP and one or more backup links used only during outages.</p>\n<h3 id=\"h_01JZST40YPMMS9HA744YAY7KM0\">WAN Load Balancing</h3>\n<p>Load balancing distributes new outbound connections across multiple WAN interfaces based on configurable traffic splits (e.g., 80% WAN1, 20% WAN2). This maximizes total available bandwidth and can reduce load on a single provider.</p>\n<p>Traffic distribution is handled using a <strong>connection-hashing algorithm</strong> that maps each session to a WAN based on its source and destination IP address. This ensures <strong>session stickiness</strong>—a given session stays on the same WAN until it ends, even if other WANs are available.</p>\n<p>In the event of a WAN failure, load balancing automatically shifts affected traffic to the remaining online WANs.</p>\n<h2 id=\"h_01JZST54C011ZPW8EFSJ7SE5WK\">Creating a Dedicated WAN for Specific Traffic</h2>\n<p>In addition to standard failover and load balancing, UniFi allows you to dedicate a specific WAN to selected traffic types—such as VoIP calls, guest WiFi, camera streams, or IoT devices—for performance, isolation, or cost control.</p>\n<p>To do this, ensure the WAN is not configured for active load balancing. Set its role to Failover (if using Failover Only mode) or Backup (if using Load Balancing mode). Then, use <a href=\"https://help.ui.com/hc/en-us/articles/12566175125783\" target=\"_blank\" rel=\"noopener noreferrer\">Policy-Based Routing</a> to create a rule that assigns the desired device(s) or VLAN as the Source and the dedicated WAN as the Interface.</p>\n<p><strong>Note</strong>: <em>To allow failover for this traffic if the WAN goes down, <strong>disable Kill Switch </strong>in the policy configuration.</em></p>\n<h2 id=\"h_01JZQPF6CS4TSG22FVNZTWC5E3\">WAN Monitoring &amp; Failover Conditions</h2>\n<p>To determine if a WAN is online, UniFi performs continuous health checks using three probes:</p>\n<ul>\n<li>Ping to <span style=\"color: #188038;\">ping.ui.com.</span>\n</li>\n<li>DNS resolution of <span style=\"color: #188038;\">ui.com</span> using Cloudflare (<span style=\"color: #188038;\">1.1.1.1</span>).</li>\n<li>DNS resolution of <span style=\"color: #188038;\">ui.com</span> using Google (<span style=\"color: #188038;\">8.8.8.8</span>).</li>\n</ul>\n<p>A WAN is marked <strong>down</strong> if <strong>any two out of three probes fail</strong>. This is the default “Auto” SLA and is sufficient for most networks.</p>\n<h3 id=\"h_01JZQPF6CSBAEPRS2VH9AN0JYD\">Custom SLAs &amp; Verification Servers</h3>\n<p>UniFi offers flexibility to define your own <strong>custom SLAs &amp; Failover criteria</strong>, instead of the “Auto” policy described above. To do so, navigate to <strong>Settings &gt; Internet &gt; Create New SLA</strong>, and then input your Verification Servers, and specify the Server Conditions–in other words, how many verification servers must fail before triggering a failover event. Each verification server can have the following parameters specified:</p>\n<ul>\n<li><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;\"><strong>Type:</strong> Use <strong>Ping</strong> or <strong>DNS</strong> when sending traffic to the verification server.<br></span></li>\n<li><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;\"><strong>Server Address:</strong> The IP Address or hostname of the verification server.<br></span></li>\n<li><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;\"><strong>Ping (Query) Interval:</strong> The number of seconds between ping (DNS) probes to the server.<br></span></li>\n<li><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;\">Time Period: The interval over which probes are averaged when evaluating SLA thresholds for failover.<br></span></li>\n<li>\n<span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;\"><strong>SLA Targets:</strong> The thresholds that will trigger a failover event. SLA targets are calculated based on the above <strong>Ping (Query) Interval</strong>, and the <strong>Time Period</strong> used in averaging the proves.<br></span>\n<ul>\n<li><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;\"><strong>Packet Loss Threshold:</strong> The percentage of packets sent to the verification server that are lost.<br></span></li>\n<li><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;\"><strong>Latency Threshold:</strong> The time it takes, in ms, for traffic to reach the verification server.<br></span></li>\n<li><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;\"><strong>Jitter Threshold:</strong> The variation in time it takes, in ms, to reach the verification server.<br></span></li>\n</ul>\n</li>\n<li><span style=\"font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;\"><strong>Threshold Condition:</strong> Specifies the above threshold(s) that correspond to an SLA not being met, and thus this specific verification server “failing”.ore granular behavior, such as detecting degraded performance before a full outage occurs.</span></li>\n</ul>\n<h2 id=\"h_01JZQPF6CSVM28Q730Q3D9VZD5\">Remapping WAN and LAN Ports</h2>\n<p>UniFi Gateways let you reassign which physical ports are used for WAN or LAN, allowing you to match your environment’s cabling or hardware preferences (e.g., RJ45 vs. SFP).</p>\n<p>To remap ports:</p>\n<ol>\n<li>Go to <em>Settings &gt; Internet</em>.</li>\n<li>Make sure the target port is already physically connected and active.</li>\n<li>Assign the new WAN role to that port.</li>\n<li>If swapping WAN1 and WAN2, temporarily assign a third port to avoid conflicts.</li>\n<li>Apply changes.</li>\n</ol>\n<p>If a WAN appears offline after remapping, double-check ISP settings such as VLAN tags, static IP, or PPPoE credentials.</p>\n<h2 id=\"h_01JZQPF6CS6RARVV8AQVZ7DSHQ\">Using UniFi LTE for Backup Internet</h2>\n<p>UniFi LTE devices can serve as backup WANs by connecting to a LAN port on your gateway. Because they don’t occupy a dedicated WAN port, they don’t count toward your gateway’s WAN limit, and can be placed where cellular signal is strongest.</p>\n<p>Learn how to set up <a href=\"https://help.ui.com/hc/en-us/articles/29887153953559-UniFi-LTE-Backup-Best-Practices\" target=\"_blank\" rel=\"noopener noreferrer\">UniFi LTE Backup</a></p>"}}