Project

General

Profile

Actions

Todo #16816

open

Improve default gateway detection when gateways share the same address

Added by Marcos M about 4 hours ago. Updated about 4 hours ago.

Status:
Feedback
Priority:
Normal
Assignee:
Category:
Gateways
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Plus Target Version:
26.07
Release Notes:
Default

Description

In some scenarios it's possible for multiple gateways to share the same gateway IP address. For example a dynamic (DHCP) gateway can pick up the same address as an existing static gateway. It can also happen with PPPoE multi-WAN configurations from the same ISP. The default gateway detection doesn't take these scenarios into account leads to multiple gateways (of the same IP address family) being considered the default gateway; in turn this results in undefined behavior. This can be seen with dpinger monitoring an unused dynamic gateway instead of the configured default static gateway. Update the default gateway detection to ensure a single default gateway per IP address family.

Use the following priority order when multiple default gateways exist that share the same IP address:
  1. Gateway specified in System > Routing > Gateways > Default gateway.
  2. First gateway group member with the highest priority tier for the default gateway group.
  3. First configured gateway.

Files

Actions #1

Updated by Marcos M about 4 hours ago

  • Tracker changed from Bug to Todo
  • Assignee set to Marcos M
  • Target version set to 2.9.0
  • Plus Target Version set to 26.07
A quick way to introduce this scenario for testing:
  1. Enable the interface OPT1 with no IP address.
  2. Create a gateway for OPT1 named "OPT1_DHCP" with dynamic as the gateway IP address.
  3. Create a gateway for OPT1 named "OPT1_STATIC" with a static IP address for the gateway.
  4. Configure OPT1 as a DHCP WAN, save/apply.
  5. Switch OPT1 to a static WAN using OPT1_STATIC for its gateway, save/apply.
  6. Set "OPT1_STATIC" as the default gateway.
Actions #3

Updated by Marcos M about 4 hours ago

Applied with 8a360777517314edc9d5e6c296b537f756c2dae8.

Another example of this issue is with DDNS. Since the wrong gateway is monitored, DDNS does not update:

Example after patch, reboot, and DDNS update:


Actions

Also available in: Atom PDF