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