aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2002-03-11 22:10:08 +0000
committerBill Nottingham <notting@redhat.com>2002-03-11 22:10:08 +0000
commit83c5f7d06c0bcb45a71c3ccc3f513903d38242c2 (patch)
treebeee53d8b6c6f263afe5e626d00e2fe4f25d6ff4 /sysconfig/network-scripts
parent29b25f0b3f86cf0fa72bb1fc24cd99f5b96cd12c (diff)
downloadinitscripts-83c5f7d06c0bcb45a71c3ccc3f513903d38242c2.tar
initscripts-83c5f7d06c0bcb45a71c3ccc3f513903d38242c2.tar.gz
initscripts-83c5f7d06c0bcb45a71c3ccc3f513903d38242c2.tar.bz2
initscripts-83c5f7d06c0bcb45a71c3ccc3f513903d38242c2.tar.xz
initscripts-83c5f7d06c0bcb45a71c3ccc3f513903d38242c2.zip
initial support for setting source addresses, for LVS
Diffstat (limited to 'sysconfig/network-scripts')
-rwxr-xr-xsysconfig/network-scripts/ifup18
1 files changed, 14 insertions, 4 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index 012f982e..604757d3 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -210,13 +210,23 @@ else
else
SCOPE=
fi
-
+
+ if [ -n "$SRCADDR" ]; then
+ SRC="src $SRCADDR"
+ else
+ SRC=
+ fi
+
if ! LC_ALL=C ip addr ls ${REALDEVICE} | grep -q "${IPADDR}/${PREFIX}" ; then
if ! ip addr add ${IPADDR}/${PREFIX} \
brd ${BROADCAST:-+} dev ${REALDEVICE} ${SCOPE} label ${DEVICE}; then
echo $"Error adding address ${IPADDR} for ${DEVICE}."
fi
fi
+
+ if [ -n "$SRCADDR" ]; then
+ sysctl -w "net.ipv4.conf.${REALDEVICE}.arp_filter=1" >/dev/null 2>&1
+ fi
# update ARP cache of neighboring computers
arping -q -A -c 1 -I ${REALDEVICE} ${IPADDR}
@@ -225,16 +235,16 @@ 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}
elif [ "${GATEWAYDEV}" = "${DEVICE}" ]; then
- ip route add default dev ${REALDEVICE}
+ ip route add default ${SRC} dev ${REALDEVICE}
fi
fi
fi
d Dutch translationReinout van Schouwen2007-08-061-64/+74 * Updated Norwegian Nynorsk translation.Karl Ove Hufthammer2007-08-061-62/+41 * updateThierry Vignaud2007-08-061-11/+11 * updateThierry Vignaud2007-08-061-64/+58 * sync with codeThierry Vignaud2007-08-0671-17214/+20754 * update translation for HebrewDotan Kamber2007-08-031-9/+10 * Updated Norwegian Nynorsk translation.Karl Ove Hufthammer2007-08-021-2/+2 * Updated Norwegian Nynorsk translation.Karl Ove Hufthammer2007-08-021-105/+83 * update translation for HebrewDotan Kamber2007-08-011-105/+59 * update a stringThierry Vignaud2007-07-3071-142/+142 * sync with codeThierry Vignaud2007-07-3071-6653/+8065 * updateJosé Melo2007-07-231-66/+36 * update translation for HebrewDotan Kamber2007-07-211-2/+2 * Updated Norwegian Nynorsk translation.Karl Ove Hufthammer2007-07-171-50/+78 * update translation for HebrewDotan Kamber2007-07-161-42/+25 * Update fr translationChristophe Berthelé2007-07-081-4/+4 * Updated zh_CN translationFunda Wang2007-07-011-3/+3 * Updated POT fileFunda Wang2007-07-0171-23803/+24239 * updated translationPavel Maryanov2007-06-161-76/+33 * fixing some fuzzy entries and translating messages to pt_BRFelipe Arruda2007-05-211-73/+42 * Japanese translation reviewedYukiko Bando2007-05-151-8/+8 * upJosé Melo2007-05-071-92/+60 * re-sync after the big svn lossPascal Rigaux2007-04-25