diff options
author | Christian Poessinger <christian@poessinger.com> | 2022-04-22 22:37:55 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2022-04-22 22:39:08 +0200 |
commit | 7711018aaebbefeb19e6e551f24ce08531970f7f (patch) | |
tree | af02bbfd124a9500340001912f68cc94bfef7f7c /data/templates/dhcp-server | |
parent | 305aafacf2b7aa952316599cd77862576233fba3 (diff) | |
download | vyos-1x-7711018aaebbefeb19e6e551f24ce08531970f7f.tar.gz vyos-1x-7711018aaebbefeb19e6e551f24ce08531970f7f.zip |
dhcp: T4389: add vendor option support for Ubiquity Unifi controller
vyos@vyos# show service dhcp-server
shared-network-name LAN {
subnet 172.18.201.0/24 {
default-router 172.18.201.1
name-server 172.18.201.2
range 0 {
start 172.18.201.101
stop 172.18.201.109
}
vendor-option {
ubiquity {
unifi-controller 172.16.100.1
}
}
}
}
Diffstat (limited to 'data/templates/dhcp-server')
-rw-r--r-- | data/templates/dhcp-server/dhcpd.conf.j2 | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/data/templates/dhcp-server/dhcpd.conf.j2 b/data/templates/dhcp-server/dhcpd.conf.j2 index 40575cea2..4eb472951 100644 --- a/data/templates/dhcp-server/dhcpd.conf.j2 +++ b/data/templates/dhcp-server/dhcpd.conf.j2 @@ -23,6 +23,15 @@ option rfc3442-static-route code 121 = array of integer 8; option windows-static-route code 249 = array of integer 8; option wpad-url code 252 = text; +# Vendor specific options - Ubiquity Networks +option space ubnt; +option ubnt.unifi-controller code 1 = ip-address; +class "ubnt" { + match if substring (option vendor-class-identifier , 0, 4) = "ubnt"; + option vendor-class-identifier "ubnt"; + vendor-option-space ubnt; +} + {% if global_parameters is vyos_defined %} # The following {{ global_parameters | length }} line(s) have been added as # global-parameters in the CLI and have not been validated !!! @@ -194,6 +203,9 @@ shared-network {{ network }} { } {% endfor %} {% endif %} +{% if subnet_config.vendor_option.ubiquity.unifi_controller is vyos_defined %} + option ubnt.unifi-controller {{ subnet_config.vendor_option.ubiquity.unifi_controller }}; +{% endif %} {% if subnet_config.range is vyos_defined %} {# pool configuration can only be used if there follows a range option #} pool { |