Project

General

Profile

Actions

Bug #16861

open

Static route not removed when enabling ``dpinger_dont_add_static_route`` while a gateway monitor IP address is set

Added by → luckman212 23 days ago. Updated 5 days 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
Affected Version:
Affected Architecture:

Description

I found this out the hard way today after a puzzling bit of DNS trouble when an LTE gateway with a monitor IP of 8.8.8.8 was powered off, resulting in all traffic to 8.8.8.8 blackholing since the GW had a static route bound to it.

I thought the fix would be to check the dpinger_dont_add_static_route checkbox for the gateway, but that seemed not to actually remove the route.

Digging in, I saw the problem in gwlb.inc (call to route_del() only fires if the monitor IP actually changes). Came up with this patch, which I tested successfully on my 6100 running 26.03.1:
https://gist.github.com/luckman212/11c0a4d6ae81f2613690294b5ff23ff0

It can be tested via System Patches using this URL
https://gist.githubusercontent.com/luckman212/11c0a4d6ae81f2613690294b5ff23ff0/raw/a8e5e3ad492223fe6a71fbc8e384a74add3b6ea0/gwlb.inc.patch

It also accounts for the case when the global option is changed from System → Advanced → Miscellaneous

Actions #1

Updated by → luckman212 23 days ago

I forgot to submit the Pull Request, I'll do that tomorrow. By the way, the diff had some whitespace changes (spaces to tabs) to make the indentation consistent. That's why it appears that the first changed block doesn't actually change anything.

Actions #2

Updated by → luckman212 22 days ago

PR: https://github.com/pfsense/pfsense/pull/4754

I had to base it off the CE codebase since I don't have access to Plus, but the patch should apply to either.

Actions #3

Updated by Marcos M 22 days ago

  • Status changed from New to Ready To Test
  • Assignee set to Marcos M

The following should address the issue: Show

Actions #4

Updated by Marcos M 21 days ago

  • Project changed from pfSense Plus to pfSense
  • Category changed from Gateways to Gateways
  • Status changed from Ready To Test to Feedback
  • Target version set to 2.9.0
  • % Done changed from 0 to 100
  • Affected Plus Version deleted (26.03.1)
  • Plus Target Version set to 26.07
Actions #5

Updated by Alhusein Zawi 20 days ago

The static route for the monitor gateway is removed when the option is enabled from the Edit Gateway page.
However, it is not removed when the same option is enabled from System → Advanced → Miscellaneous.

26.07-DEVELOPMENT (amd64)
built on Wed Jun 3 16:15:00 UTC 2026
FreeBSD 16.0-CURRENT

Actions #6

Updated by → luckman212 20 days ago

Alhusein: I know, see marcos comment here: https://github.com/pfsense/pfsense/pull/4754#issuecomment-4594641028

That portion of the patch was removed, because he flagged it for some edge cases

Actions #7

Updated by Jim Pingle 5 days ago

  • Subject changed from If a a gateway monitor IP is set, and then later the "dpinger_dont_add_static_route" option is enabled, the static route is NOT removed to Static route not removed when enabling ``dpinger_dont_add_static_route`` while a gateway monitor IP address is set
Actions

Also available in: Atom PDF