From 906238c891d3f02b4c706457783694e3a01d91ce Mon Sep 17 00:00:00 2001 From: Miloslav Trmac Date: Wed, 10 May 2006 00:08:02 +0000 Subject: Add METRIC= support for default routes (#124045) * ifup-ppp, network-functions: Save all default routes, lose no data. * network-functions: - (find_gateway_dev): Fix - it should find the device while $GATEWAY is not the default route - (add_default_route): Don't use configuration for the device that is being brought down; document function purpose and bugs. --- sysconfig/network-scripts/ifup-eth | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sysconfig/network-scripts/ifup-eth') diff --git a/sysconfig/network-scripts/ifup-eth b/sysconfig/network-scripts/ifup-eth index 081c3fd1..5d05c171 100755 --- a/sysconfig/network-scripts/ifup-eth +++ b/sysconfig/network-scripts/ifup-eth @@ -258,12 +258,14 @@ else if [ -z "${GATEWAYDEV}" -o "${GATEWAYDEV}" = "${REALDEVICE}" ]; then # set up default gateway. replace if one already exists if [ -n "${GATEWAY}" -a "`ipcalc --network ${GATEWAY} ${NETMASK} 2>/dev/null`" = "NETWORK=${NETWORK}" ]; then - ip route replace default via ${GATEWAY} ${WINDOW:+window $WINDOW} ${SRC} ${GATEWAYDEV:+dev $GATEWAYDEV} + ip route replace default ${METRIC:+metric $METRIC} \ + via ${GATEWAY} ${WINDOW:+window $WINDOW} ${SRC} \ + ${GATEWAYDEV:+dev $GATEWAYDEV} elif [ "${GATEWAYDEV}" = "${DEVICE}" ]; then - ip route replace default ${SRC} ${WINDOW:+window $WINDOW} dev ${REALDEVICE} + ip route replace default ${METRIC:+metric $METRIC} \ + ${SRC} ${WINDOW:+window $WINDOW} dev ${REALDEVICE} fi fi - fi # Bonding initialization part II - for static, enslave the devices. For -- cgit v1.2.1