diff options
author | DmitriyEshenko <snooppy@mail.ua> | 2019-10-18 00:10:06 +0000 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-10-18 07:40:18 +0200 |
commit | cb97581251df019d2dba1ae830cc0d46b2631c6c (patch) | |
tree | 96daac059e1cb6aba3e74aa548dff574e285bc0e /scripts | |
parent | eb87efd7de60f0c5a5d1d834edb83657ed8978c5 (diff) | |
download | vyos-nhrp-cb97581251df019d2dba1ae830cc0d46b2631c6c.tar.gz vyos-nhrp-cb97581251df019d2dba1ae830cc0d46b2631c6c.zip |
T1742 adding additional check before iptables rules creationVyOS_1.2-2019Q4
(cherry picked from commit 9d984b1ffe12f87bd7144e8f5ee199909bbf6a2a)
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/vyos-update-nhrp.pl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/scripts/vyos-update-nhrp.pl b/scripts/vyos-update-nhrp.pl index c6338fd..35c423c 100644 --- a/scripts/vyos-update-nhrp.pl +++ b/scripts/vyos-update-nhrp.pl @@ -458,6 +458,10 @@ sub create_nhrp_iptables { $config_tun->setLevel("interfaces tunnel"); if ( $config_tun->exists("$tun local-ip")) { + if ( $config_tun->exists("$tun remote-ip")) { + print ("$tun is not 'mGRE' tunnel'\n"); + exit 1; + } my $local_ip = $config_tun->returnValue("$tun local-ip"); system ("sudo iptables -N VYOS_NHRP_${tun}_OUT_HOOK") == 0 or die "System call failed: $!"; |