Difference between revisions of "Cool Solution - Setting DHCP-Options"

From Univention Wiki

Jump to: navigation, search
Line 1: Line 1:
{{Version|UCS=4.1}}  
+
{{Version|UCS=4.2}}
 +
{{Version|UCS=4.3}}
 
{{Cool Solutions Disclaimer}}
 
{{Cool Solutions Disclaimer}}
 
{{#seo:
 
{{#seo:
Line 25: Line 26:
 
</pre>
 
</pre>
  
== Setting the Value ==
+
== Setting the Value through UMC ==
 +
The value of the options can be set via the UMC web interface. Right-click on an element in the tree structure of the DHCP service and select Edit.
 +
Here you will first have to 'Allow custom DHCP options' in the Options tab. Afterwards, you can set the DHCP options below the tab Advanced settings as shown in our example below.
  
The value of the options is set via the LDAP. Currently, this is only possible from the command line. First, you need to find the subnet which you would like to change.
+
[[File:DHCP options.png|400px|thumb|center]]
  
 +
Please be aware that the time-servers and ntp-servers variables should be set to a UCS Domain Controller, to ensure Kerberos is working correctly.
 +
 +
== Setting the Value through UDM ==
 +
xxx TODO: Allow custom DHCP options xxx
 +
 +
The value of the options can be set via LDAP. First, you need to find the subnet which you would like to change
 
<pre>
 
<pre>
 
udm dhcp/dhcp list
 
udm dhcp/dhcp list
Line 34: Line 43:
  
 
The result will be a list of DHCP objects.
 
The result will be a list of DHCP objects.
 
 
<pre>
 
<pre>
 
root@ucs-2788:~# udm dhcp/service list
 
root@ucs-2788:~# udm dhcp/service list
Line 44: Line 52:
  
 
We need the DN to modify the object and set the options with the following command
 
We need the DN to modify the object and set the options with the following command
 
 
<pre>
 
<pre>
udm dhcp/service modify --dn '<DN of the service>' --append option='time-servers <IP UCS-Master>' \  
+
udm dhcp/service modify --dn '<DN of the service>' --option 'options' --append option='time-servers <IP UCS-Master>' \  
 
--append option='ntp-servers <IP UCS-Master>' --append option='shoretel-handset "<config>"'
 
--append option='ntp-servers <IP UCS-Master>' --append option='shoretel-handset "<config>"'
 
</pre>
 
</pre>
  
Please pay attention to the quoting. The DHCP configuration requires strings, like for the ShoreTel config, to be enclosed in ".
+
Please pay attention to the quoting. The DHCP configuration requires strings to be encloded in quotes (""), like for the ShoreTel config.
 
In my example, this would result in the following command
 
In my example, this would result in the following command
 
 
<pre>
 
<pre>
udm dhcp/service modify --dn 'cn=univention.intranet,cn=dhcp,dc=univention,dc=intranet' --append option='time-servers 10.200.10.10' \  
+
udm dhcp/service modify --dn 'cn=univention.intranet,cn=dhcp,dc=univention,dc=intranet' --option 'options' --append option='time-servers 10.200.10.10' \  
 
--append option='ntp-servers 10.200.10.10' --append option='shoretel-handset "ftpservers=10.200.10.15,country=1,language=1,layer2tagging=1,vlanid=2"'
 
--append option='ntp-servers 10.200.10.10' --append option='shoretel-handset "ftpservers=10.200.10.15,country=1,language=1,layer2tagging=1,vlanid=2"'
 
</pre>
 
</pre>
Line 64: Line 70:
 
https://tools.ietf.org/html/rfc2132<br>
 
https://tools.ietf.org/html/rfc2132<br>
 
https://tools.ietf.org/html/rfc4833
 
https://tools.ietf.org/html/rfc4833
 +
 +
== Archive ==
 +
* There is a version of this article for [https://wiki.univention.de/index.php?title=Cool_Solution_-_Setting_DHCP-Options&oldid=13483 UCS 4.1].
  
 
[[Category:EN]]
 
[[Category:EN]]

Revision as of 10:42, 11 April 2018

Produktlogo UCS Version 4.2
Produktlogo UCS Version 4.3

Note: Cool Solutions are articles documenting additional functionality based on Univention products. Not all of the shown steps in the article are covered by Univention Support. For questions about your support coverage contact your contact person at Univention before you want to implement one of the shown steps.

Also regard the legal notes at Terms of Service.
Note: This article is not yet reviewed.


Some systems, such as VOIP Phones or door keys require additional options as part of their DHCP Lease. These can be set via the UDM Commandline interface. The purpose of this article is to describe how to set these up in UCS.

Option Codes

The Entries in the DHCP configuration consist of two parts which are the triplet of option Name, Code and the actual value. The triplet is the same across all DHCP subnets and most, such as the time-servers pointer, are standardized and inbuilt into UCS. The value, however, can be different across the different subnets. The predefined options don't have to be redefined. Their Names and Specifications can be found on the dhcp-options Manual page (Section: Standard Dhcpv4 Options) and the IETF Internet standards it builds on.

Custom option code triplets can be set via UCR. It is recommended to use a global policy to ensure a consistent setting across all servers.

The variables are formed like

dhcpd/options/<name>/<code>=<type>

The possible types can again be found on the dhcp-options Manual page (Section: Defining New Options).

Let us use the 'time-servers', 'ntp-servers' and 'shoretel-handset' options as an example. 'time-servers' and 'ntp-servers' are standard options and there is no need to redefine the code values. To set the vendor option for the ShoreTel VOIP phones on a single server, issue the following command:

ucr set dhcpd/options/shoretel-handset/156=string

Setting the Value through UMC

The value of the options can be set via the UMC web interface. Right-click on an element in the tree structure of the DHCP service and select Edit. Here you will first have to 'Allow custom DHCP options' in the Options tab. Afterwards, you can set the DHCP options below the tab Advanced settings as shown in our example below.

DHCP options.png

Please be aware that the time-servers and ntp-servers variables should be set to a UCS Domain Controller, to ensure Kerberos is working correctly.

Setting the Value through UDM

xxx TODO: Allow custom DHCP options xxx

The value of the options can be set via LDAP. First, you need to find the subnet which you would like to change

udm dhcp/dhcp list

The result will be a list of DHCP objects.

root@ucs-2788:~# udm dhcp/service list

DN: cn=univention.intranet,cn=dhcp,dc=univention,dc=intranet
ARG: None
  service: univention.intranet

We need the DN to modify the object and set the options with the following command

udm dhcp/service modify --dn '<DN of the service>' --option 'options' --append option='time-servers <IP UCS-Master>' \ 
--append option='ntp-servers <IP UCS-Master>' --append option='shoretel-handset "<config>"'

Please pay attention to the quoting. The DHCP configuration requires strings to be encloded in quotes (""), like for the ShoreTel config. In my example, this would result in the following command

udm dhcp/service modify --dn 'cn=univention.intranet,cn=dhcp,dc=univention,dc=intranet' --option 'options' --append option='time-servers 10.200.10.10' \ 
--append option='ntp-servers 10.200.10.10' --append option='shoretel-handset "ftpservers=10.200.10.15,country=1,language=1,layer2tagging=1,vlanid=2"'

Please be aware that the time-servers and ntp-servers variables should be set to a UCS Domain Controller, to ensure Kerberos is working correctly.

Further Information

https://linux.die.net/man/5/dhcp-options
https://tools.ietf.org/html/rfc2132
https://tools.ietf.org/html/rfc4833

Archive

  • There is a version of this article for UCS 4.1.
Personal tools