aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2001-08-09 03:42:16 +0000
committerBill Nottingham <notting@redhat.com>2001-08-09 03:42:16 +0000
commit8a998885175388ada90c32ed06000e22648d5b18 (patch)
tree94aee0ed42abc1789606d2f3d47a20642d2bde86
parentae0f713b19cce1f749b2d3e4011c6561e4854654 (diff)
downloadinitscripts-8a998885175388ada90c32ed06000e22648d5b18.tar
initscripts-8a998885175388ada90c32ed06000e22648d5b18.tar.gz
initscripts-8a998885175388ada90c32ed06000e22648d5b18.tar.bz2
initscripts-8a998885175388ada90c32ed06000e22648d5b18.tar.xz
initscripts-8a998885175388ada90c32ed06000e22648d5b18.zip
switch some more things to /sbin/ip; allow adding back of default route for DHCP devices (#48994)
-rwxr-xr-xsysconfig/network-scripts/ifup4
-rwxr-xr-xsysconfig/network-scripts/ifup-ppp2
-rw-r--r--sysconfig/network-scripts/network-functions9
3 files changed, 11 insertions, 4 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index 7bc43c4c..093b093c 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -233,10 +233,10 @@ else
if [ -z "${GATEWAYDEV}" -o "${GATEWAYDEV}" = "${DEVICE}" ]; then
# set up default gateway
if [ -n "${GATEWAY}" -a "`ipcalc --network ${GATEWAY} ${NETMASK} 2>/dev/null`" = "NETWORK=${NETWORK}" ]; then
- route add default gw ${GATEWAY} ${DEVICE}
+ ip route add default via ${GATEWAY}
DEFGW=${GATEWAY}
elif [ "${GATEWAYDEV}" = "${DEVICE}" ]; then
- route add default ${DEVICE}
+ ip route add default dev ${DEVICE}
fi
fi
fi
diff --git a/sysconfig/network-scripts/ifup-ppp b/sysconfig/network-scripts/ifup-ppp
index 147dc858..bca290d0 100755
--- a/sysconfig/network-scripts/ifup-ppp
+++ b/sysconfig/network-scripts/ifup-ppp
@@ -96,6 +96,8 @@ fi
if [ "${DEFROUTE}" != no ] ; then
# pppd will no longer delete an existing default route
# so we have to help it out a little here.
+ DEFRT=`ip route list | awk '/^default / { print $3 }'`
+ [ -n "${DEFRT}" ] && echo $DEFRT > /etc/default-route
route del default >/dev/null 2>&1
opts="$opts defaultroute"
fi
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
}