Page MenuHomeVyOS Platform

No OneTemporary

Size
9 KB
Referenced Files
None
Subscribers
None
diff --git a/data/templates/dhcp-client/ipv6.tmpl b/data/templates/dhcp-client/ipv6.tmpl
index 68f668117..49d0d8c88 100644
--- a/data/templates/dhcp-client/ipv6.tmpl
+++ b/data/templates/dhcp-client/ipv6.tmpl
@@ -1,57 +1,60 @@
### Autogenerated by interface.py ###
# man https://www.unix.com/man-page/debian/5/dhcp6c.conf/
interface {{ ifname }} {
{% if address is defined and 'dhcpv6' in address %}
+{% if dhcpv6_options is defined and dhcpv6_options.duid is defined and dhcpv6_options.duid is not none %}
+ send client-id {{ dhcpv6_options.duid }};
+{% endif %}
request domain-name-servers;
request domain-name;
{% if dhcpv6_options is defined and dhcpv6_options.parameters_only is defined %}
information-only;
{% endif %}
{% if dhcpv6_options is not defined or dhcpv6_options.temporary is not defined %}
send ia-na 0; # non-temporary address
{% endif %}
{% if dhcpv6_options is defined and dhcpv6_options.rapid_commit is defined %}
send rapid-commit; # wait for immediate reply instead of advertisements
{% endif %}
{% endif %}
{% if dhcpv6_options is defined and dhcpv6_options.pd is defined %}
{% for pd in dhcpv6_options.pd %}
send ia-pd {{ pd }}; # prefix delegation #{{ pd }}
{% endfor %}
{% endif %}
};
{% if address is defined and 'dhcpv6' in address %}
{% if dhcpv6_options is not defined or dhcpv6_options.temporary is not defined %}
id-assoc na 0 {
# Identity association for non temporary address
};
{% endif %}
{% endif %}
{% if dhcpv6_options is defined and dhcpv6_options.pd is defined %}
{% for pd in dhcpv6_options.pd %}
id-assoc pd {{ pd }} {
{# length got a default value #}
prefix ::/{{ dhcpv6_options.pd[pd].length }} infinity;
{% set sla_len = 64 - dhcpv6_options.pd[pd].length|int %}
{% set count = namespace(value=0) %}
{% for interface in dhcpv6_options.pd[pd].interface if dhcpv6_options.pd[pd].interface is defined %}
prefix-interface {{ interface }} {
sla-len {{ sla_len }};
{% if dhcpv6_options.pd[pd].interface[interface].sla_id is defined and dhcpv6_options.pd[pd].interface[interface].sla_id is not none %}
sla-id {{ dhcpv6_options.pd[pd].interface[interface].sla_id }};
{% else %}
sla-id {{ count.value }};
{% endif %}
{% if dhcpv6_options.pd[pd].interface[interface].address is defined and dhcpv6_options.pd[pd].interface[interface].address is not none %}
ifid {{ dhcpv6_options.pd[pd].interface[interface].address }};
{% endif %}
};
{% set count.value = count.value + 1 %}
{% endfor %}
};
{% endfor %}
{% endif %}
diff --git a/interface-definitions/include/dhcpv6-options.xml.i b/interface-definitions/include/dhcpv6-options.xml.i
index 9a1016956..33ba39592 100644
--- a/interface-definitions/include/dhcpv6-options.xml.i
+++ b/interface-definitions/include/dhcpv6-options.xml.i
@@ -1,88 +1,100 @@
<!-- included start from dhcpv6-options.xml.i -->
<node name="dhcpv6-options">
<properties>
<help>DHCPv6 client settings/options</help>
</properties>
<children>
+ <leafNode name="duid">
+ <properties>
+ <help>DHCP unique identifier (DUID) to be sent by dhcpv6 client</help>
+ <valueHelp>
+ <format>duid</format>
+ <description>DHCP unique identifier (DUID)</description>
+ </valueHelp>
+ <constraint>
+ <validator name="ipv6-duid"/>
+ </constraint>
+ </properties>
+ </leafNode>
<leafNode name="parameters-only">
<properties>
<help>Acquire only config parameters, no address</help>
<valueless/>
</properties>
</leafNode>
<tagNode name="pd">
<properties>
<help>DHCPv6 prefix delegation interface statement</help>
<valueHelp>
<format>instance number</format>
<description>Prefix delegation instance (>= 0)</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--non-negative"/>
</constraint>
</properties>
<children>
<leafNode name="length">
<properties>
<help>Request IPv6 prefix length from peer</help>
<valueHelp>
<format>32-64</format>
<description>Length of delegated prefix</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--range 32-64"/>
</constraint>
</properties>
<defaultValue>64</defaultValue>
</leafNode>
<tagNode name="interface">
<properties>
<help>Delegate IPv6 prefix from provider to this interface</help>
<completionHelp>
<script>${vyos_completion_dir}/list_interfaces.py --broadcast</script>
</completionHelp>
</properties>
<children>
<leafNode name="address">
<properties>
<help>Local interface address assigned to interface</help>
<valueHelp>
<format>&gt;0</format>
<description>Used to form IPv6 interface address (default: EUI-64)</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--non-negative"/>
</constraint>
</properties>
</leafNode>
<leafNode name="sla-id">
<properties>
<help>Interface site-Level aggregator (SLA)</help>
<valueHelp>
<format>0-128</format>
<description>Decimal integer which fits in the length of SLA IDs</description>
</valueHelp>
<constraint>
<validator name="numeric" argument="--range 0-128"/>
</constraint>
</properties>
</leafNode>
</children>
</tagNode>
</children>
</tagNode>
<leafNode name="rapid-commit">
<properties>
<help>Wait for immediate reply instead of advertisements</help>
<valueless/>
</properties>
</leafNode>
<leafNode name="temporary">
<properties>
<help>IPv6 temporary address</help>
<valueless/>
</properties>
</leafNode>
</children>
</node>
<!-- included end -->
diff --git a/interface-definitions/include/interface-mac.xml.i b/interface-definitions/include/interface-mac.xml.i
index e277de85c..87dc5fb60 100644
--- a/interface-definitions/include/interface-mac.xml.i
+++ b/interface-definitions/include/interface-mac.xml.i
@@ -1,14 +1,14 @@
<!-- included start from mac.xml.i -->
<leafNode name="mac">
<properties>
<help>Media Access Control (MAC) address</help>
<valueHelp>
- <format>h:h:h:h:h:h</format>
+ <format>macaddr</format>
<description>Hardware (MAC) address</description>
</valueHelp>
<constraint>
<validator name="mac-address"/>
</constraint>
</properties>
</leafNode>
<!-- included end -->
diff --git a/src/validators/mac-address b/src/validators/ipv6-duid
similarity index 87%
copy from src/validators/mac-address
copy to src/validators/ipv6-duid
index b2d3496f4..fd4728e50 100755
--- a/src/validators/mac-address
+++ b/src/validators/ipv6-duid
@@ -1,29 +1,27 @@
#!/usr/bin/env python3
#
-# Copyright (C) 2018-2020 VyOS maintainers and contributors
+# Copyright (C) 2021 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import re
import sys
-
-pattern = "^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$"
-
+pattern = "^([0-9A-Fa-f]{2}:){,127}([0-9A-Fa-f]{2})$"
if __name__ == '__main__':
if len(sys.argv) != 2:
sys.exit(1)
if not re.match(pattern, sys.argv[1]):
sys.exit(1)
sys.exit(0)
diff --git a/src/validators/mac-address b/src/validators/mac-address
index b2d3496f4..7d020f387 100755
--- a/src/validators/mac-address
+++ b/src/validators/mac-address
@@ -1,29 +1,27 @@
#!/usr/bin/env python3
#
# Copyright (C) 2018-2020 VyOS maintainers and contributors
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 or later as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import re
import sys
-
-pattern = "^([0-9A-Fa-f]{2}[:]){5}([0-9A-Fa-f]{2})$"
-
+pattern = "^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$"
if __name__ == '__main__':
if len(sys.argv) != 2:
sys.exit(1)
if not re.match(pattern, sys.argv[1]):
sys.exit(1)
sys.exit(0)

File Metadata

Mime Type
text/x-diff
Expires
Sat, Oct 17, 12:22 AM (6 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4399207
Default Alt Text
(9 KB)

Event Timeline