From: Michael Tremer Date: Thu, 1 Dec 2022 17:23:14 +0000 (+0000) Subject: dhcpcd.exe: Add a safety net to make sure we always have a route X-Git-Tag: v2.27-core173~286 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=86ba5ce3161d2fce3a7190e761ba72dee63889ae;p=ipfire-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=$(