summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKim Hagen <kim.sidney@gmail.com>2016-03-05 11:24:58 -0500
committerKim Hagen <kim.sidney@gmail.com>2016-03-05 11:24:58 -0500
commiteb8d3d05b26056f4c34f4aa39b14928afb944914 (patch)
treeac364583881f87fe1951d0e425da9d4ffa3a8a1b
parentb98dfacd07a71b41fce92392d0027b7b4507ee69 (diff)
downloadvyos-opennhrp-eb8d3d05b26056f4c34f4aa39b14928afb944914.tar.gz
vyos-opennhrp-eb8d3d05b26056f4c34f4aa39b14928afb944914.zip
use the terminate command including source and destination ip
-rwxr-xr-xetc/opennhrp-script6
1 files changed, 2 insertions, 4 deletions
diff --git a/etc/opennhrp-script b/etc/opennhrp-script
index c8df5fc..7a28e06 100755
--- a/etc/opennhrp-script
+++ b/etc/opennhrp-script
@@ -24,8 +24,7 @@ peer-up)
echo "Create link from $NHRP_SRCADDR ($NHRP_SRCNBMA) to $NHRP_DESTADDR ($NHRP_DESTNBMA)"
if [[ ( ${_type} == "spoke" ) && ( -e ${_strongswan_pid} ) ]]; then
if grep "${NHRP_SRCADDR}" "${_nhrp_ipsec}"; then
- _ccon=`ipsec stroke status | grep -E 'vpnprof-dmvpn.*$NHRP_SRCNBMA.*$NHRP_DESTNBMA' | cut -d'[' -f 2 | cut -d']' -f 1`
- swanctl -t -I $_ccon /dev/null 2>&1
+ swanctl -t -S $NHRP_SRCNBMA -R $NHRP_DESTNBMA /dev/null 2>&1
swanctl -i -c dmvpn -S $NHRP_SRCNBMA -R $NHRP_DESTNBMA || exit 1
fi
fi
@@ -33,8 +32,7 @@ peer-up)
peer-down)
echo "Delete link from $NHRP_SRCADDR ($NHRP_SRCNBMA) to $NHRP_DESTADDR ($NHRP_DESTNBMA)"
if [[ ( ${_type} == "spoke" ) && ( -e ${_strongswan_pid} ) ]]; then
- _ccon=`ipsec stroke status | grep -E 'vpnprof-dmvpn.*$NHRP_SRCNBMA.*$NHRP_DESTNBMA' | cut -d'[' -f 2 | cut -d']' -f 1`
- swanctl -t -I $_ccon || exit 1
+ swanctl -t -S $NHRP_SRCNBMA -R $NHRP_DESTNBMA || exit 1
fi
ip route del $NHRP_DESTNBMA src $NHRP_SRCNBMA proto 42
;;