aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig
diff options
context:
space:
mode:
authorPreston Brown <pbrown@redhat.com>2002-06-27 16:55:24 +0000
committerPreston Brown <pbrown@redhat.com>2002-06-27 16:55:24 +0000
commit79da64351aa4395a57db31e38cd848b18bdb062c (patch)
tree56e60f35e12bd4846dc8e01e0b8db55b48c3418f /sysconfig
parent353e851e323f20fa6ab2409ca5051e1b0231464b (diff)
downloadinitscripts-79da64351aa4395a57db31e38cd848b18bdb062c.tar
initscripts-79da64351aa4395a57db31e38cd848b18bdb062c.tar.gz
initscripts-79da64351aa4395a57db31e38cd848b18bdb062c.tar.bz2
initscripts-79da64351aa4395a57db31e38cd848b18bdb062c.tar.xz
initscripts-79da64351aa4395a57db31e38cd848b18bdb062c.zip
avoid ifconfig/route, try to avoid duplicate default routes
Diffstat (limited to 'sysconfig')
-rwxr-xr-xsysconfig/network-scripts/ifup12
1 files changed, 7 insertions, 5 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index d3efe47a..0115310f 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -103,11 +103,12 @@ fi
# is the device wireless? If so, configure wireless device specifics
is_wireless_device ${DEVICE} && . ./ifup-wireless
+# slave device?
if [ "${SLAVE}" = yes -a "${ISALIAS}" = no -a "${MASTER}" != "" -a \
-x /sbin/ifenslave ]; then
RFLAG="" ; [ "${RECEIVEONLY}" = yes ] && RFLAG="-r"
- ifconfig ${DEVICE} down
+ /sbin/ip link set ${DEVICE} down
echo $"Enslaving ${DEVICE} to ${MASTER}"
ifenslave ${RFLAG} "${MASTER}" "${DEVICE}"
@@ -168,10 +169,11 @@ if [ -n "${DYNCONFIG}" ]; then
PUMPARGS="${PUMPARGS} -d"
DHCPCDARGS="${DHCPCDARGS} -R"
fi
+ echo
echo -n $"Determining IP information for ${DEVICE}..."
if check_link_down ${DEVICE}; then
echo $" failed; no link present. Check cable?"
- ip link set down ${DEVICE} >/dev/null 2>&1
+ ip link set ${DEVICE} down >/dev/null 2>&1
exit 1
fi
@@ -258,11 +260,11 @@ else
# Set a default route.
if [ -z "${GATEWAYDEV}" -o "${GATEWAYDEV}" = "${REALDEVICE}" ]; then
- # set up default gateway
+ # 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 add default via ${GATEWAY} ${SRC}
+ ip route replace default via ${GATEWAY} ${SRC}
elif [ "${GATEWAYDEV}" = "${DEVICE}" ]; then
- ip route add default ${SRC} dev ${REALDEVICE}
+ ip route replace default ${SRC} dev ${REALDEVICE}
fi
fi
fi