aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup-ipsec
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2005-03-28 20:43:50 +0000
committerBill Nottingham <notting@redhat.com>2005-03-28 20:43:50 +0000
commit109d84ebd3e7ff4286812d278eb86ef5ff204a3a (patch)
tree805805a1a1d81135b6f17b9ff82f511baaa653d1 /sysconfig/network-scripts/ifup-ipsec
parent55ed4d661a930365f27db3ce894cd5db8076d91e (diff)
downloadinitscripts-109d84ebd3e7ff4286812d278eb86ef5ff204a3a.tar
initscripts-109d84ebd3e7ff4286812d278eb86ef5ff204a3a.tar.gz
initscripts-109d84ebd3e7ff4286812d278eb86ef5ff204a3a.tar.bz2
initscripts-109d84ebd3e7ff4286812d278eb86ef5ff204a3a.tar.xz
initscripts-109d84ebd3e7ff4286812d278eb86ef5ff204a3a.zip
add proper ipsec route (#146169, #140654)
Diffstat (limited to 'sysconfig/network-scripts/ifup-ipsec')
-rwxr-xr-xsysconfig/network-scripts/ifup-ipsec6
1 files changed, 4 insertions, 2 deletions
diff --git a/sysconfig/network-scripts/ifup-ipsec b/sysconfig/network-scripts/ifup-ipsec
index 4751b5cc..0314f71a 100755
--- a/sysconfig/network-scripts/ifup-ipsec
+++ b/sysconfig/network-scripts/ifup-ipsec
@@ -137,7 +137,8 @@ EOF
[ -z "$SRCNET" ] && SRCNET="$SRC/32"
[ -z "$DSTNET" ] && DSTNET="$DST/32"
- ip route add to $DSTNET via $DST
+ [ -z "$SRCGW" ] && SRCGW=`ip -o route get to $SRCNET | sed "s|.*src \([^ ]*\).*|\1|"`
+ ip route add to $DSTNET via $SRCGW src $SRCGW
/sbin/setkey -c >/dev/null 2>&1 << EOF
delete $SRC $DST ah $SPI_AH_OUT;
@@ -191,7 +192,8 @@ EOF
[ -z "$SRCNET" ] && SRCNET="$SRC/32"
[ -z "$DSTNET" ] && DSTNET="$DST/32"
- ip route add to $DSTNET via $DST
+ [ -z "$SRCGW" ] && SRCGW=`ip -o route get to $SRCNET | sed "s|.*src \([^ ]*\).*|\1|"`
+ ip route add to $DSTNET via $SRCGW src $SRCGW
/sbin/setkey -c >/dev/null 2>&1 << EOF
spddelete $SRCNET $DSTNET any -P out;