summaryrefslogtreecommitdiff
path: root/scripts/vyos-update-nhrp.pl
diff options
context:
space:
mode:
authorDmitriyEshenko <snooppy@mail.ua>2019-10-18 00:10:06 +0000
committerDmitriyEshenko <snooppy@mail.ua>2019-10-18 00:10:06 +0000
commit9d984b1ffe12f87bd7144e8f5ee199909bbf6a2a (patch)
tree10a8e7854271f175aed71bd71df8039479a0a7a4 /scripts/vyos-update-nhrp.pl
parent8f2d325e5562da0f2a9c012cea3b2b505d2bc02f (diff)
downloadvyos-nhrp-9d984b1ffe12f87bd7144e8f5ee199909bbf6a2a.tar.gz
vyos-nhrp-9d984b1ffe12f87bd7144e8f5ee199909bbf6a2a.zip
T1742 adding additional check before iptables rules creation
Diffstat (limited to 'scripts/vyos-update-nhrp.pl')
-rw-r--r--scripts/vyos-update-nhrp.pl4
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: $!";