From f8f2a9cb8220750e31b479609832af450d5c6005 Mon Sep 17 00:00:00 2001 From: Ruledo Date: Tue, 18 Feb 2025 22:59:18 -0800 Subject: [PATCH] Fixed routes to update automatically When swapping eth0 and wlan0 different ways the default route wasn't updating. This fixes it. --- .../out/rootfs_uclibc_rv1106/etc/network/interfaces | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/network/interfaces b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/network/interfaces index 315112b..c375e0d 100644 --- a/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/network/interfaces +++ b/foxbuntu/sysdrv/out/rootfs_uclibc_rv1106/etc/network/interfaces @@ -1,4 +1,3 @@ -# interfaces(5) file used by ifup(8) and ifdown(8) # Include files from /etc/network/interfaces.d: source /etc/network/interfaces.d/* @@ -8,4 +7,13 @@ iface lo inet loopback allow-hotplug wlan0 iface wlan0 inet dhcp wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf + metric 100 + post-up sleep 5 && dhclient wlan0 + pre-down ip route del default via $(ip route | awk '/default/ {print $3}') dev wlan0 metric 100 + +allow-hotplug eth0 +iface eth0 inet dhcp + metric 10 + post-up ip route replace default via $(ip route | awk '/default/ {print $3}') dev eth0 metric 10 + pre-down ip route del default via $(ip route | awk '/default/ {print $3}') dev eth0 metric 10