summaryrefslogtreecommitdiff
path: root/interface-definitions/include
diff options
context:
space:
mode:
authorcblackburn-igl <chris.blackburn@infinitivegroup.co.uk>2025-10-28 15:38:43 +0000
committerGitHub <noreply@github.com>2025-10-28 15:38:43 +0000
commit1737b16dd87778358266222e2ef061eb15d63019 (patch)
tree0e127460ae080ad35a06b4e719d261ab3f7a1805 /interface-definitions/include
parentecc4c85b799047f51e4a32ae5b0590017a6ce374 (diff)
downloadvyos-1x-1737b16dd87778358266222e2ef061eb15d63019.tar.gz
vyos-1x-1737b16dd87778358266222e2ef061eb15d63019.zip
dhcp-server: T3936: Added support for DHCP Option 82 (#4665)
* dhcp-server: T3936: Added support for DHCP Option 82 This commit adds support in both the CLI and the underlying code for DHCP Option 82 to be used to filter/route DHCP address assignments. The primary use case for this is to support enterprise switches which can "tag" DHCP requests with physical real world informaiton such as which switch first saw the request and which port it originated from (known in this context as remote-id and circuit-id). Once client-classes have been defined they can be assigned to subnets or ranges so that only certain addresses get assigned to specific requests. There is also a corresponding documentation update which pairs with this code change. (cherry picked from commit 326b5e713cb363a2b9f69e2204c4ee2ccd9939bb) * Update src/conf_mode/service_dhcp-server.py Co-authored-by: Nataliia S. <81954790+natali-rs1985@users.noreply.github.com> * Update src/conf_mode/service_dhcp-server.py Co-authored-by: Nataliia S. <81954790+natali-rs1985@users.noreply.github.com> * Update interface-definitions/include/dhcp/dhcp-server-common-config.xml.i Co-authored-by: Nataliia S. <81954790+natali-rs1985@users.noreply.github.com> --------- Co-authored-by: Daniil Baturin <daniil@baturin.org> Co-authored-by: Nataliia S. <81954790+natali-rs1985@users.noreply.github.com>
Diffstat (limited to 'interface-definitions/include')
-rw-r--r--interface-definitions/include/dhcp/dhcp-server-common-config.xml.i61
1 files changed, 61 insertions, 0 deletions
diff --git a/interface-definitions/include/dhcp/dhcp-server-common-config.xml.i b/interface-definitions/include/dhcp/dhcp-server-common-config.xml.i
index 4dacb02af..c52a6e043 100644
--- a/interface-definitions/include/dhcp/dhcp-server-common-config.xml.i
+++ b/interface-definitions/include/dhcp/dhcp-server-common-config.xml.i
@@ -1,4 +1,49 @@
<!-- include start from dhcp/dhcp-server-common-config.xml.i -->
+<tagNode name="client-class">
+ <properties>
+ <help>Client class name</help>
+ <constraint>
+ #include <include/constraint/alpha-numeric-hyphen-underscore-dot.xml.i>
+ </constraint>
+ <constraintErrorMessage>Client class name may only contain letters, numbers, dots, underscores, and hyphens</constraintErrorMessage>
+ </properties>
+ <children>
+ #include <include/generic-disable-node.xml.i>
+ <node name="relay-agent-information">
+ <properties>
+ <help>Match DHCP Option 82 (relay agent information)</help>
+ </properties>
+ <children>
+ <leafNode name="circuit-id">
+ <properties>
+ <help>Filters on the contents of the circuit-id sub option</help>
+ <valueHelp>
+ <format>hex</format>
+ <description>Values that start with 0x are interpreted as raw hex. This must only be hexadecimal characters e.g. 0x1234567890ABCDEF</description>
+ </valueHelp>
+ <valueHelp>
+ <format>txt</format>
+ <description>Any other text string is interpreted as ASCII text</description>
+ </valueHelp>
+ </properties>
+ </leafNode>
+ <leafNode name="remote-id">
+ <properties>
+ <help>Filters on the contents of the remote-id sub option</help>
+ <valueHelp>
+ <format>hex</format>
+ <description>Values that start with 0x are interpreted as raw hex. This must only be hexadecimal characters e.g. 0x1234567890ABCDEF</description>
+ </valueHelp>
+ <valueHelp>
+ <format>txt</format>
+ <description>Any other text string is interpreted as ASCII text</description>
+ </valueHelp>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
+ </children>
+</tagNode>
#include <include/generic-disable-node.xml.i>
<node name="dynamic-dns-update">
<properties>
@@ -229,6 +274,14 @@
#include <include/dhcp/ping-check.xml.i>
#include <include/generic-description.xml.i>
#include <include/generic-disable-node.xml.i>
+ <leafNode name="client-class">
+ <properties>
+ <help>DHCP client class</help>
+ <completionHelp>
+ <path>service dhcp-server client-class</path>
+ </completionHelp>
+ </properties>
+ </leafNode>
<node name="dynamic-dns-update">
<properties>
<help>Dynamically update Domain Name System (RFC4702)</help>
@@ -280,6 +333,14 @@
</properties>
<children>
#include <include/dhcp/option-v4.xml.i>
+ <leafNode name="client-class">
+ <properties>
+ <help>DHCP client class</help>
+ <completionHelp>
+ <path>service dhcp-server client-class</path>
+ </completionHelp>
+ </properties>
+ </leafNode>
<leafNode name="start">
<properties>
<help>First IP address for DHCP lease range</help>