Feature #12931
closedRetain knowledge of previous dynamic gateway IP address when interface is down
0%
Description
Our current methods for determining a gateway IP address only work while an interface with a dynamic address is up (e.g. DHCP, PPPoE, etc). There are cases in which we need to know what the previous gateway was before it was removed from the interface/routing table/etc. This already works properly for static IP address interfaces as the gateway address is present in the configuration, but that isn't possible for dynamic WANs.
One example of this need is to kill states for the previous gateway (See #12092) when an interface is down. It could also be useful for gateway monitoring status output.
With dynamic interfaces the gateway address is stored in temporary files (e.g. /tmp/<interface name>_router
). This could be as simple as moving that file to /tmp/<interface name>_router.last
instead of deleting it, and adding functions to read that when needed. We might need to be careful that the information isn't too stale. It's unlikely to be that simple in practice, given the different types of dynamic interfaces, but it's a starting point.
Nice to have, but can be pushed to a future release as needed.
Related issues
Updated by Jim Pingle over 2 years ago
- Related to Feature #12092: Utilize new ``pfctl`` abilities to kill states added
Updated by Jim Pingle over 2 years ago
- Status changed from New to In Progress
- Assignee set to Jim Pingle
Updated by Jim Pingle over 2 years ago
- Status changed from In Progress to Pull Request Review
Updated by Jim Pingle over 2 years ago
- Blocks Bug #12942: Code to kill states for old gateway when reconnecting an interface is incorrect added
Updated by Jim Pingle over 2 years ago
- Status changed from Pull Request Review to Feedback
Changes merged.
Updated by Alhusein Zawi over 2 years ago
- Status changed from Feedback to Resolved
/tmp/em2_router.last was created after disabling the interface (proxmox) and it contains previous dynamic gateway IP.
steps:
created WAN2 interface.
selected "IPv4 Configuration Type" = DHCP.
GW was added automatically.
disabled em2 interface from pfsense GUI.
/tmp/em2_router.last is created.
2.7.0.a.20220426.0600