aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2002-03-05 21:27:10 +0000
committerBill Nottingham <notting@redhat.com>2002-03-05 21:27:10 +0000
commit35c33a5e249e7c90a80441a99a6b98afed7af241 (patch)
tree0d571647e6071246a0d5738964a70639471187ab /sysconfig/network-scripts
parent2ff1779a53d0eb7ab1ad4492710176acef2a80c0 (diff)
downloadinitscripts-35c33a5e249e7c90a80441a99a6b98afed7af241.tar
initscripts-35c33a5e249e7c90a80441a99a6b98afed7af241.tar.gz
initscripts-35c33a5e249e7c90a80441a99a6b98afed7af241.tar.bz2
initscripts-35c33a5e249e7c90a80441a99a6b98afed7af241.tar.xz
initscripts-35c33a5e249e7c90a80441a99a6b98afed7af241.zip
initial support for setting source addresses (for LVS). may or may not work
Diffstat (limited to 'sysconfig/network-scripts')
-rwxr-xr-xsysconfig/network-scripts/ifup13
1 files changed, 10 insertions, 3 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index cd2c2286..678ba257 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -212,6 +212,13 @@ else
else
SCOPE=
fi
+
+ if [ -n "$SRCADDR" ]; then
+ SRC="src $SRCADDR"
+ sysctl -w "net.ipv4.conf.${REALDEVICE}.arp_filter=1"
+ else
+ SRC=
+ fi
if ! LC_ALL=C ip addr ls ${REALDEVICE} | grep -q "${IPADDR}/${PREFIX}" ; then
if ! ip addr add ${IPADDR}/${PREFIX} \
@@ -227,17 +234,17 @@ else
# Add a route for the subnet. Replace any existing route.
if [ "${ISALIAS}" = no ]; then
- ip route replace ${NETWORK}/${PREFIX} dev ${REALDEVICE}
+ ip route replace ${NETWORK}/${PREFIX} ${SRC} dev ${REALDEVICE}
fi
# Set a default route.
if [ -z "${GATEWAYDEV}" -o "${GATEWAYDEV}" = "${REALDEVICE}" ]; then
# set up default gateway
if [ -n "${GATEWAY}" -a "`ipcalc --network ${GATEWAY} ${NETMASK} 2>/dev/null`" = "NETWORK=${NETWORK}" ]; then
- ip route add default via ${GATEWAY}
+ ip route add default via ${GATEWAY} ${SRC}
DEFGW=${GATEWAY}
elif [ "${GATEWAYDEV}" = "${DEVICE}" ]; then
- ip route add default dev ${REALDEVICE}
+ ip route add default ${SRC} dev ${REALDEVICE}
fi
fi
fi