Marcio Cunha

How to configure internet link redundancy and load balancing

Learn how to implement automatic failover and PCC load balancing on routers to ensure high availability for your business.

Marcio Cunha•5 min
Also available in:PortuguêsEspañol
Summary
  • Internet redundancy prevents operational downtime by utilizing multiple simultaneous ISP links.
  • Automatic failover instantly reroutes traffic when the primary connection fails.
  • PCC load balancing intelligently splits data flow across different telecom providers.
  • Proper static routing configuration and gateway monitoring prevent packet loss.
  • Stress testing and route validation guarantee the real resilience of corporate infrastructure.

Why your business needs internet link redundancy

Keeping a business connected to the internet has shifted from a luxury to a fundamental operational requirement. In practice, this means that any data link failure halts cash registers, disrupts client calls, and blocks cloud application access. To avoid this operational nightmare, network engineering relies on redundancy, which involves contracting at least two different internet service providers. Thus, if the primary operator fails due to a fiber cut or power outage, corporate operations continue running without noticing the disruption.

However, simply plugging two cables into a router does not solve the problem by magic. The equipment must be configured to manage this traffic intelligently. While many companies leave the second link idling for an emergency, experienced administrators optimize cost-efficiency by combining failover and balancing. To ensure your physical power and hardware infrastructure supports this continuous operation, it is wise to understand how to calculate UPS sizing for modern servers before putting routers into production.

Understanding the difference between failover and load balancing

When discussing multiple links, two main strategies serve very different purposes in network architecture. Pure failover acts like a car spare tire: the secondary link stays idle and only assumes traffic control when the router detects the primary link has stopped responding. It is a secure and simple approach, ideal for businesses prioritizing operational continuity above all, though it does not aggregate bandwidth for daily tasks.

On the other hand, load balancing actively distributes data packets across all available connections simultaneously. In practice, this means half of your staff can browse via ISP A while the other half uses ISP B, combining the bandwidth capacity of both paths. In modern corporate environments, the real trick is uniting both worlds: creating active load balancing that distributes traffic during peacetime, but with failover mechanisms to reroute automatically if one path degrades severely.

How PCC load balancing works in practice

Among the traffic splitting methods available in modern corporate routers, PCC (Per Connection Classifier) stands out for its surgical precision. In practice, PCC takes data flows arriving at the router and splits these packets based on mathematical criteria involving source IP addresses, destination IPs, and communication ports. Unlike simpler algorithms that blindly alternate connections, PCC ensures a user maintains the same link throughout their entire session, preventing issues with banking websites or systems that drop authentication if the public IP changes midway.

To configure PCC on RouterOS-based routers, for instance, the administrator creates routing mark rules that label incoming traffic and proportionally direct packets to the corresponding routing tables for each link. If you have a 300 Mbps link and a 100 Mbps link, the algorithm can be tuned to route three parts of traffic to the faster connection and one part to the smaller connection. This mathematical proportion ensures neither circuit becomes congested while the other sits idle, optimizing financial investments in telecom monthly fees.

Implementing automatic failover with gateway monitoring

Configuring load balancing is great for daily performance, but it is useless if the router keeps sending packets to an ISP with a severed fiber line while its physical port remains lit. To solve this, we implement gateway monitoring via active checks, popularly known as tracking pings or recursive routing. The router periodically dispatches test packets to reliable external IP addresses, such as Google or Cloudflare DNS servers, strictly forcing them out through each internet link.

If the router notices packets sent through the primary link stop receiving replies after consecutive attempts, it interprets this as a total end-to-end connectivity drop and temporarily deactivates that route. Automatically, all traffic shifts to the secondary link without human intervention. When the primary link recovers and responds to monitoring tests, the router performs a controlled traffic return. If you need to investigate deeper connectivity issues during this transition, packet diagnostic tools explained in how to debug Docker container network failures with tcpdump help isolate transport layer bottlenecks.

Step-by-step to configure routes and marks on the router

To bring this high availability architecture into practical operation on your edge equipment, follow this logical command sequence adapted for standard corporate environments:

  1. Identify and properly name the network interfaces connected to the ISP modems, typically named 'ether1-wan1' and 'ether2-wan2'.
  2. Configure the IP addresses provided by each operator or keep them as DHCP Client if receiving dynamic IPs directly on the WAN port.
  3. Create routing mark rules using the PCC classifier to split outbound traffic proportionally among available gateways.
  4. Add default static routes pointing to each operator gateway, associating them with their respective routing marks.
  5. Configure the link monitoring script (check-gateway or recursive ping) to automatically switch to the backup link if the primary fails.
# Conceptual example of PCC marking rules for two WAN links
/ip firewall mangle
add chain=prerouting in-interface=bridge-local connection-mark=no-mark dst-address-type=!local \
    per-connection-classifier=both-addresses-and-ports:2/0 action=mark-connection new-connection-mark=wan1_conn
add chain=prerouting in-interface=bridge-local connection-mark=no-mark dst-address-type=!local \
    per-connection-classifier=both-addresses-and-ports:2/1 action=mark-connection new-connection-mark=wan2_conn

# Directing marked traffic to their respective routing tables
/ip route
add dst-address=0.0.0.0/0 gateway=192.168.1.1 routing-mark=to_wan1 check-gateway=ping
add dst-address=0.0.0.0/0 gateway=192.168.2.1 routing-mark=to_wan2 check-gateway=ping

Best practices and high availability validation

After applying failover and balancing configurations, the engineering work still requires a crucial stress testing phase. Never consider the project complete without simulating real physical failures in the infrastructure. Physically disconnect the primary ISP cable and observe whether corporate traffic seamlessly migrates to the secondary link within seconds. Also monitor critical system behavior, such as video conferencing platforms and payment terminals, ensuring route switching occurs without dropping active sessions catastrophically.

Keeping network documentation updated and constantly monitoring latency and bandwidth consumption per ISP using observability tools helps predict future bottlenecks before they impact end users. Furthermore, establishing periodic maintenance routines and redundancy tests ensures that the day the primary internet unexpectedly drops, your business keeps running with total stability and zero unpleasant surprises.

Final considerations

Proper configuration of internet link redundancy and load balancing transforms fragile network infrastructure into a robust, highly available corporate environment. By combining automatic failover for emergencies with PCC load balancing to optimize daily bandwidth usage, you protect the business from financial losses caused by unexpected connection outages. Investing time in planning and practical testing of these rules is what separates amateur networks from resilient corporate operations.