From 020165ce5b9643ff3b9c96bd4a30c981a5d5d78d Mon Sep 17 00:00:00 2001
From: "C.J. Collier" <cjcollier@linuxfoundation.org>
Date: Wed, 11 May 2016 06:42:43 +0000
Subject: vyatta-op-vpn (0.15.0+vyos2+current2+nmu1) UNRELEASED; urgency=low

  * Non-maintainer upload.
  * address lintian issues
  - script-not-executable: removed #!/usr/bin/perl from .pm files
  - debhelper-but-no-misc-depends: added ${misc:Depends} to Depends: field
  - debian-rules-missing-recommended-target: added build-arch build-indep
  - out-of-date-standards-version: updated standards version to 3.9.4
  - package-contains-linda-override: removed linda override
  - file-in-unusual-dir: not triggering, removed from override
  - script-with-language-extension: renamed vyatta-gen-x509-keypair.sh
    vyatta-gen-x509-keypair
  * address dpkg-gencontrol issue:
  - unknown substitution variable ${shlibs:Depends} - removed
  * address dpkg-source issue:
  - debian/source/format set to "3.0 (native)"
  * removed all references to /opt/vyatta but one from source

Signed-off-by: C.J. Collier <cjcollier@linuxfoundation.org>
---
 templates/show/vpn/ipsec/sa/node.def | 3 ---
 1 file changed, 3 deletions(-)
 delete mode 100644 templates/show/vpn/ipsec/sa/node.def

(limited to 'templates/show/vpn/ipsec/sa/node.def')

diff --git a/templates/show/vpn/ipsec/sa/node.def b/templates/show/vpn/ipsec/sa/node.def
deleted file mode 100644
index 287d489..0000000
--- a/templates/show/vpn/ipsec/sa/node.def
+++ /dev/null
@@ -1,3 +0,0 @@
-help: Show all active IPsec Security Associations (SA)
-run: sudo /opt/vyatta/bin/sudo-users/vyatta-op-vpn.pl --show-ipsec-sa
-     sudo /opt/vyatta/bin/sudo-users/vyatta-op-vpnprof.pl --show-ipsec-sa
-- 
cgit v1.2.3


From 33e24e989996ec809e1be696866258ce987cc527 Mon Sep 17 00:00:00 2001
From: Kim Hagen <kim.sidney@gmail.com>
Date: Thu, 15 Sep 2016 11:40:03 +0200
Subject: Reimplementation of TriJetScud's
 commit:578688a25ba784d839512fefafab4cabdaf32fc5.

