summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorViacheslav Hletenko <v.gletenko@vyos.io>2022-04-19 23:16:59 +0000
committerViacheslav Hletenko <v.gletenko@vyos.io>2022-04-22 15:33:07 +0000
commit39e35ee4caae7dc40f7270b3dc5e4161d64dac1b (patch)
treebdfd29682606ad9ef742aaff34dc417a1ca05c47
parentd32ee4ad297c8754d0841b84b958a12a926cfef9 (diff)
downloadvyos-1x-39e35ee4caae7dc40f7270b3dc5e4161d64dac1b.tar.gz
vyos-1x-39e35ee4caae7dc40f7270b3dc5e4161d64dac1b.zip
dhcpv6: T4357: Add dhcpv6 options for cisco VoIP tftp
Add vendor specific options for DHCPv6-server for working with cisco VoIP phone provisioning over IPv6
-rw-r--r--data/templates/dhcp-server/dhcpdv6.conf.j28
-rw-r--r--interface-definitions/dhcpv6-server.xml.in27
-rwxr-xr-xsrc/conf_mode/dhcpv6_server.py8
3 files changed, 43 insertions, 0 deletions
diff --git a/data/templates/dhcp-server/dhcpdv6.conf.j2 b/data/templates/dhcp-server/dhcpdv6.conf.j2
index 284b7f269..43327859e 100644
--- a/data/templates/dhcp-server/dhcpdv6.conf.j2
+++ b/data/templates/dhcp-server/dhcpdv6.conf.j2
@@ -11,6 +11,11 @@ option dhcp6.preference {{ preference }};
{% if global_parameters.name_server is vyos_defined %}
option dhcp6.name-servers {{ global_parameters.name_server | join(', ') }};
{% endif %}
+{% if vsio_cisco_tftp %}
+option space cisco;
+option cisco.tftp-servers code 1 = array of ip6-address;
+option vsio.cisco code 9 = encapsulate cisco;
+{% endif %}
# Shared network configration(s)
{% if shared_network_name is vyos_defined %}
@@ -113,6 +118,9 @@ shared-network {{ network }} {
}
{% endfor %}
{% endif %}
+{% if subnet_config.vsio.cisco.tftp_server is vyos_defined %}
+ option cisco.tftp-servers {{ subnet_config.vsio.cisco.tftp_server | join(', ') }};
+{% endif %}
}
{% endfor %}
{% endif %}
diff --git a/interface-definitions/dhcpv6-server.xml.in b/interface-definitions/dhcpv6-server.xml.in
index fb96571f5..5f290595e 100644
--- a/interface-definitions/dhcpv6-server.xml.in
+++ b/interface-definitions/dhcpv6-server.xml.in
@@ -338,6 +338,33 @@
</leafNode>
</children>
</tagNode>
+ <node name="vsio">
+ <properties>
+ <help>Vendor-specific Information Option</help>
+ </properties>
+ <children>
+ <node name="cisco">
+ <properties>
+ <help>Parameters for cisco</help>
+ </properties>
+ <children>
+ <leafNode name="tftp-server">
+ <properties>
+ <help>Parameters for cisco VoIP</help>
+ <valueHelp>
+ <format>ipv6</format>
+ <description>TFTP IPv6 address</description>
+ </valueHelp>
+ <constraint>
+ <validator name="ipv6-address"/>
+ </constraint>
+ <multi/>
+ </properties>
+ </leafNode>
+ </children>
+ </node>
+ </children>
+ </node>
</children>
</tagNode>
</children>
diff --git a/src/conf_mode/dhcpv6_server.py b/src/conf_mode/dhcpv6_server.py
index 9922f2c5c..d0736eadb 100755
--- a/src/conf_mode/dhcpv6_server.py
+++ b/src/conf_mode/dhcpv6_server.py
@@ -42,6 +42,14 @@ def get_config(config=None):
return None
dhcpv6 = conf.get_config_dict(base, key_mangling=('-', '_'), get_first_key=True, no_tag_node_value_mangle=True)
+
+ for network, network_config in dhcpv6['shared_network_name'].items():
+ # A shared-network requires a subnet definition
+ if 'subnet' in network_config:
+ for subnet, subnet_config in network_config['subnet'].items():
+ if dict_search('vsio.cisco.tftp_server', subnet_config):
+ dhcpv6['vsio_cisco_tftp'] = True
+
return dhcpv6
def verify(dhcpv6):