Blame 0075-The-default-gateway-might-need-a-static-route.patch

Harald Hoyer bb31e7
From 110858025aab221d135335d85dba9317f5ef15c6 Mon Sep 17 00:00:00 2001
Harald Hoyer bb31e7
From: Stijn Hoop <stijn@sandcat.nl>
Harald Hoyer bb31e7
Date: Sun, 23 Aug 2015 14:45:53 +0200
Harald Hoyer bb31e7
Subject: [PATCH] The default gateway might need a static route
Harald Hoyer bb31e7
Harald Hoyer bb31e7
Some hosting providers need a static route set in order to be
Harald Hoyer bb31e7
able to reach the default gateway. Be sure to retry adding
Harald Hoyer bb31e7
the default gateway after setting the static routes.
Harald Hoyer bb31e7
---
Harald Hoyer bb31e7
 modules.d/40network/net-lib.sh | 7 +++++++
Harald Hoyer bb31e7
 1 file changed, 7 insertions(+)
Harald Hoyer bb31e7
Harald Hoyer bb31e7
diff --git a/modules.d/40network/net-lib.sh b/modules.d/40network/net-lib.sh
Harald Hoyer bb31e7
index 5c65a2e..2e79619 100755
Harald Hoyer bb31e7
--- a/modules.d/40network/net-lib.sh
Harald Hoyer bb31e7
+++ b/modules.d/40network/net-lib.sh
Harald Hoyer bb31e7
@@ -129,6 +129,13 @@ setup_net() {
Harald Hoyer bb31e7
         fi
Harald Hoyer bb31e7
     done
Harald Hoyer bb31e7
 
Harald Hoyer bb31e7
+    # If a static route was necessary to reach the gateway, the
Harald Hoyer bb31e7
+    # first gateway setup call will have failed with
Harald Hoyer bb31e7
+    #     RTNETLINK answers: Network is unreachable
Harald Hoyer bb31e7
+    # Replace the default route again after static routes to cover
Harald Hoyer bb31e7
+    # this scenario.
Harald Hoyer bb31e7
+    [ -e /tmp/net.$netif.gw ]            && . /tmp/net.$netif.gw
Harald Hoyer bb31e7
+
Harald Hoyer bb31e7
     # Handle STP Timeout: arping the default gateway.
Harald Hoyer bb31e7
     # (or the root server, if a) it's local or b) there's no gateway.)
Harald Hoyer bb31e7
     # Note: This assumes that if no router is present the