Manual

Several uplinks: failover and load balancing

Adding a second line, and choosing between taking over and sharing the load.

As soon as you have more than one internet connection, the router has to be told what to do with them. Does the second line take over when the first one dies, or do both carry traffic at once? Those are two different configurations, and the configurator only asks once a second uplink is in the table.

Adding a second uplink

In the WAN / internet section, press Add uplink. The new row gets the next free port, type DHCP and route distance 2. Then set the type, and with PPPoE give it its own interface name, because two PPPoE clients cannot both be called pppoe-out1.

You can enter at most four uplinks. If you draw your network on the network board and connect more than four internet nodes to the same router, the site check tells you only the first four are set up as uplinks.

The choice: failover method

With more than one uplink a failover method field appears. There are three options.

Distance plus gateway check

The simple one. Each uplink gets a default route with its own distance: lowest wins. On an uplink with a static address the configurator writes that route itself, including check-gateway: when the gateway stops answering ping or arp, the route disappears and the next one takes over. With DHCP, PPPoE and LTE the client creates the route at the distance you gave, and then it is the connection dropping that removes the route.

This works well when an outage means the line itself is dead: the modem drops out, the cable is pulled, the PPPoE session breaks. It does not work when the connection stays up politely while nothing behind your provider works any more. The route then stays in place and you stay in the outage.

Recursive probing

The reliable one. You give two probe addresses, by default 1.1.1.1 for uplink 1 and 9.9.9.9 for uplink 2. The configurator writes two routes per uplink: one route to that probe address through the gateway of that uplink with scope=10, and a default route that goes via the probe with target-scope=11 and check-gateway=ping. That hangs the default route on something that only answers when there really is internet behind it, not just on the provider's gateway.

One limit you need to know about: the tool runs in your browser and cannot know which gateway address a DHCP uplink will be given. For a DHCP uplink the configurator therefore warns you and puts a placeholder in the route. You replace that with the real gateway address, which you can read off with /ip route print once the line is up. If you would rather not do that by hand, pick distance, or give the uplink a static address.

Pick probe addresses that are not also your DNS server and not your provider's. Two different addresses, one per uplink, so that a single unreachable service does not declare both lines dead at once.

PCC load balancing

Sharing instead of reserving. Per Connection Classifier splits new connections over both uplinks on source and destination address, and then keeps a connection on the same line. The configurator generates the shape from MikroTik's own manual: two routing tables to_wan1 and to_wan2, a default route per table, two ordinary default routes with distance 1 and 2 for the failover, and a block in /ip firewall mangle that marks connections and then routes them.

Three things to know:

  • PCC is generated for exactly two uplinks. With three or four the configurator says so, and the output is not right for the rest.
  • Fasttrack is switched off. Fasttracked traffic skips the mangle rules, so the marks would do nothing. The firewall leaves fasttrack out while PCC is active and puts a line in the script explaining why. On a small router that costs CPU: fasttrack is exactly what makes gigabit reachable. See The firewall.
  • Gateway placeholders. As with recursive: an uplink without a fixed gateway address gets a placeholder in the route that you fill in yourself.

And about expectations: PCC spreads connections, not a single download. One file comes down over one line and does not get faster. Many simultaneous connections do get spread. Some services dislike a changing source address; connections stay pinned to their line for that reason, but banking and video services can still complain.

Which one to pick

One line with an LTE backup
Distance. The LTE uplink gets distance 2 and only comes up when the first one is gone. See also Recipe: LTE as a backup line.
Two equal lines, an office that has to keep working
Recursive. It costs a few minutes of work on the gateway addresses and catches the outage that distance is blind to.
Two lines and you want the bandwidth of both
PCC, with the loss of fasttrack as the price.

What still needs checking

The configurator puts NAT on the WAN interface list, so a second uplink is covered there by itself. Port forwards, however, point at one uplink: after a failover to the backup line, incoming traffic does not arrive there automatically. See Port forwarding.

Once pasted you can check the result: /ip route print shows which default route is active and which one is on standby. Pull the cable from the first uplink and see whether the second takes over. Do that once on purpose, rather than during the first real outage.

Read on: WAN and internet, The firewall and Netwatch.

Want to try it right away? Open the configurator