summaryrefslogtreecommitdiff
path: root/op-mode-definitions/wireguard.xml.in
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-04-24 16:52:18 +0200
committerChristian Poessinger <christian@poessinger.com>2021-04-24 16:53:39 +0200
commit92d62740a1dd84d27ed3006cdc8d2560673f6bca (patch)
tree742c7a067189c06c640a50d9b01425207b690240 /op-mode-definitions/wireguard.xml.in
parentdee472989751055772d3efeacb38c559a7215fdc (diff)
downloadvyos-1x-92d62740a1dd84d27ed3006cdc8d2560673f6bca.tar.gz
vyos-1x-92d62740a1dd84d27ed3006cdc8d2560673f6bca.zip
wireguard: T1802: generate QR code for clients on CLI
generate wireguard mobile-config wg0 server wg.vyos.net address 1.2.2.2/24 WireGuard client configuration for interface: wg0 [Interface] PrivateKey = AEXrZ4b3xFVLg1lql3hy/93+d43q3+3vPdSMUGI6/Fo= Address = 1.2.2.2/24 [Peer] PublicKey = h1HkYlSuHdJN6Qv4Hz4bBzjGg5WUty+U1L7DJsZy1iE= Endpoint = wg.vyos.net:41751 AllowedIPs = 0.0.0.0/0, ::/0 The servers public key and port are automatically extracter from the running config.
Diffstat (limited to 'op-mode-definitions/wireguard.xml.in')
-rw-r--r--op-mode-definitions/wireguard.xml.in34
1 files changed, 33 insertions, 1 deletions
diff --git a/op-mode-definitions/wireguard.xml.in b/op-mode-definitions/wireguard.xml.in
index 4aee4b1ac..1e9801252 100644
--- a/op-mode-definitions/wireguard.xml.in
+++ b/op-mode-definitions/wireguard.xml.in
@@ -26,6 +26,38 @@
</properties>
<command>sudo ${vyos_op_scripts_dir}/wireguard.py --genkey --location "$4"</command>
</tagNode>
+ <tagNode name="mobile-config">
+ <properties>
+ <help>Generate QR code and movile configuration for Wireguard interface</help>
+ <completionHelp>
+ <script>${vyos_completion_dir}/list_interfaces.py --type wireguard</script>
+ </completionHelp>
+ </properties>
+ <children>
+ <tagNode name="server">
+ <properties>
+ <help>IP address or FQDN the client will connect to</help>
+ <completionHelp>
+ <script>${vyos_completion_dir}/list_local_ips.sh --both</script>
+ <list>&lt;hostname&gt;</list>
+ </completionHelp>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/wireguard_client.py --interface "$4" --server "$6"</command>
+ <children>
+ <tagNode name="address">
+ <properties>
+ <help>IPv4/IPv6 address used on the client side</help>
+ <completionHelp>
+ <script>${vyos_completion_dir}/list_local_ips.sh --both</script>
+ <list>&lt;hostname&gt;</list>
+ </completionHelp>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/wireguard_client.py --interface "$4" --server "$6" --address "$8"</command>
+ </tagNode>
+ </children>
+ </tagNode>
+ </children>
+ </tagNode>
</children>
</node>
</children>
@@ -73,7 +105,7 @@
<script>${vyos_completion_dir}/list_interfaces.py --type wireguard</script>
</completionHelp>
</properties>
- <command>sudo ${vyos_op_scripts_dir}/wireguard.py --showinterface "$4"</command>
+ <command>sudo ${vyos_op_scripts_dir}/wireguard.py --showinterface "$4"</command>
<children>
<leafNode name="allowed-ips">
<properties>