From 38037a852b2022510f7dfa46a410814f33b47843 Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 15 Mar 1999 23:26:09 +0000 Subject: add routes to non-local subnets if they aren't already there --- sysconfig/network-scripts/ifup | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'sysconfig/network-scripts/ifup') diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup index 209fd41a..3c64e072 100755 --- a/sysconfig/network-scripts/ifup +++ b/sysconfig/network-scripts/ifup @@ -99,8 +99,10 @@ else ifconfig ${DEVICE} ${MACADDR:+hw ether $MACADDR} ${IPADDR} \ netmask ${NETMASK} broadcast ${BROADCAST} + # don't re-add subnet route on 2.2 kernels, but add a route + # to a non-local subnet. # stupid hack, but it should work - if [ "$ISALIAS" = no ] && [ ! -f "/proc/sys/kernel/modprobe" ] ; then + if [ "$ISALIAS" = no -a ! -f "/proc/sys/kernel/modprobe" ] || [ -z "`route -n | sed "s/ .*//" | grep ${NETWORK}`" ]; then route add -net ${NETWORK} netmask ${NETMASK} ${DEVICE} else route add -host ${IPADDR} ${DEVICE} -- cgit v1.2.1