diff options
author | Bill Nottingham <notting@redhat.com> | 1999-03-15 23:26:09 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 1999-03-15 23:26:09 +0000 |
commit | 38037a852b2022510f7dfa46a410814f33b47843 (patch) | |
tree | b5d4568b0d1b11b324a345d028d46b514d39beab | |
parent | e2a8508c138a7d49f6d4945242a6bc18c4886eab (diff) | |
download | initscripts-38037a852b2022510f7dfa46a410814f33b47843.tar initscripts-38037a852b2022510f7dfa46a410814f33b47843.tar.gz initscripts-38037a852b2022510f7dfa46a410814f33b47843.tar.bz2 initscripts-38037a852b2022510f7dfa46a410814f33b47843.tar.xz initscripts-38037a852b2022510f7dfa46a410814f33b47843.zip |
add routes to non-local subnets if they aren't already there
-rwxr-xr-x | sysconfig/network-scripts/ifup | 4 |
1 files changed, 3 insertions, 1 deletions
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} |