Browse Source

Merge pull request #193 from dsilakov/master

Support multiple default gateways from DHCP server (rhbz#1408249)
master
Harald Hoyer 8 years ago committed by GitHub
parent
commit
a6229a8f9a
  1. 11
      modules.d/40network/dhclient-script.sh

11
modules.d/40network/dhclient-script.sh

@ -48,7 +48,16 @@ setup_interface() {
# point-to-point connection => set explicit route to gateway # point-to-point connection => set explicit route to gateway
echo ip route add $gw dev $netif > /tmp/net.$netif.gw echo ip route add $gw dev $netif > /tmp/net.$netif.gw
fi fi
echo ip route replace default via $gw dev $netif >> /tmp/net.$netif.gw
echo "$gw" | {
IFS=' ' read -r main_gw other_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 fi


if getargbool 1 rd.peerdns; then if getargbool 1 rd.peerdns; then

Loading…
Cancel
Save