KORTHVEILSecurity firewall
Guides

Failover internet through your switch

Download as PDF All guides

A failover pair shares one internet address. Most home connections give one public address, by DHCP, to one device. The two firewalls clone one MAC address on their internet port, and only the active firewall uses it (see Two firewalls with automatic failover). The ISP's fiber box or modem usually has a single port, so both internet cables need a switch between them and the box.

This guide sets that up on a managed switch. The internet gets a VLAN of its own, so it never mixes with your network, and the switch has no address on that side. The pictures show a RealHD PSW24-25G-MG with the example pair: fw-main (primary) and fw-lab (secondary), on a fiber line. Other managed switches have the same settings under similar names.

The wiring:

Switch port Goes to Label on the switch
2 The ISP's fiber box (ONT) or modem Fiber (failover WAN)
3 fw-main's internet port (enp1s0) fw-main internet (failover)
4 fw-lab's internet port (enp2s0) fw-lab internet (failover)
1 The switch's own management (unchanged)

Change the switch first and move the cables last. The internet is away only while the cables are out.

Step 1: A VLAN for the internet

VLAN › VLAN › Create VLAN:

  1. Select VLAN 100 under Available VLAN, press >, then Apply.
  2. Select VLAN 100 in the VLAN Table, then Edit. Name it FAILOVER-WAN, then Apply.

Its VLAN Interface State stays Disabled: the switch has no address in the internet VLAN, so its admin page can't be reached from the internet side.

VLAN 100, FAILOVER-WAN, with no switch address
VLAN 100, FAILOVER-WAN, with no switch address

Step 2: Ports 2, 3 and 4 in that VLAN only

VLAN › VLAN › Port Setting: tick ports 2, 3 and 4 and press Edit:

  • Mode: Access.
  • PVID: 100.

Then Apply. The table shows the three ports as Access, 100, Untag Only.

Ports 2-4: Access, PVID 100, untagged only
Ports 2-4: Access, PVID 100, untagged only

VLAN › VLAN › Membership checks it. Ports 2-4 show 100UP (VLAN 100, untagged, its PVID) and nothing else. They have left VLAN 1, where the rest of the switch lives. Port 1 still shows 1UP.

Ports 2-4 only in VLAN 100
Ports 2-4 only in VLAN 100

Step 3: Name the ports

Port › Port Setting: tick one port, press Edit, enter the Description and press Apply:

  • 2: "Fiber (failover WAN)";
  • 3: "fw-main internet (failover)";
  • 4: "fw-lab internet (failover)".

With the cables in, ports 2 and 3 are Up. In the picture, taken with 1.2.6, port 4 is Down while fw-lab is standby: 1.2.6 keeps the standby's internet port off. From 1.2.7 port 4 stays Up and the standby sends nothing on it (see What a failover does below).

The three ports named; 2 and 3 up, the standby's port 4 down
The three ports named; 2 and 3 up, the standby's port 4 down

Step 4: No power on those ports

POE Setting › POE Port Setting:

  1. Set Refresh Rate to None first. Otherwise the table refreshes and drops your selection.
  2. Tick ports 2, 3 and 4, press Edit, set PortEnable to Disable, then Apply.

The fiber box and the firewalls take no power from the switch.

PoE off on ports 2-4
PoE off on ports 2-4

Step 5: Spanning tree

Spanning Tree › Property: on this switch State is not enabled. So a port forwards as soon as its link comes up, and nothing needs changing.

If your switch runs spanning tree, set ports 2-4 as edge ports (PortFast). Otherwise a firewall's internet port can wait up to 30 seconds before it forwards anything.

Spanning tree off on this switch
Spanning tree off on this switch

Step 6: Save

Press Save (top right), then OK at "Save running configuration to startup configuration". Without it, the switch forgets these settings the next time it restarts.

Step 7: Move the cables

  1. Fiber box: into port 2.
  2. fw-main's internet cable: into port 3.
  3. fw-lab's internet cable: into port 4.

The active firewall keeps its internet address: it doesn't ask the ISP again. On this line, fw-main's link came up on port 3 and its DNS answered 2 seconds later. The VPN tunnels were back 2 to 6 seconds after the link. The only gap was the time the cables were out.

Check it

  • On the switch: Status › MAC Address Table shows, in VLAN 100, the ISP's devices on port 2 and the active firewall's internet MAC (the cloned one) on port 3. VLAN 1 shows none of them.
  • On the firewall: the dashboard shows the same internet address as before, and Network › High availability shows the same active and standby firewalls.

What a failover does (from Korthveil 1.2.7)

The standby keeps its internet port connected but silent:

  • its link stays up;
  • it has no address and sends nothing, so the switch never sees the shared MAC on its port.

Every 30 seconds it asks the active firewall for the current lease: the address, the gateway, and how long it runs.

When it takes over:

  1. It puts the same address in place at once.
  2. It announces the address, so the switch sends the ISP's traffic to its port.
  3. It confirms the lease with the ISP in the background.

Neither firewall ever gives the address back to the ISP when it steps down. The partner is about to use it.

Measured in the lab (an ISP that waits 25 seconds after a release, like the real line):

  • Power cut on the active firewall: the standby was active after 1.1 seconds and had the address at the same moment.
  • A device streaming through the pair: at most 1.2 seconds without replies.
  • The ISP: saw one renewal, and no new request.

Before 1.2.7 the standby asked the ISP from the start. On this fiber line that took 23 to 30 seconds (2026-11-12, three times out of three).

On the High availability page, Shared internet port shows how each firewall holds the port, and whether the standby has a copy of the lease to take over.

The active firewall holds the shared port
The active firewall holds the shared port
The standby: connected, silent, ready to take over
The standby: connected, silent, ready to take over

On the standby, the shared internet port is chooses between:

  • Connected but silent (recommended): it needs the switch, or a switch VLAN, in front of the ISP's box.
  • Off, link down: the 1.2.6 behaviour, for hardware that needs it.

Without a copy, for example when both firewalls start at the same time, the firewall taking over asks the ISP from the start, as before.

Troubleshooting

What you see Likely cause What to do
Port 2 is up, but the firewall gets no internet A port is still in VLAN 1, or not in VLAN 100 VLAN › Membership: ports 2-4 must show 100UP only
The switch's admin page doesn't open any more Port 1 (or the port your management uses) left VLAN 1 Connect to that port directly; set it back to Trunk or Access in VLAN 1
Port 4 is down fw-lab is standby: its internet port is off Normal. It comes up when fw-lab takes over
A firewall's internet port takes about 30 seconds to pass traffic after its link comes up Spanning tree on the switch Make ports 2-4 edge ports, or turn spanning tree off for them
The settings are gone after a power cut They were applied but not saved Step 6: Save › OK

Download as PDF All guides