Simpilfy the operational commands
Instead of trying to parse the outout of ipsec or swanctl, just dump
whatever swanctl outputs.
---
 .gitignore                                             | 18 +-----------------
 configure.ac                                           | 16 ----------------
 templates/show/vpn/ipsec/sa/detail/node.def.in         |  3 ---
 .../show/vpn/ipsec/sa/detail/peer/node.tag/node.def.in |  3 ---
 .../detail/peer/node.tag/tunnel/node.tag/node.def.in   |  3 ---
 .../vpn/ipsec/sa/detail/profile/node.tag/node.def.in   |  3 ---
 .../profile/node.tag/tunnel/node.tag/node.def.in       |  3 ---
 templates/show/vpn/ipsec/sa/nat-traversal/node.def.in  |  2 --
 templates/show/vpn/ipsec/sa/node.def                   |  6 ++++++
 templates/show/vpn/ipsec/sa/node.def.in                |  3 ---
 templates/show/vpn/ipsec/sa/peer/node.tag/node.def.in  |  3 ---
 .../ipsec/sa/peer/node.tag/tunnel/node.tag/node.def.in |  3 ---
 .../show/vpn/ipsec/sa/profile/node.tag/node.def.in     |  3 ---
 .../sa/profile/node.tag/tunnel/node.tag/node.def.in    |  3 ---
 templates/show/vpn/ipsec/sa/statistics/node.def.in     |  3 ---
 .../vpn/ipsec/sa/statistics/peer/node.tag/node.def.in  |  3 ---
 .../peer/node.tag/tunnel/node.tag/node.def.in          |  3 ---
 .../ipsec/sa/statistics/profile/node.tag/node.def.in   |  3 ---
 .../profile/node.tag/tunnel/node.tag/node.def.in       |  3 ---
 19 files changed, 7 insertions(+), 80 deletions(-)
 delete mode 100644 templates/show/vpn/ipsec/sa/detail/node.def.in
 delete mode 100644 templates/show/vpn/ipsec/sa/detail/peer/node.tag/node.def.in
 delete mode 100644 templates/show/vpn/ipsec/sa/detail/peer/node.tag/tunnel/node.tag/node.def.in
 delete mode 100644 templates/show/vpn/ipsec/sa/detail/profile/node.tag/node.def.in
 delete mode 100644 templates/show/vpn/ipsec/sa/detail/profile/node.tag/tunnel/node.tag/node.def.in
 delete mode 100644 templates/show/vpn/ipsec/sa/nat-traversal/node.def.in
 create mode 100644 templates/show/vpn/ipsec/sa/node.def
 delete mode 100644 templates/show/vpn/ipsec/sa/node.def.in
 delete mode 100644 templates/show/vpn/ipsec/sa/peer/node.tag/node.def.in
 delete mode 100644 templates/show/vpn/ipsec/sa/peer/node.tag/tunnel/node.tag/node.def.in
 delete mode 100644 templates/show/vpn/ipsec/sa/profile/node.tag/node.def.in
 delete mode 100644 templates/show/vpn/ipsec/sa/profile/node.tag/tunnel/node.tag/node.def.in
 delete mode 100644 templates/show/vpn/ipsec/sa/statistics/node.def.in
 delete mode 100644 templates/show/vpn/ipsec/sa/statistics/peer/node.tag/node.def.in
 delete mode 100644 templates/show/vpn/ipsec/sa/statistics/peer/node.tag/tunnel/node.tag/node.def.in
 delete mode 100644 templates/show/vpn/ipsec/sa/statistics/profile/node.tag/node.def.in
 delete mode 100644 templates/show/vpn/ipsec/sa/statistics/profile/node.tag/tunnel/node.tag/node.def.in

(limited to 'templates/show/vpn/ipsec/sa/node.def')

diff --git a/.gitignore b/.gitignore
index 470b73c..cce2a86 100644
--- a/.gitignore
+++ b/.gitignore
@@ -48,21 +48,5 @@ templates/show/vpn/ike/sa/node.def
 templates/show/vpn/ike/sa/peer/node.tag/node.def
 templates/show/vpn/ike/secrets/node.def
 templates/show/vpn/ike/status/node.def
-templates/show/vpn/ipsec/sa/detail/node.def
-templates/show/vpn/ipsec/sa/detail/peer/node.tag/node.def
-templates/show/vpn/ipsec/sa/detail/peer/node.tag/tunnel/node.tag/node.def
-templates/show/vpn/ipsec/sa/detail/profile/node.tag/node.def
-templates/show/vpn/ipsec/sa/detail/profile/node.tag/tunnel/node.tag/node.def
-templates/show/vpn/ipsec/sa/nat-traversal/node.def
-templates/show/vpn/ipsec/sa/node.def
-templates/show/vpn/ipsec/sa/peer/node.tag/node.def
-templates/show/vpn/ipsec/sa/peer/node.tag/tunnel/node.tag/node.def
-templates/show/vpn/ipsec/sa/profile/node.tag/node.def
-templates/show/vpn/ipsec/sa/profile/node.tag/tunnel/node.tag/node.def
-templates/show/vpn/ipsec/sa/statistics/node.def
-templates/show/vpn/ipsec/sa/statistics/peer/node.tag/node.def
-templates/show/vpn/ipsec/sa/statistics/peer/node.tag/tunnel/node.tag/node.def
-templates/show/vpn/ipsec/sa/statistics/profile/node.tag/node.def
-templates/show/vpn/ipsec/sa/statistics/profile/node.tag/tunnel/node.tag/node.def
 templates/show/vpn/ipsec/status/node.def
