summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-07-25 19:38:22 +0200
committerGitHub <noreply@github.com>2022-07-25 19:38:22 +0200
commitd9ef43e3110611acc2a71133b4218b31e1975764 (patch)
tree5b0f033b1a2c58a48da1bdff6e8e2fd3a89dc38b
parent55d7ff854cfe0eba1b0a53e1316976471ce2d914 (diff)
parent870fe6c828a8c7b86899a1c580414d1491eeb8b0 (diff)
downloadvyos-1x-d9ef43e3110611acc2a71133b4218b31e1975764.tar.gz
vyos-1x-d9ef43e3110611acc2a71133b4218b31e1975764.zip
Merge pull request #1433 from sever-sever/T4568
ipsec: T4568: Fix debug IPsec peer op-mode
-rw-r--r--op-mode-definitions/vpn-ipsec.xml.in3
-rwxr-xr-xsrc/op_mode/vpn_ipsec.py5
2 files changed, 6 insertions, 2 deletions
diff --git a/op-mode-definitions/vpn-ipsec.xml.in b/op-mode-definitions/vpn-ipsec.xml.in
index f1f43755b..a98cf8ff2 100644
--- a/op-mode-definitions/vpn-ipsec.xml.in
+++ b/op-mode-definitions/vpn-ipsec.xml.in
@@ -76,6 +76,9 @@
<tagNode name="peer">
<properties>
<help>Show debugging information for a peer</help>
+ <completionHelp>
+ <path>vpn ipsec site-to-site peer</path>
+ </completionHelp>
</properties>
<children>
<tagNode name="tunnel">
diff --git a/src/op_mode/vpn_ipsec.py b/src/op_mode/vpn_ipsec.py
index 8955e5a59..68dc5bc45 100755
--- a/src/op_mode/vpn_ipsec.py
+++ b/src/op_mode/vpn_ipsec.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2021 VyOS maintainers and contributors
+# Copyright (C) 2021-2022 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
@@ -87,6 +87,7 @@ def reset_profile(profile, tunnel):
print('Profile reset result: ' + ('success' if result == 0 else 'failed'))
def debug_peer(peer, tunnel):
+ peer = peer.replace(':', '-')
if not peer or peer == "all":
debug_commands = [
"sudo ipsec statusall",
@@ -109,7 +110,7 @@ def debug_peer(peer, tunnel):
if not tunnel or tunnel == 'all':
tunnel = ''
- conn = get_peer_connections(peer, tunnel)
+ conns = get_peer_connections(peer, tunnel, return_all = (tunnel == '' or tunnel == 'all'))
if not conns:
print('Peer not found, aborting')