From 5da28d873cfbf41c56c3e6cb04154022456b5e32 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Sat, 7 Nov 2026 22:14:15 +0100 Subject: wwan: T9388: drop a stale DHCP router once a static bearer applies An interface with "address dhcp" contributes a DHCP default route next to the one of its static bearer. The DHCP one is built from the router of the last lease event, which is only cleared by a STOP event. A client which ended up failed never sends one, so a router from an earlier lease added a second default route towards a stale gateway. The record of the last lease event is now removed when a static bearer takes over IPv4. --- python/vyos/ifconfig/wwan.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'python') diff --git a/python/vyos/ifconfig/wwan.py b/python/vyos/ifconfig/wwan.py index 8dd10b60d..c43f05c37 100644 --- a/python/vyos/ifconfig/wwan.py +++ b/python/vyos/ifconfig/wwan.py @@ -13,8 +13,11 @@ # You should have received a copy of the GNU Lesser General Public # License along with this library. If not, see . +import os + from json import loads +from vyos.defaults import directories from vyos.ifconfig.interface import Interface from vyos.utils.dict import dict_search from vyos.utils.misc import wait_for @@ -292,6 +295,12 @@ class WWANIf(Interface): pass if family == 'ipv4': self.set_dhcp(False) + # A client which ended without a STOP event leaves the router of + # its last lease behind, and FRR would install a second default + # route towards it + lease = directories['isc_dhclient_dir'] + f'/dhclient_{self.ifname}.lease' + if os.path.exists(lease): + os.remove(lease) else: self.set_dhcpv6(False) -- cgit v1.2.3