aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/network-functions
diff options
context:
space:
mode:
Diffstat (limited to 'sysconfig/network-scripts/network-functions')
-rw-r--r--sysconfig/network-scripts/network-functions9
1 files changed, 7 insertions, 2 deletions
diff --git a/sysconfig/network-scripts/network-functions b/sysconfig/network-scripts/network-functions
index ee6b3356..2f181d73 100644
--- a/sysconfig/network-scripts/network-functions
+++ b/sysconfig/network-scripts/network-functions
@@ -166,11 +166,16 @@ add_default_route ()
if [ "${GATEWAY}" != "" -a "${GATEWAY}" != "none" -a "${GATEWAYDEV}" != "" ] ; then
if ! check_device_down $1; then
if [ "$GATEWAY" = "0.0.0.0" ]; then
- /sbin/route add default ${GATEWAYDEV}
+ /sbin/ip route add default ${GATEWAYDEV}
else
- /sbin/route add default gw ${GATEWAY} ${GATEWAYDEV}
+ /sbin/ip route add default via ${GATEWAY}
fi
fi
+ else
+ if [ -f /etc/default-route ]; then
+ /sbin/ip route add default via `cat /etc/default-route`
+ rm -f /etc/default-route
+ fi
fi
}