]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
The default gateway might need a static route 88/head
authorStijn Hoop <stijn@sandcat.nl>
Sun, 23 Aug 2015 12:45:53 +0000 (14:45 +0200)
committerStijn Hoop <stijn@sandcat.nl>
Sun, 23 Aug 2015 12:45:53 +0000 (14:45 +0200)
Some hosting providers need a static route set in order to be
able to reach the default gateway. Be sure to retry adding
the default gateway after setting the static routes.

modules.d/40network/net-lib.sh

index 5c65a2ea83200563c557b35069d86553a2a8fe59..2e796191f53c862ea3ae407f74e2efc69ff1a055 100755 (executable)
@@ -129,6 +129,13 @@ setup_net() {
         fi
     done
 
+    # If a static route was necessary to reach the gateway, the
+    # first gateway setup call will have failed with
+    #     RTNETLINK answers: Network is unreachable
+    # Replace the default route again after static routes to cover
+    # this scenario.
+    [ -e /tmp/net.$netif.gw ]            && . /tmp/net.$netif.gw
+
     # Handle STP Timeout: arping the default gateway.
     # (or the root server, if a) it's local or b) there's no gateway.)
     # Note: This assumes that if no router is present the