Weft Start free trial

Blog · Guide · · 3 min read

Two internet lines, and not one dropped request

Give an office a second internet line and Weft runs a tunnel over each. We cut line 1 while a PC asked the other office for a page every two seconds: sixty requests, none failed.

A second internet line, a 4G router or a cheap broadband line next to the leased line, is the usual insurance against an outage. It only helps if the network actually uses it when the first line fails, and quickly enough that nobody notices. This guide adds a second line to Weft and then pulls the first one while a PC is busy.

As always, a real run. Each office's Weft box had two internet connections, and a PC at office A asked a server at office B for a page every two seconds, throughout.

Two internet lines at each office, and line 1 failing Office A's Weft box has line 1 on ens5 and line 2 on ens7; office B's box has the same. Each line carries its own WireGuard tunnel between the offices: wg0 over line 1 and wg1 over line 2. When office A's line 1 failed, wg0 went to 100 percent loss and was avoided, wg1 carried the traffic, and a PC at office A asking a server at office B every two seconds saw no failed request. OFFICE A office-a line 1: ens5 line 2: ens7 PC asks every 2 s OFFICE B office-b line 1: ens5 line 2: ens7 Server wg0 over line 1 DOWN · AVOIDED wg1 over line 2 · carrying the traffic Line 1 cut: 60 requests in the next two minutes, none failed
What this guide builds: a tunnel over each line, and what happened when office A's line 1 failed.

What you need

  • Offices set up as in the earlier guides.
  • A second internet connection on a second network port of the Weft box, at the office that should use one. The other offices need nothing extra: an office with one line takes the second tunnel on that line.
  • UDP 51821 reaching each box, on every line, as well as 51820. If a box is behind a router, forward both.

1. Tell Weft about the second line

Open the site, and under Uplinks choose the second port as WAN 2. If the box can be reached from outside on that line, enter its public address and port 51821 as the WAN 2 endpoint; behind a router that cannot forward, leave it empty.

Uplinks with WAN 1 port ens5, WAN 2 port ens7 and WAN 2 endpoint 16.61.204.194:51821
Line 1 on ens5, line 2 on ens7, and where the other office should dial line 2.

In our run we did the same at the other office, but it is not required: an office with one line answers the second tunnel on that line. Within a minute or two Paths shows two tunnels between them: wg0 over the first lines and wg1 over the second.

2. Pull line 1

We cut WireGuard off on office A's line 1 in both directions while the PC kept asking for its page. Every one of the sixty requests in the next two minutes was answered. Paths showed why:

Paths: wg0 between the offices down at 100% loss and avoided; wg1 up with 0% loss
Line 1's tunnel at 100% loss and avoided; line 2's carrying the traffic.

Weft measures every tunnel continuously and steers traffic away from one that is losing packets, so the move happens without waiting for anything to time out.

3. Put line 1 back

When line 1 came back, Weft did not jump straight back to it: a line that has just recovered is watched for a minute and a half or so before it is trusted again, so a line that is flapping does not drag traffic back and forth. The twenty-eight requests in that time were all answered too.

If something does not work

What you seeWhat it means
No wg1 in PathsNeither office has a second line set under Uplinks.
wg1 is listed but never comes upUDP 51821 is not reaching one of the boxes, or the WAN 2 endpoint is wrong.
wg1 goes down with line 1The second port has no address or gateway, so its tunnel has been leaving by line 1. Weft raises a warning that the line has no gateway.
Traffic stops when line 1 failsCheck Paths: if wg1 was already down, there was nothing to move to.

What you have now

An office that rides out a failed line without anyone noticing, and a Paths page that tells you it happened.