summaryrefslogtreecommitdiff
path: root/op-mode-definitions
diff options
context:
space:
mode:
authorDavid Vølker <david@voelker.dk>2025-08-15 09:31:49 +0200
committerDavid Vølker <david@voelker.dk>2025-08-15 09:31:49 +0200
commit974f9a5d5e13241e2b4ea54152bf835db6b7feff (patch)
treeb816d2c6c6bea3e670f44e880f32b10d311d353e /op-mode-definitions
parent862817a7207c5b5d17c67451bac602d296b88230 (diff)
downloadvyos-1x-974f9a5d5e13241e2b4ea54152bf835db6b7feff.tar.gz
vyos-1x-974f9a5d5e13241e2b4ea54152bf835db6b7feff.zip
kea: T6211: add VRF support for KEA dhcp server
Diffstat (limited to 'op-mode-definitions')
-rw-r--r--op-mode-definitions/dhcp.xml.in277
-rw-r--r--op-mode-definitions/monitor-log.xml.in16
-rwxr-xr-xop-mode-definitions/show-log.xml.in16
3 files changed, 290 insertions, 19 deletions
diff --git a/op-mode-definitions/dhcp.xml.in b/op-mode-definitions/dhcp.xml.in
index 2da3bb5dc..da14359f2 100644
--- a/op-mode-definitions/dhcp.xml.in
+++ b/op-mode-definitions/dhcp.xml.in
@@ -13,6 +13,22 @@
</properties>
<command>${vyos_op_scripts_dir}/dhcp.py clear_dhcp_server_lease --family inet --address $4</command>
</tagNode>
+ <tagNode name="vrf">
+ <properties>
+ <help>Clear DHCP server lease for vrf</help>
+ <completionHelp>
+ <path>vrf name</path>
+ </completionHelp>
+ </properties>
+ <children>
+ <tagNode name="lease">
+ <properties>
+ <help>DHCP server lease</help>
+ </properties>
+ <command>${vyos_op_scripts_dir}/dhcp.py clear_dhcp_server_lease --family inet --vrf $4 --address $6</command>
+ </tagNode>
+ </children>
+ </tagNode>
</children>
</node>
<node name="dhcpv6-server">
@@ -26,6 +42,22 @@
</properties>
<command>${vyos_op_scripts_dir}/dhcp.py clear_dhcp_server_lease --family inet6 --address $4</command>
</tagNode>
+ <tagNode name="vrf">
+ <properties>
+ <help>Clear DHCPv6 server lease for vrf</help>
+ <completionHelp>
+ <path>vrf name</path>
+ </completionHelp>
+ </properties>
+ <children>
+ <tagNode name="lease">
+ <properties>
+ <help>DHCPv6 server lease</help>
+ </properties>
+ <command>${vyos_op_scripts_dir}/dhcp.py clear_dhcp_server_lease --family inet6 --vrf $4 --address $6</command>
+ </tagNode>
+ </children>
+ </tagNode>
</children>
</node>
</children>
@@ -70,7 +102,7 @@
<properties>
<help>Show DHCP server leases</help>
</properties>
- <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet</command>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --vrf ''</command>
<children>
<tagNode name="origin">
<properties>
@@ -79,7 +111,7 @@
<list>local remote</list>
</completionHelp>
</properties>
- <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --origin $6</command>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --vrf '' --origin $6</command>
</tagNode>
<tagNode name="pool">
<properties>
@@ -88,7 +120,7 @@
<path>service dhcp-server shared-network-name</path>
</completionHelp>
</properties>
- <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --pool $6</command>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --vrf '' --pool $6</command>
</tagNode>
<tagNode name="sort">
<properties>
@@ -97,7 +129,7 @@
<list>end hostname ip mac pool remaining start state</list>
</completionHelp>
</properties>
- <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --sort $6</command>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --vrf '' --sort $6</command>
</tagNode>
<tagNode name="state">
<properties>
@@ -106,7 +138,7 @@
<list>abandoned active all backup expired free released reset</list>
</completionHelp>
</properties>
- <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --state $6</command>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --vrf '' --state $6</command>
</tagNode>
</children>
</node>
@@ -114,7 +146,7 @@
<properties>
<help>Show DHCP server static mappings</help>
</properties>
- <command>${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet</command>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet --vrf ''</command>
<children>
<tagNode name="pool">
<properties>
@@ -123,7 +155,7 @@
<path>service dhcp-server shared-network-name</path>
</completionHelp>
</properties>
- <command>${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet --pool $6</command>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet --vrf '' --pool $6</command>
</tagNode>
<tagNode name="sort">
<properties>
@@ -132,7 +164,7 @@
<list>ip mac duid pool</list>
</completionHelp>
</properties>
- <command>${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet --sort $6</command>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet --vrf '' --sort $6</command>
</tagNode>
</children>
</node>
@@ -140,7 +172,7 @@
<properties>
<help>Show DHCP server statistics</help>
</properties>
- <command>${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet</command>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet --vrf ''</command>
<children>
<tagNode name="pool">
<properties>
@@ -149,10 +181,107 @@
<path>service dhcp-server shared-network-name</path>
</completionHelp>
</properties>
- <command>${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet --pool $6</command>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet --vrf '' --pool $6</command>
</tagNode>
</children>
</node>
+ <tagNode name="vrf">
+ <properties>
+ <help>Show DHCP (Dynamic Host Configuration Protocol) information for vrf</help>
+ <completionHelp>
+ <path>vrf name</path>
+ </completionHelp>
+ </properties>
+ <children>
+ <node name="leases">
+ <properties>
+ <help>Show DHCP server leases</help>
+ </properties>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --vrf $5</command>
+ <children>
+ <tagNode name="origin">
+ <properties>
+ <help>Show DHCP server leases granted by local or remote DHCP server</help>
+ <completionHelp>
+ <list>local remote</list>
+ </completionHelp>
+ </properties>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --vrf $5 --origin $8</command>
+ </tagNode>
+ <tagNode name="pool">
+ <properties>
+ <help>Show DHCP server leases for a specific pool</help>
+ <completionHelp>
+ <path>service dhcp-server shared-network-name</path>
+ </completionHelp>
+ </properties>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --vrf $5 --pool $8</command>
+ </tagNode>
+ <tagNode name="sort">
+ <properties>
+ <help>Show DHCP server leases sorted by the specified key</help>
+ <completionHelp>
+ <list>end hostname ip mac pool remaining start state</list>
+ </completionHelp>
+ </properties>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --vrf $5 --sort $8</command>
+ </tagNode>
+ <tagNode name="state">
+ <properties>
+ <help>Show DHCP server leases with a specific state (can be multiple, comma-separated)</help>
+ <completionHelp>
+ <list>abandoned active all backup expired free released reset</list>
+ </completionHelp>
+ </properties>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet --vrf $5 --state $8</command>
+ </tagNode>
+ </children>
+ </node>
+ <node name="static-mappings">
+ <properties>
+ <help>Show DHCP server static mappings</help>
+ </properties>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet --vrf $5</command>
+ <children>
+ <tagNode name="pool">
+ <properties>
+ <help>Show DHCP server static mappings for a specific pool</help>
+ <completionHelp>
+ <path>service dhcp-server shared-network-name</path>
+ </completionHelp>
+ </properties>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet --vrf $5 --pool $8</command>
+ </tagNode>
+ <tagNode name="sort">
+ <properties>
+ <help>Show DHCP server static mappings sorted by the specified key</help>
+ <completionHelp>
+ <list>ip mac duid pool</list>
+ </completionHelp>
+ </properties>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet --vrf $5 --sort $8</command>
+ </tagNode>
+ </children>
+ </node>
+ <node name="statistics">
+ <properties>
+ <help>Show DHCP server statistics</help>
+ </properties>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet --vrf $5</command>
+ <children>
+ <tagNode name="pool">
+ <properties>
+ <help>Show DHCP server statistics for a specific pool</help>
+ <completionHelp>
+ <path>service dhcp-server shared-network-name</path>
+ </completionHelp>
+ </properties>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet --vrf $5 --pool $8</command>
+ </tagNode>
+ </children>
+ </node>
+ </children>
+ </tagNode>
</children>
</node>
</children>
@@ -171,7 +300,7 @@
<properties>
<help>Show DHCPv6 server leases</help>
</properties>
- <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6</command>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 --vrf ''</command>
<children>
<tagNode name="pool">
<properties>
@@ -180,7 +309,7 @@
<path>service dhcpv6-server shared-network-name</path>
</completionHelp>
</properties>
- <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 --pool $6</command>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 --vrf '' --pool $6</command>
</tagNode>
<tagNode name="sort">
<properties>
@@ -189,7 +318,7 @@
<list>end duid ip last_communication pool remaining state type</list>
</completionHelp>
</properties>
- <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 --sort $6</command>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 --vrf '' --sort $6</command>
</tagNode>
<tagNode name="state">
<properties>
@@ -198,7 +327,7 @@
<list>abandoned active all backup expired free released reset</list>
</completionHelp>
</properties>
- <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 --state $6</command>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 --vrf '' --state $6</command>
</tagNode>
</children>
</node>
@@ -206,7 +335,7 @@
<properties>
<help>Show DHCPv6 server static mappings</help>
</properties>
- <command>${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet6</command>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet6 --vrf ''</command>
<children>
<tagNode name="pool">
<properties>
@@ -215,7 +344,7 @@
<path>service dhcp-server shared-network-name</path>
</completionHelp>
</properties>
- <command>${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet6 --pool $6</command>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet6 --vrf '' --pool $6</command>
</tagNode>
<tagNode name="sort">
<properties>
@@ -224,7 +353,7 @@
<list>ip mac duid pool</list>
</completionHelp>
</properties>
- <command>${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet6 --sort $6</command>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet6 --vrf '' --sort $6</command>
</tagNode>
</children>
</node>
@@ -232,7 +361,7 @@
<properties>
<help>Show DHCPv6 server statistics</help>
</properties>
- <command>${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet6</command>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet6 --vrf ''</command>
<children>
<tagNode name="pool">
<properties>
@@ -241,10 +370,98 @@
<path>service dhcpv6-server shared-network-name</path>
</completionHelp>
</properties>
- <command>${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet6 --pool $6</command>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet6 --vrf '' --pool $6</command>
</tagNode>
</children>
</node>
+ <tagNode name="vrf">
+ <properties>
+ <help>Show DHCPv6 (IPv6 Dynamic Host Configuration Protocol) information for vrf</help>
+ <completionHelp>
+ <path>vrf name</path>
+ </completionHelp>
+ </properties>
+ <children>
+ <node name="leases">
+ <properties>
+ <help>Show DHCPv6 server leases</help>
+ </properties>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 --vrf $5</command>
+ <children>
+ <tagNode name="pool">
+ <properties>
+ <help>Show DHCPv6 server leases for a specific pool</help>
+ <completionHelp>
+ <path>service dhcpv6-server shared-network-name</path>
+ </completionHelp>
+ </properties>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 --vrf $5 --pool $8</command>
+ </tagNode>
+ <tagNode name="sort">
+ <properties>
+ <help>Show DHCPv6 server leases sorted by the specified key</help>
+ <completionHelp>
+ <list>end duid ip last_communication pool remaining state type</list>
+ </completionHelp>
+ </properties>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 --vrf $5 --sort $8</command>
+ </tagNode>
+ <tagNode name="state">
+ <properties>
+ <help>Show DHCPv6 server leases with a specific state (can be multiple, comma-separated)</help>
+ <completionHelp>
+ <list>abandoned active all backup expired free released reset</list>
+ </completionHelp>
+ </properties>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_leases --family inet6 --vrf $5 --state $8</command>
+ </tagNode>
+ </children>
+ </node>
+ <node name="static-mappings">
+ <properties>
+ <help>Show DHCPv6 server static mappings</help>
+ </properties>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet6 --vrf $5</command>
+ <children>
+ <tagNode name="pool">
+ <properties>
+ <help>Show DHCPv6 server static mappings for a specific pool</help>
+ <completionHelp>
+ <path>service dhcp-server shared-network-name</path>
+ </completionHelp>
+ </properties>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet6 --vrf $5 --pool $8</command>
+ </tagNode>
+ <tagNode name="sort">
+ <properties>
+ <help>Show DHCPv6 server static mappings sorted by the specified key</help>
+ <completionHelp>
+ <list>ip mac duid pool</list>
+ </completionHelp>
+ </properties>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_static_mappings --family inet6 --vrf $5 --sort $8</command>
+ </tagNode>
+ </children>
+ </node>
+ <node name="statistics">
+ <properties>
+ <help>Show DHCPv6 server statistics</help>
+ </properties>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet6 --vrf $5</command>
+ <children>
+ <tagNode name="pool">
+ <properties>
+ <help>Show DHCPv6 server statistics for a specific pool</help>
+ <completionHelp>
+ <path>service dhcpv6-server shared-network-name</path>
+ </completionHelp>
+ </properties>
+ <command>${vyos_op_scripts_dir}/dhcp.py show_server_pool_statistics --family inet6 --vrf $5 --pool $8</command>
+ </tagNode>
+ </children>
+ </node>
+ </children>
+ </tagNode>
</children>
</node>
</children>
@@ -263,6 +480,17 @@
<help>Restart DHCP server</help>
</properties>
<command>${vyos_op_scripts_dir}/restart.py restart_service --name dhcp</command>
+ <children>
+ <tagNode name="vrf">
+ <properties>
+ <help>Restart DHCP server on vrf</help>
+ <completionHelp>
+ <path>vrf name</path>
+ </completionHelp>
+ </properties>
+ <command>${vyos_op_scripts_dir}/restart.py restart_service --name dhcp --vrf $5</command>
+ </tagNode>
+ </children>
</node>
<node name="relay-agent">
<properties>
@@ -282,6 +510,17 @@
<help>Restart DHCPv6 server</help>
</properties>
<command>${vyos_op_scripts_dir}/restart.py restart_service --name dhcpv6</command>
+ <children>
+ <tagNode name="vrf">
+ <properties>
+ <help>Restart DHCPv6 server on vrf</help>
+ <completionHelp>
+ <path>vrf name</path>
+ </completionHelp>
+ </properties>
+ <command>${vyos_op_scripts_dir}/restart.py restart_service --name dhcpv6 --vrf $5</command>
+ </tagNode>
+ </children>
</node>
<node name="relay-agent">
<properties>
diff --git a/op-mode-definitions/monitor-log.xml.in b/op-mode-definitions/monitor-log.xml.in
index 721460be5..86c07fb02 100644
--- a/op-mode-definitions/monitor-log.xml.in
+++ b/op-mode-definitions/monitor-log.xml.in
@@ -45,6 +45,14 @@
<help>Monitor last lines of DHCP server log</help>
</properties>
<command>journalctl --no-hostname --follow --boot --unit kea-dhcp4-server.service</command>
+ <children>
+ <tagNode name="vrf">
+ <properties>
+ <help>Monitor last lines of DHCP server log on specific vrf</help>
+ </properties>
+ <command>journalctl --no-hostname --follow --boot --unit "kea-dhcp4-server@$6.service"</command>
+ </tagNode>
+ </children>
</node>
<node name="client">
<properties>
@@ -75,6 +83,14 @@
<help>Monitor last lines of DHCPv6 server log</help>
</properties>
<command>journalctl --no-hostname --follow --boot --unit kea-dhcp6-server.service</command>
+ <children>
+ <tagNode name="vrf">
+ <properties>
+ <help>Monitor last lines of DHCPv6 server log on specific vrf</help>
+ </properties>
+ <command>journalctl --no-hostname --follow --boot --unit "kea-dhcp6-server@$6.service"</command>
+ </tagNode>
+ </children>
</node>
<node name="client">
<properties>
diff --git a/op-mode-definitions/show-log.xml.in b/op-mode-definitions/show-log.xml.in
index 499e7f84b..b301f3401 100755
--- a/op-mode-definitions/show-log.xml.in
+++ b/op-mode-definitions/show-log.xml.in
@@ -105,6 +105,14 @@
<help>Show log for DHCP server</help>
</properties>
<command>journalctl --no-hostname --boot --unit kea-dhcp4-server.service</command>
+ <children>
+ <tagNode name="vrf">
+ <properties>
+ <help>Monitor last lines of DHCP server log on specific vrf</help>
+ </properties>
+ <command>journalctl --no-hostname --follow --boot --unit "kea-dhcp4-server@$6.service"</command>
+ </tagNode>
+ </children>
</node>
<node name="client">
<properties>
@@ -135,6 +143,14 @@
<help>Show log for DHCPv6 server</help>
</properties>
<command>journalctl --no-hostname --boot --unit kea-dhcp6-server.service</command>
+ <children>
+ <tagNode name="vrf">
+ <properties>
+ <help>Monitor last lines of DHCPv6 server log on specific vrf</help>
+ </properties>
+ <command>journalctl --no-hostname --boot --unit "kea-dhcp6-server@$6.service"</command>
+ </tagNode>
+ </children>
</node>
<node name="client">
<properties>