-/scripts/vyatta-gen-x509-keypair
\ No newline at end of file
+/scripts/vyatta-gen-x509-keypair
diff --git a/configure.ac b/configure.ac
index 6002c2d..19a356f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -54,22 +54,6 @@ AC_OUTPUT([
 	templates/generate/vpn/rsa-key/bits/node.tag/node.def
 	templates/generate/vpn/rsa-key/bits/node.tag/random/node.tag/node.def
 	templates/show/vpn/ipsec/status/node.def
-	templates/show/vpn/ipsec/sa/node.def
-	templates/show/vpn/ipsec/sa/nat-traversal/node.def
-	templates/show/vpn/ipsec/sa/statistics/node.def
-	templates/show/vpn/ipsec/sa/statistics/profile/node.tag/node.def
-	templates/show/vpn/ipsec/sa/statistics/profile/node.tag/tunnel/node.tag/node.def
-	templates/show/vpn/ipsec/sa/statistics/peer/node.tag/node.def
-	templates/show/vpn/ipsec/sa/statistics/peer/node.tag/tunnel/node.tag/node.def
-	templates/show/vpn/ipsec/sa/detail/node.def
-	templates/show/vpn/ipsec/sa/detail/profile/node.tag/node.def
-	templates/show/vpn/ipsec/sa/detail/profile/node.tag/tunnel/node.tag/node.def
-	templates/show/vpn/ipsec/sa/detail/peer/node.tag/node.def
-	templates/show/vpn/ipsec/sa/detail/peer/node.tag/tunnel/node.tag/node.def
-	templates/show/vpn/ipsec/sa/profile/node.tag/node.def
-	templates/show/vpn/ipsec/sa/profile/node.tag/tunnel/node.tag/node.def
-	templates/show/vpn/ipsec/sa/peer/node.tag/node.def
-	templates/show/vpn/ipsec/sa/peer/node.tag/tunnel/node.tag/node.def
 	templates/show/vpn/debug/node.def
 	templates/show/vpn/debug/detail/node.def
 	templates/show/vpn/debug/peer/node.tag/node.def
diff --git a/templates/show/vpn/ipsec/sa/detail/node.def.in b/templates/show/vpn/ipsec/sa/detail/node.def.in
deleted file mode 100644
index 781d61b..0000000
--- a/templates/show/vpn/ipsec/sa/detail/node.def.in
+++ /dev/null
@@ -1,3 +0,0 @@
-help: Show details for all active IPsec Security Associations (SA)
-run: sudo @SUDOUSRDIR@/vyatta-op-vpn.pl --show-ipsec-sa-detail
-     sudo @SUDOUSRDIR@/vyatta-op-vpnprof.pl --show-ipsec-sa-detail
diff --git a/templates/show/vpn/ipsec/sa/detail/peer/node.tag/node.def.in b/templates/show/vpn/ipsec/sa/detail/peer/node.tag/node.def.in
deleted file mode 100644
index 659acfa..0000000
--- a/templates/show/vpn/ipsec/sa/detail/peer/node.tag/node.def.in
+++ /dev/null
@@ -1,3 +0,0 @@
-help: Show details for all active IPsec Security Associations (SA) for a peer
-allowed: @SUDOUSRDIR@/vyatta-op-vpn.pl --get-peers-for-cli
-run: sudo @SUDOUSRDIR@/vyatta-op-vpn.pl --show-ipsec-sa-peer-detail="$7"
diff --git a/templates/show/vpn/ipsec/sa/detail/peer/node.tag/tunnel/node.tag/node.def.in b/templates/show/vpn/ipsec/sa/detail/peer/node.tag/tunnel/node.tag/node.def.in
deleted file mode 100644
index 5c121c3..0000000
--- a/templates/show/vpn/ipsec/sa/detail/peer/node.tag/tunnel/node.tag/node.def.in
+++ /dev/null
@@ -1,3 +0,0 @@
-help: Show details for the active IPsec Security Associations (SA) for a peer's tunnel
-allowed: @SUDOUSRDIR@/vyatta-op-vpn.pl --get-conn-for-cli=${COMP_WORDS[6]}
-run: sudo @SUDOUSRDIR@/vyatta-op-vpn.pl --show-ipsec-sa-conn-detail $7 $9
diff --git a/templates/show/vpn/ipsec/sa/detail/profile/node.tag/node.def.in b/templates/show/vpn/ipsec/sa/detail/profile/node.tag/node.def.in
deleted file mode 100644
index bcbc520..0000000
--- a/templates/show/vpn/ipsec/sa/detail/profile/node.tag/node.def.in
+++ /dev/null
@@ -1,3 +0,0 @@
-help: Show details for all active IPsec Security Associations (SA) for a profile
-allowed: @SUDOUSRDIR@/vyatta-op-vpnprof.pl --get-profiles-for-cli
-run: sudo @SUDOUSRDIR@/vyatta-op-vpnprof.pl --show-ipsec-sa-profile-detail="$7"
diff --git a/templates/show/vpn/ipsec/sa/detail/profile/node.tag/tunnel/node.tag/node.def.in b/templates/show/vpn/ipsec/sa/detail/profile/node.tag/tunnel/node.tag/node.def.in
deleted file mode 100644
index e31b008..0000000
--- a/templates/show/vpn/ipsec/sa/detail/profile/node.tag/tunnel/node.tag/node.def.in
+++ /dev/null
@@ -1,3 +0,0 @@
-help: Show details for the active IPsec Security Associations (SA) for a tunnel bound to profile
-allowed: @SUDOUSRDIR@/vyatta-op-vpnprof.pl --get-conn-for-cli=${COMP_WORDS[6]}
-run: sudo @SUDOUSRDIR@/vyatta-op-vpnprof.pl --show-ipsec-sa-conn-detail $7 $9
diff --git a/templates/show/vpn/ipsec/sa/nat-traversal/node.def.in b/templates/show/vpn/ipsec/sa/nat-traversal/node.def.in
deleted file mode 100644
index f3bbe87..0000000
--- a/templates/show/vpn/ipsec/sa/nat-traversal/node.def.in
+++ /dev/null
@@ -1,2 +0,0 @@
-help: Show all active IPsec Security Associations (SA) that are using NAT Traversal
-run: sudo @SUDOUSRDIR@/vyatta-op-vpn.pl --show-ipsec-sa-natt
diff --git a/templates/show/vpn/ipsec/sa/node.def b/templates/show/vpn/ipsec/sa/node.def
new file mode 100644
index 0000000..99a5cc1
--- /dev/null
+++ b/templates/show/vpn/ipsec/sa/node.def
@@ -0,0 +1,6 @@
+help: Show all active IPsec Security Associations (SA)
+run: if pgrep charon >&/dev/null; then
+        sudo /usr/sbin/swanctl --list-sas
+     else
+        echo -e "IPSec Process NOT Running\n"
+     fi
diff --git a/templates/show/vpn/ipsec/sa/node.def.in b/templates/show/vpn/ipsec/sa/node.def.in
deleted file mode 100644
index 036a1d7..0000000
--- a/templates/show/vpn/ipsec/sa/node.def.in
+++ /dev/null
@@ -1,3 +0,0 @@
-help: Show all active IPsec Security Associations (SA)
-run: sudo @SUDOUSRDIR@/vyatta-op-vpn.pl --show-ipsec-sa
-     sudo @SUDOUSRDIR@/vyatta-op-vpnprof.pl --show-ipsec-sa
diff --git a/templates/show/vpn/ipsec/sa/peer/node.tag/node.def.in b/templates/show/vpn/ipsec/sa/peer/node.tag/node.def.in
deleted file mode 100644
index 1cae596..0000000
--- a/templates/show/vpn/ipsec/sa/peer/node.tag/node.def.in
+++ /dev/null
@@ -1,3 +0,0 @@
-help: Show all active IPsec Security Associations (SA) for a peer
-allowed: @SUDOUSRDIR@/vyatta-op-vpn.pl --get-peers-for-cli
-run: sudo @SUDOUSRDIR@/vyatta-op-vpn.pl --show-ipsec-sa-peer="$6"
diff --git a/templates/show/vpn/ipsec/sa/peer/node.tag/tunnel/node.tag/node.def.in b/templates/show/vpn/ipsec/sa/peer/node.tag/tunnel/node.tag/node.def.in
deleted file mode 100644
index 8cc8a9c..0000000
--- a/templates/show/vpn/ipsec/sa/peer/node.tag/tunnel/node.tag/node.def.in
+++ /dev/null
@@ -1,3 +0,0 @@
-help: Show the active IPsec Security Association (SA) for a peer's tunnel
-allowed: @SUDOUSRDIR@/vyatta-op-vpn.pl --get-conn-for-cli=${COMP_WORDS[5]}
-run: sudo @SUDOUSRDIR@/vyatta-op-vpn.pl --show-ipsec-sa-conn $6 $8
diff --git a/templates/show/vpn/ipsec/sa/profile/node.tag/node.def.in b/templates/show/vpn/ipsec/sa/profile/node.tag/node.def.in
deleted file mode 100644
index 30ed853..0000000
--- a/templates/show/vpn/ipsec/sa/profile/node.tag/node.def.in
+++ /dev/null
@@ -1,3 +0,0 @@
-help: Show all active IPsec Security Associations (SA) for a profile
-allowed: @SUDOUSRDIR@/vyatta-op-vpnprof.pl --get-profiles-for-cli
-run: sudo @SUDOUSRDIR@/vyatta-op-vpnprof.pl --show-ipsec-sa-profile="$6"
diff --git a/templates/show/vpn/ipsec/sa/profile/node.tag/tunnel/node.tag/node.def.in b/templates/show/vpn/ipsec/sa/profile/node.tag/tunnel/node.tag/node.def.in
deleted file mode 100644
index 3d643bc..0000000
--- a/templates/show/vpn/ipsec/sa/profile/node.tag/tunnel/node.tag/node.def.in
+++ /dev/null
@@ -1,3 +0,0 @@
-help: Show the active IPsec Security Association (SA) for a profile's tunnel
-allowed: @SUDOUSRDIR@/vyatta-op-vpnprof.pl --get-conn-for-cli=${COMP_WORDS[5]}
-run: sudo @SUDOUSRDIR@/vyatta-op-vpnprof.pl --show-ipsec-sa-conn $6 $8
diff --git a/templates/show/vpn/ipsec/sa/statistics/node.def.in b/templates/show/vpn/ipsec/sa/statistics/node.def.in
deleted file mode 100644
index 5832f1a..0000000
--- a/templates/show/vpn/ipsec/sa/statistics/node.def.in
+++ /dev/null
@@ -1,3 +0,0 @@
-help: Show statistics of all active tunnels that have IPsec Security Associations (SA)
-run: sudo @SUDOUSRDIR@/vyatta-op-vpn.pl --show-ipsec-sa-stats
-     sudo @SUDOUSRDIR@/vyatta-op-vpnprof.pl --show-ipsec-sa-stats
diff --git a/templates/show/vpn/ipsec/sa/statistics/peer/node.tag/node.def.in b/templates/show/vpn/ipsec/sa/statistics/peer/node.tag/node.def.in
deleted file mode 100644
index 8b72451..0000000
--- a/templates/show/vpn/ipsec/sa/statistics/peer/node.tag/node.def.in
+++ /dev/null
@@ -1,3 +0,0 @@
-help: Show stats for all active IPsec Security Associations (SA) for a peer
-allowed: @SUDOUSRDIR@/vyatta-op-vpn.pl --get-peers-for-cli
-run: sudo @SUDOUSRDIR@/vyatta-op-vpn.pl --show-ipsec-sa-stats-peer="$7"
diff --git a/templates/show/vpn/ipsec/sa/statistics/peer/node.tag/tunnel/node.tag/node.def.in b/templates/show/vpn/ipsec/sa/statistics/peer/node.tag/tunnel/node.tag/node.def.in
deleted file mode 100644
index 6566a44..0000000
--- a/templates/show/vpn/ipsec/sa/statistics/peer/node.tag/tunnel/node.tag/node.def.in
+++ /dev/null
@@ -1,3 +0,0 @@
-help: Show stats for the active IPsec Security Association (SA) for a peer's tunnel
-allowed: @SUDOUSRDIR@/vyatta-op-vpn.pl --get-conn-for-cli=${COMP_WORDS[6]}
-run: sudo @SUDOUSRDIR@/vyatta-op-vpn.pl --show-ipsec-sa-stats-conn $7 $9
diff --git a/templates/show/vpn/ipsec/sa/statistics/profile/node.tag/node.def.in b/templates/show/vpn/ipsec/sa/statistics/profile/node.tag/node.def.in
deleted file mode 100644
index 1bc76d6..0000000
--- a/templates/show/vpn/ipsec/sa/statistics/profile/node.tag/node.def.in
+++ /dev/null
@@ -1,3 +0,0 @@
-help: Show stats for all active IPsec Security Associations (SA) for a profile
-allowed: @SUDOUSRDIR@/vyatta-op-vpnprof.pl --get-profiles-for-cli
-run: sudo @SUDOUSRDIR@/vyatta-op-vpnprof.pl --show-ipsec-sa-stats-profile="$7"
diff --git a/templates/show/vpn/ipsec/sa/statistics/profile/node.tag/tunnel/node.tag/node.def.in b/templates/show/vpn/ipsec/sa/statistics/profile/node.tag/tunnel/node.tag/node.def.in
deleted file mode 100644
index 9ae35c8..0000000
--- a/templates/show/vpn/ipsec/sa/statistics/profile/node.tag/tunnel/node.tag/node.def.in
+++ /dev/null
@@ -1,3 +0,0 @@
-help: Show stats for the active IPsec Security Association (SA) for a tunnel bound to profile
-allowed: @SUDOUSRDIR@/vyatta-op-vpnprof.pl --get-conn-for-cli=${COMP_WORDS[6]}
-run: sudo @SUDOUSRDIR@/vyatta-op-vpnprof.pl --show-ipsec-sa-stats-conn $7 $9
-- 
cgit v1.2.3


From f6f567b8b168dbe0d4bdb1b08c0f84faa0d362cb Mon Sep 17 00:00:00 2001
From: jules-vyos <vyos@ourhouse.org.uk>
Date: Sun, 3 Sep 2017 21:25:50 +0100
Subject: Fixes for show vpn ike sa and show vpn ipsec sa

Fixed 'show vpn ike sa' to actually show output when the tunnel isn't up.

Foxed 'show vpn ipsec sa' to actually use the pretty-printing code, rather than swanctl --list-sas, which is pretty unpleasant.
---
 lib/OPMode.pm                        | 16 ++++++++++------
 templates/show/vpn/ipsec/sa/node.def |  2 +-
 2 files changed, 11 insertions(+), 7 deletions(-)

(limited to 'templates/show/vpn/ipsec/sa/node.def')

diff --git a/lib/OPMode.pm b/lib/OPMode.pm
index 0068e96..38bea1c 100644
--- a/lib/OPMode.pm
+++ b/lib/OPMode.pm
@@ -615,19 +615,21 @@ sub process_tunnels{
         $tunnel_hash{$connectid}->{_ikelife} = $ikelife;
         $tunnel_hash{$connectid}->{_pfsgrp} = $pfs_group;
 
-      } elsif ($line =~ /\]:\s+IKE.* SPIs: .* (reauthentication|rekeying) (disabled|in .*)/) {
+      } elsif ($line =~ /\]:\s+IKE.* SPIs:/) {
 	my $ikever;
 	($ikever) = $line =~ /IKEv(.*?) SPI/;
 	$tunnel_hash{$connectid}->{_ikever} = $ikever;
 	my $expiry_time;
-	(undef,$expiry_time) = $line =~ /(reauthentication|rekeying) (.*)/;
-        $tunnel_hash{$connectid}->{_ikeexpire} = conv_time($expiry_time);
+	if($line =~ /(reauthentication|rekeying)/)
+		{(undef,$expiry_time) = $line =~ /(reauthentication|rekeying) (.*)/;
+        	$tunnel_hash{$connectid}->{_ikeexpire} = conv_time($expiry_time);
+	
 
         my $atime = $tunnel_hash{$connectid}->{_ikelife} - $tunnel_hash{$connectid}->{_ikeexpire};
 #        $atime = $ike_lifetime - $ike_expire if (($ike_lifetime ne 'n/a') && ($ike_expire ne 'n/a'));
 
         $tunnel_hash{$connectid}->{_ikestate} = "up" if ($atime >= 0);
-
+	}
       } elsif ($line =~ /\]:\s+IKE.proposal:(.*?)\/(.*?)\/(.*?)\/(.*)/) {
         $tunnel_hash{$connectid}->{_ikeencrypt} = $1;
         $tunnel_hash{$connectid}->{_ikehash} = $2;
@@ -1260,7 +1262,7 @@ sub display_ike_sa_brief {
       my $lip = $th{$connectid}->{_lip};
       $peerid = $th{$connectid}->{_rip};
       my $tunnel = "$peerid-$lip";
-      next if ($th{$connectid}->{_ikestate} eq 'down');
+      #next if ($th{$connectid}->{_ikestate} eq 'down');
       if (not exists $tunhash{$tunnel}) {
         $tunhash{$tunnel}={
           _configpeer => conv_id_rev($th{$connectid}->{_peerid}),
@@ -1304,8 +1306,10 @@ EOH
         $dhgrp = conv_dh_group($dhgrp)."(".$dhgrp.")";
         my $atime = $life - $expire;
         $atime = 0 if ($atime == $life);
+	my $ike_out = "N/A";
+	$ike_out = "IKEv".$ver if( $ver > 0 );
         printf "    %-6s %-6s  %-8s %-7s %-14s %-6s %-7s %-7s\n",
-               $state, "IKEv".$ver, $enc, $hash, $dhgrp, $natt, $atime, $life;
+               $state, $ike_out, $enc, $hash, $dhgrp, $natt, $atime, $life;
       }
       print "\n \n";
     }
diff --git a/templates/show/vpn/ipsec/sa/node.def b/templates/show/vpn/ipsec/sa/node.def
index 99a5cc1..7f569bd 100644
--- a/templates/show/vpn/ipsec/sa/node.def
+++ b/templates/show/vpn/ipsec/sa/node.def
@@ -1,6 +1,6 @@
 help: Show all active IPsec Security Associations (SA)
 run: if pgrep charon >&/dev/null; then
-        sudo /usr/sbin/swanctl --list-sas
+        sudo /opt/vyatta/bin/sudo-users/vyatta-op-vpn.pl --show-ipsec-sa
      else
         echo -e "IPSec Process NOT Running\n"
      fi
-- 
cgit v1.2.3

