summaryrefslogtreecommitdiff
path: root/op-mode-definitions
diff options
context:
space:
mode:
Diffstat (limited to 'op-mode-definitions')
-rw-r--r--op-mode-definitions/dhcp.xml111
-rw-r--r--op-mode-definitions/force-arp.xml79
-rw-r--r--op-mode-definitions/poweroff.xml4
-rw-r--r--op-mode-definitions/reboot.xml4
-rw-r--r--op-mode-definitions/show-bridge.xml6
-rw-r--r--op-mode-definitions/show-systemintegrity.xml14
-rw-r--r--op-mode-definitions/terminal.xml29
-rw-r--r--op-mode-definitions/traffic-dump.xml8
-rw-r--r--op-mode-definitions/wireguard.xml49
9 files changed, 290 insertions, 14 deletions
diff --git a/op-mode-definitions/dhcp.xml b/op-mode-definitions/dhcp.xml
new file mode 100644
index 000000000..eb57f8f1f
--- /dev/null
+++ b/op-mode-definitions/dhcp.xml
@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interfaceDefinition>
+ <node name="show">
+ <children>
+ <node name="dhcp">
+ <properties>
+ <help>Show DHCP (Dynamic Host Configuration Protocol) information</help>
+ </properties>
+ <children>
+ <node name="server">
+ <properties>
+ <help>Show DHCP information</help>
+ </properties>
+ <children>
+ <node name="leases">
+ <properties>
+ <help>Show DHCP server leases</help>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/show_dhcp.py --leases</command>
+ <children>
+ <tagNode name="pool">
+ <properties>
+ <help>Show DHCP leases for a specific pool</help>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/show_dhcp.py --leases --pool $4</command>
+ </tagNode>
+ </children>
+ </node>
+ <node name="statistics">
+ <properties>
+ <help>Show DHCP server statistics</help>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/show_dhcp.py --statistics</command>
+ <children>
+ <tagNode name="pool">
+ <properties>
+ <help>Show DHCP server statistics for a specific pool</help>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/show_dhcp.py --statistics --pool $4</command>
+ </tagNode>
+ </children>
+ </node>
+ </children>
+ </node>
+ </children>
+ </node>
+ <node name="dhcpv6">
+ <properties>
+ <help>Show DHCPv6 (IPv6 Dynamic Host Configuration Protocol) information</help>
+ </properties>
+ <children>
+ <node name="server">
+ <properties>
+ <help>Show DHCPv6 server information</help>
+ </properties>
+ <children>
+ <node name="leases">
+ <properties>
+ <help>Show DHCPv6 server leases</help>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/show_dhcpv6.py --leases</command>
+ </node>
+ </children>
+ </node>
+ </children>
+ </node>
+ </children>
+ </node>
+ <node name="restart">
+ <children>
+ <node name="dhcp">
+ <properties>
+ <help>Restart DHCP processes</help>
+ </properties>
+ <children>
+ <node name="server">
+ <properties>
+ <help>Restart the DHCP server process</help>
+ </properties>
+ <command>sudo systemctl restart isc-dhcp-server.service</command>
+ </node>
+ <node name="relay-agent">
+ <properties>
+ <help>Restart the DHCP server process</help>
+ </properties>
+ <command>sudo /opt/vyatta/sbin/dhcrelay-starter.pl --op-mode --init='/opt/vyatta/sbin/dhcrelay.init'</command>
+ </node>
+ </children>
+ </node>
+ <node name="dhcpv6">
+ <properties>
+ <help>Restart DHCPv6 processes</help>
+ </properties>
+ <children>
+ <node name="server">
+ <properties>
+ <help>Restart the DHCPv6 server process</help>
+ </properties>
+ <command>sudo systemctl restart isc-dhcpv6-server.service</command>
+ </node>
+ <node name="relay-agent">
+ <properties>
+ <help>Restart the DHCP server process</help>
+ </properties>
+ <command>sudo /opt/vyatta/sbin/dhcv6relay-starter.pl --op_mode --config_action ACTIVE</command>
+ </node>
+ </children>
+ </node>
+ </children>
+ </node>
+</interfaceDefinition>
diff --git a/op-mode-definitions/force-arp.xml b/op-mode-definitions/force-arp.xml
new file mode 100644
index 000000000..3eadabf0a
--- /dev/null
+++ b/op-mode-definitions/force-arp.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0"?>
+<interfaceDefinition>
+ <node name="force">
+ <properties>
+ <help>Force an operation</help>
+ </properties>
+ <children>
+ <node name="arp">
+ <properties>
+ <help>Send gratuitous ARP request or reply</help>
+ </properties>
+ <children>
+ <node name="reply">
+ <properties>
+ <help>Send gratuitous ARP reply</help>
+ </properties>
+ <children>
+ <tagNode name="interface">
+ <properties>
+ <help>Send gratuitous ARP reply on specified interface</help>
+ <completionHelp>
+ <script>${vyos_completion_dir}/list_interfaces.py --broadcast</script>
+ </completionHelp>
+ </properties>
+ <children>
+ <tagNode name="address">
+ <properties>
+ <help>Send gratuitous ARP reply for specified address</help>
+ </properties>
+ <command>sudo arping -I $5 -c 1 -A $7</command>
+ <children>
+ <tagNode name="count">
+ <properties>
+ <help>Send specified number of ARP replies</help>
+ </properties>
+ <command>sudo arping -I $5 -c $9 -A $7</command>
+ </tagNode>
+ </children>
+ </tagNode>
+ </children>
+ </tagNode>
+ </children>
+ </node>
+ <node name="request">
+ <properties>
+ <help>Send gratuitous ARP request</help>
+ </properties>
+ <children>
+ <tagNode name="interface">
+ <properties>
+ <help>Send gratuitous ARP request on specified interface</help>
+ <completionHelp>
+ <script>${vyos_completion_dir}/list_interfaces.py --broadcast</script>
+ </completionHelp>
+ </properties>
+ <children>
+ <tagNode name="address">
+ <properties>
+ <help>Send gratuitous ARP request for specified address</help>
+ </properties>
+ <command>sudo arping -I $5 -c 1 -U $7</command>
+ <children>
+ <tagNode name="count">
+ <properties>
+ <help>Send specified number of ARP requests</help>
+ </properties>
+ <command>sudo arping -I $5 -c $9 -U $7</command>
+ </tagNode>
+ </children>
+ </tagNode>
+ </children>
+ </tagNode>
+ </children>
+ </node>
+ </children>
+ </node>
+ </children>
+ </node>
+</interfaceDefinition>
diff --git a/op-mode-definitions/poweroff.xml b/op-mode-definitions/poweroff.xml
index ff27f4f4d..e2483fefc 100644
--- a/op-mode-definitions/poweroff.xml
+++ b/op-mode-definitions/poweroff.xml
@@ -4,14 +4,14 @@
<properties>
<help>Poweroff the system</help>
</properties>
- <command>sudo ${vyos_op_scripts_dir}/powerctrl.py --poweroff now</command>
+ <command>sudo ${vyos_op_scripts_dir}/powerctrl.py --poweroff</command>
<children>
<leafNode name="now">
<properties>
<help>Poweroff the system without confirmation</help>
</properties>
- <command>sudo ${vyos_op_scripts_dir}/powerctrl.py --yes --poweroff now</command>
+ <command>sudo ${vyos_op_scripts_dir}/powerctrl.py --yes --poweroff</command>
</leafNode>
<leafNode name="cancel">
diff --git a/op-mode-definitions/reboot.xml b/op-mode-definitions/reboot.xml
index 340c8ca82..affdffd98 100644
--- a/op-mode-definitions/reboot.xml
+++ b/op-mode-definitions/reboot.xml
@@ -4,14 +4,14 @@
<properties>
<help>Reboot the system</help>
</properties>
- <command>sudo ${vyos_op_scripts_dir}/powerctrl.py --reboot now</command>
+ <command>sudo ${vyos_op_scripts_dir}/powerctrl.py --reboot</command>
<children>
<leafNode name="now">
<properties>
<help>Reboot the system without confirmation</help>
</properties>
- <command>sudo ${vyos_op_scripts_dir}/powerctrl.py --yes --reboot now</command>
+ <command>sudo ${vyos_op_scripts_dir}/powerctrl.py --yes --reboot</command>
</leafNode>
<leafNode name="cancel">
diff --git a/op-mode-definitions/show-bridge.xml b/op-mode-definitions/show-bridge.xml
index a3241951a..b285e2288 100644
--- a/op-mode-definitions/show-bridge.xml
+++ b/op-mode-definitions/show-bridge.xml
@@ -15,19 +15,19 @@
<script>${vyos_completion_dir}/list_interfaces.py --type bridge</script>
</completionHelp>
</properties>
- <command>/sbin/brctl show '$3'</command>
+ <command>/sbin/brctl show $3</command>
<children>
<leafNode name="macs">
<properties>
<help>Show bridge Media Access Control (MAC) address table</help>
</properties>
- <command>/sbin/brctl showmacs '$3'</command>
+ <command>/sbin/brctl showmacs $3</command>
</leafNode>
<leafNode name="spanning-tree">
<properties>
<help>Show bridge spanning tree information</help>
</properties>
- <command>/sbin/brctl showstp '$3'</command>
+ <command>/sbin/brctl showstp $3</command>
</leafNode>
</children>
</tagNode>
diff --git a/op-mode-definitions/show-systemintegrity.xml b/op-mode-definitions/show-systemintegrity.xml
new file mode 100644
index 000000000..44b5faf68
--- /dev/null
+++ b/op-mode-definitions/show-systemintegrity.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0"?>
+
+<interfaceDefinition>
+ <node name="show">
+ <children>
+ <leafNode name= "system-integrity">
+ <properties>
+ <help>checks the integrity of the system</help>
+ </properties>
+ <command>sudo ${vyos_op_scripts_dir}/system_integrity.py</command>
+ </leafNode>
+ </children>
+ </node>
+</interfaceDefinition>
diff --git a/op-mode-definitions/terminal.xml b/op-mode-definitions/terminal.xml
new file mode 100644
index 000000000..db74f867e
--- /dev/null
+++ b/op-mode-definitions/terminal.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<interfaceDefinition>
+ <node name="clear">
+ <properties>
+ <help>Clear system information</help>
+ </properties>
+ <children>
+ <node name="console">
+ <properties>
+ <help>Clear screen</help>
+ </properties>
+ <command>/usr/bin/clear</command>
+ </node>
+ </children>
+ </node>
+ <node name="reset">
+ <properties>
+ <help>Reset a service</help>
+ </properties>
+ <children>
+ <node name="terminal">
+ <properties>
+ <help>Reset terminal</help>
+ </properties>
+ <command>/usr/bin/reset</command>
+ </node>
+ </children>
+ </node>
+</interfaceDefinition>
diff --git a/op-mode-definitions/traffic-dump.xml b/op-mode-definitions/traffic-dump.xml
index a6810644e..6d86f7423 100644
--- a/op-mode-definitions/traffic-dump.xml
+++ b/op-mode-definitions/traffic-dump.xml
@@ -8,7 +8,7 @@
</properties>
<children>
<tagNode name="interface">
- <command>tcpdump -i $4</command>
+ <command>sudo tcpdump -i $4</command>
<properties>
<help>Monitor traffic dump from an interface</help>
<completionHelp>
@@ -17,19 +17,19 @@
</properties>
<children>
<tagNode name="filter">
- <command>tcpdump -n -i $4 $6</command>
+ <command>sudo tcpdump -n -i $4 "${@:6}"</command>
<properties>
<help>Monitor traffic matching filter conditions</help>
</properties>
</tagNode>
<tagNode name="save">
- <command>tcpdump -n -i $4 -w $6</command>
+ <command>sudo tcpdump -n -i $4 -w $6</command>
<properties>
<help>Save traffic dump from an interface to a file</help>
</properties>
<children>
<tagNode name="filter">
- <command>tcpdump -n -i $4 -w $6 $8</command>
+ <command>sudo tcpdump -n -i $4 -w $6 "${@:8}"</command>
<properties>
<help>Save a dump of traffic matching filter conditions to a file</help>
</properties>
diff --git a/op-mode-definitions/wireguard.xml b/op-mode-definitions/wireguard.xml
index 29fce33b6..681bb5f47 100644
--- a/op-mode-definitions/wireguard.xml
+++ b/op-mode-definitions/wireguard.xml
@@ -12,8 +12,14 @@
<properties>
<help>generate a wireguard keypair</help>
</properties>
- <command>${vyos_op_scripts_dir}/wireguard_key.py --genkey</command>
+ <command>${vyos_op_scripts_dir}/wireguard.py --genkey</command>
</leafNode>
+ <leafNode name="preshared-key">
+ <properties>
+ <help>generate a wireguard preshared key</help>
+ </properties>
+ <command>${vyos_op_scripts_dir}/wireguard.py --genpsk</command>
+ </leafNode>
</children>
</node>
</children>
@@ -21,21 +27,58 @@
<node name="show">
<children>
<node name="wireguard">
+ <properties>
+ <help>Show wireguard properties</help>
+ </properties>
<children>
<leafNode name="pubkey">
<properties>
<help>show wireguard public key</help>
</properties>
- <command>${vyos_op_scripts_dir}/wireguard_key.py --showpub</command>
+ <command>${vyos_op_scripts_dir}/wireguard.py --showpub</command>
</leafNode>
<leafNode name="privkey">
<properties>
<help>show wireguard private key</help>
</properties>
- <command>${vyos_op_scripts_dir}/wireguard_key.py --showpriv</command>
+ <command>${vyos_op_scripts_dir}/wireguard.py --showpriv</command>
</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>