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

From Univention Wiki

Jump to: navigation, search
Line 35: Line 35:
  
 
== Setting the Value through UDM ==
 
== Setting the Value through UDM ==
The value of the options can be set via LDAP. First, you need to find the subnet which you would like to change
+
The value of the options can be set via LDAP. First, you need to find the service/subnet which you would like to change
 
<pre>
 
<pre>
 
udm dhcp/service list
 
udm dhcp/service list
 +
udm dhcp/subnet list
 
</pre>
 
</pre>
  
 
The result will be a list of DHCP objects
 
The result will be a list of DHCP objects
 
<pre>
 
<pre>
DN: cn=univention.intranet,cn=dhcp,dc=univention,dc=intranet
+
DN: cn=school,cn=dhcp,ou=school,dc=univention,dc=intranet
ARG: None
+
   service: school
   service: univention.intranet
 
 
</pre>
 
</pre>
  
Line 56: Line 56:
 
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' --option 'options' --append option='time-servers 10.200.10.10' \
+
udm dhcp/service modify --dn 'cn=school,cn=dhcp,ou=school,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>

Revision as of 10:54, 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

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

udm dhcp/service list
udm dhcp/subnet list

The result will be a list of DHCP objects

DN: cn=school,cn=dhcp,ou=school,dc=univention,dc=intranet
  service: school

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=school,cn=dhcp,ou=school,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