diff --git a/napalm_linux/linux.py b/napalm_linux/linux.py index 8e8c95f..8f590f0 100644 --- a/napalm_linux/linux.py +++ b/napalm_linux/linux.py @@ -693,8 +693,17 @@ class LinuxDriver(OSDriver): def get_config( self, retrieve: str = "all", full: bool = False, sanitized: bool = False ) -> dict[str, Any]: - """Return minimal config representation (network interfaces only).""" + """Return minimal config representation (network interfaces only). + + ``valid_lft`` / ``preferred_lft`` fields from DHCP leases are stripped + so the output is stable across polls and does not produce false-positive + config-change events in the config-backup feature. + """ + import re + running = self._send("ip addr show && ip route show") + # Strip volatile DHCP lease timer fields — they decrement every poll + running = re.sub(r"\s+valid_lft\s+\S+\s+preferred_lft\s+\S+", "", running) return {"running": running, "startup": "", "candidate": ""} # ------------------------------------------------------------------