diff options
Diffstat (limited to 'sysconfig/network-scripts/ifup-ipsec')
-rwxr-xr-x | sysconfig/network-scripts/ifup-ipsec | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sysconfig/network-scripts/ifup-ipsec b/sysconfig/network-scripts/ifup-ipsec index 017414d9..ab055fe9 100755 --- a/sysconfig/network-scripts/ifup-ipsec +++ b/sysconfig/network-scripts/ifup-ipsec @@ -99,6 +99,10 @@ if [ -n "$IKE_DNSSEC" ]; then IKE_METHOD=X509 fi +if [ -z "$SRC" ]; then + SRC=`ip -o route get to $DST | sed "s|.*src \([^ ]*\).*|\1|"` +fi + if [ -n "$SRCNET" -o -n "$DSTNET" ]; then MODE=tunnel [ -z "$SRCNET" ] && SRCNET="$SRC/32" @@ -116,11 +120,6 @@ fi [ -n "$IKE_METHOD" ] && KEYING=automatic [ -z "$KEYING" ] && KEYING=manual -# Get source address -if [ -z "$SRC" ]; then - SRC=`ip -o route get to $DST | sed "s|.*src \([^ ]*\).*|\1|"` -fi - if [ "$KEYING" = "manual" ]; then |