TTR Networks

Intermediate · Two internet connections on Debian · section 7 of 8

Troubleshooting

✓ Lab-tested 21 October 2026 on Debian 13.7, iproute2 6.15.0, nftables 1.1.3, systemd 257

Strict reverse-path filtering

rp_filter makes the kernel check, for each incoming packet, that the route back to its source leaves through the interface it arrived on. In strict mode (1), a common hardening setting, that breaks a dual-ISP router: a packet from the internet arriving on ISP 2 fails the check, because the main table's route back to it goes via ISP 1.

The lab shows how subtle it is. With strict mode on, pings to the router's ISP 2 address still work (for a packet to the router itself, the reverse check uses the router's address as the source, and the source rule routes that via ISP 2), but the port forward through ISP 2 fails. Use loose mode (2), which only checks that the source is reachable through some interface, or set net.ipv4.conf.all.src_valid_mark = 1 so the check takes marks into account.

Common problems

SymptomLikely causeCheck
Inbound to ISP 2's address doesn't workReplies leave via ISP 1 and are dropped by its source filterip route get <client> from 203.0.113.2; the from rules
Router's ISP 2 address works, port forwards through ISP 2 don'tMissing connection marks, or rp_filter strictconntrack -L (mark=2?); sysctl net.ipv4.conf.all.rp_filter
Office can't reach its own LAN or the ISP links after adding rulesA rule sends local traffic to an ISP tableThe suppress_prefixlength 0 rule must come first
No failover although the internet is unreachableThe check only tests the link or the ISP's routerProbe targets beyond the ISP, from each ISP's address
Failover happens, but connections hang for minutesOld conntrack entries still NATed to the dead ISPconntrack -D --reply-dst <old address> on switch
Flapping between ISPsThresholds too low, or a single flaky targetMore checks before switching back; several targets
Everything breaks after a rebootRules, tables or timer not persistentsystemctl is-enabled dualwan-routes dualwan-check.timer nftables

Using both at once

This lesson uses ISP 2 only as a backup. Linux can also spread new connections across both, with a multipath default route (ip route replace default nexthop via 198.51.100.1 dev eth0 nexthop via 203.0.113.1 dev eth1). By default the kernel picks the ISP per pair of source and destination addresses, so a given site always sees one address, but the health check has to remove a failed ISP's next hop, and some websites object to one user's connections arriving from two addresses. Failover alone is simpler, and what most offices need.

Strict reverse-path filtering (real output)
root@gw:~# sysctl -w net.ipv4.conf.all.rp_filter=1
net.ipv4.conf.all.rp_filter = 1

root@web:~# ping -c 2 -W 1 203.0.113.2 | tail -2; curl -s -o /dev/null -w "%{http_code}\n" -m 3 http://203.0.113.2:8080/
2 packets transmitted, 2 received, 0% packet loss, time 1028ms
rtt min/avg/max/mdev = 0.066/0.071/0.076/0.005 ms
000

root@gw:~# sysctl -w net.ipv4.conf.all.rp_filter=2
net.ipv4.conf.all.rp_filter = 2

root@web:~# ping -c 2 -W 1 203.0.113.2 | tail -2; curl -s -o /dev/null -w "%{http_code}\n" -m 3 http://203.0.113.2:8080/
2 packets transmitted, 2 received, 0% packet loss, time 1014ms
rtt min/avg/max/mdev = 0.077/0.078/0.080/0.001 ms
200
  • Lines 1–2: Strict mode.
  • Lines 4–7: The router itself still answers on ISP 2, but the port forward through ISP 2 fails.
  • Lines 9–15: Loose mode: both work.