summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/etc/inc/interfaces.inc3
-rwxr-xr-xsrc/usr/local/sbin/ppp-linkdown8
2 files changed, 9 insertions, 2 deletions
diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc
index af0d11f..5d4d775 100644
--- a/src/etc/inc/interfaces.inc
+++ b/src/etc/inc/interfaces.inc
@@ -1766,6 +1766,8 @@ EOD;
}
}
+/* Omit this, we maintain the default route by other means, and it causes problems with
+ * default gateway switching. See redmine #1837
if (($interface == "wan" && $founddefaultgw == false) || $setdefaultgw == true) {
$setdefaultgw = true;
$mpdconf .= <<<EOD
@@ -1773,6 +1775,7 @@ EOD;
EOD;
}
+*/
$mpdconf .= <<<EOD
set iface {$ondemand} on-demand
set iface idle {$ppp['idletimeout']}
diff --git a/src/usr/local/sbin/ppp-linkdown b/src/usr/local/sbin/ppp-linkdown
index 6fca066..3faf5f1 100755
--- a/src/usr/local/sbin/ppp-linkdown
+++ b/src/usr/local/sbin/ppp-linkdown
@@ -13,9 +13,13 @@ fi
if [ "${PROTOCOL}" == "inet" && -s "/tmp/${IF}_defaultgw" ]; then
GW=`head -n 1 /tmp/${IF}_defaultgw`
- [ -n "${GW}" ] \
- && /sbin/route -q delete default ${GW}
+ DGW=`/sbin/route -n get -inet default | /usr/bin/awk '/gateway:/ {print $2}'`
+ # Only remove the default gateway if it matches the gateway for this interface. See redmine #1837
+ if [ "${GW}" = "${DGW}" ]; then
+ /sbin/route -q delete default ${GW}
+ fi
fi
+
if [ "${PROTOCOL}" == "inet6" ]; then
/usr/local/sbin/ppp-ipv6 ${IF} down
fi
OpenPOWER on IntegriCloud