summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@baturin.org>2018-08-22 17:53:06 +0700
committerGitHub <noreply@github.com>2018-08-22 17:53:06 +0700
commitacc5cee5990778c5d4c6a2b06fab186fca13e4de (patch)
treed53b83f9243885379f93ba821e4c885dd0535a76
parentd3cbc482db0f09b0b8480cb97ef4d0b56dc4c1b0 (diff)
parent521c32104c063011088f981e3dc136f32e744deb (diff)
downloadvyos-1x-acc5cee5990778c5d4c6a2b06fab186fca13e4de.tar.gz
vyos-1x-acc5cee5990778c5d4c6a2b06fab186fca13e4de.zip
Merge pull request #39 from hagbard-01/current
T790: wireguard: add status commands
-rw-r--r--Makefile1
-rw-r--r--op-mode-definitions/wireguard.xml34
2 files changed, 35 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 70101181d..b626bbd8b 100644
--- a/Makefile
+++ b/Makefile
@@ -26,6 +26,7 @@ op_mode_definitions:
# XXX: delete top level op mode node.def's that now live in other packages
rm -f $(OP_TMPL_DIR)/set/node.def
rm -f $(OP_TMPL_DIR)/show/node.def
+ rm -f $(OP_TMPL_DIR)/show/interfaces/node.def
rm -f $(OP_TMPL_DIR)/reset/node.def
rm -f $(OP_TMPL_DIR)/restart/node.def
rm -f $(OP_TMPL_DIR)/monitor/node.def
diff --git a/op-mode-definitions/wireguard.xml b/op-mode-definitions/wireguard.xml
index 29fce33b6..a7e156d8d 100644
--- a/op-mode-definitions/wireguard.xml
+++ b/op-mode-definitions/wireguard.xml
@@ -36,6 +36,40 @@
</leafNode>
</children>
</node>
+ <node name="interfaces">
+ <children>
+ <tagNode name="wireguard">
+ <properties>
+ <help>show wireguard interface information</help>
+ <completionHelp>
+ <script>${vyos_completion_dir}/list_interfaces.py -t wireguard</script>
+ </completionHelp>
+ </properties>
+ <command>sudo wg show "$4"</command>
+ <children>
+ <leafNode name="allowed-ips">
+ <properties>
+ <help>show all allowed-ips for the specified interface</help>
+ </properties>
+ <command>sudo wg show "$4" allowed-ips</command>
+ </leafNode>
+ <leafNode name="endpoints">
+ <properties>
+ <help>show all endpoints for the specified interface</help>
+ </properties>
+ <command>sudo wg show "$4" endpoints</command>
+ </leafNode>
+ <leafNode name="peers">
+ <properties>
+ <help>show all peer IDs for the specified interface</help>
+ </properties>
+ <command>sudo wg show "$4" peers</command>
+ </leafNode>
+ <!-- more commands upon request -->
+ </children>
+ </tagNode>
+ </children>
+ </node>
</children>
</node>
</interfaceDefinition>