Déplacé variable GATEWAY dans script de configuration de carte réseau
[hvlinux.git] / stage2 / bootscripts / ifup
index 7fb88d3..4224c47 100755 (executable)
@@ -57,6 +57,15 @@ elif [ x${BOOTPROTO} = "xstatic" ]; then
     # Static configuration
     cmd_run_log ip addr add ${IPADDR}/${PREFIX_LENGTH} dev ${DEVICE} brd + ${IFSCOPE} &&
     cmd_run_log ip link set ${DEVICE} up
+
+    if [ -n "${GATEWAY}" ]; then
+       if ip route | grep -q default; then
+           msg_log "Gateway already setup; skipping."
+       else
+           cmd_run_log_box "Adding default route to gateway ${GATEWAY}" \
+                ip route add default via ${GATEWAY} dev ${DEVICE}
+       fi
+    fi
 elif [ x${BOOTPROTO} = "xpppoe" ]; then
     # PPPoE configuration
     cmd_run_log pppoe-start