From: Denis Silakov Date: Mon, 9 Jan 2017 09:55:10 +0000 (+0300) Subject: Support multiple default gateways from DHCP server (rhbz#1408249) X-Git-Tag: 045~60^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2f6409a2298b40cee9ad6fed724687da025a78f;p=thirdparty%2Fdracut.git Support multiple default gateways from DHCP server (rhbz#1408249) --- diff --git a/modules.d/40network/dhclient-script.sh b/modules.d/40network/dhclient-script.sh index f49cdb88b..2ad04f6be 100755 --- a/modules.d/40network/dhclient-script.sh +++ b/modules.d/40network/dhclient-script.sh @@ -48,7 +48,13 @@ setup_interface() { # point-to-point connection => set explicit route to gateway echo ip route add $gw dev $netif > /tmp/net.$netif.gw fi - echo ip route replace default via $gw dev $netif >> /tmp/net.$netif.gw + IFS=' ' read -r main_gw other_gw <<< "$gw" + echo ip route replace default via $main_gw dev $netif >> /tmp/net.$netif.gw + if [ -n "$other_gw" ] ; then + for g in $other_gw; do + echo ip route add default via $g dev $netif >> /tmp/net.$netif.gw + done + fi fi if getargbool 1 rd.peerdns; then