From: Michael Tremer Date: Thu, 8 Sep 2022 15:44:43 +0000 (+0200) Subject: dhcpcd.exe: Add a safety net to make sure we always have a route X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=88b976129bb9a3bdb37797c099b9ac44e3914aa5;p=people%2Fms%2Fipfire-2.x.git dhcpcd.exe: Add a safety net to make sure we always have a route Signed-off-by: Michael Tremer --- diff --git a/src/initscripts/networking/dhcpcd.exe b/src/initscripts/networking/dhcpcd.exe index 4ab9fbc430..220f95c838 100644 --- a/src/initscripts/networking/dhcpcd.exe +++ b/src/initscripts/networking/dhcpcd.exe @@ -60,6 +60,18 @@ dhcpcd_up() mv /tmp/hosts /etc/hosts fi + # Try to set the default route if there is none + # This can happen when we are using the 3RD party configuration + # This should not be necessary, since dhcpcd says it will configure + # a default route, but that does not seem to happen: + # https://github.com/NetworkConfiguration/dhcpcd/issues/129 + if ! ip route 2>/dev/null | grep ^default && [ -s "/var/ipfire/red/remote-ipaddress" ]; then + gateway=$(