DHCP v4.2.5 - How to manage hostname ?
Jacques Grillot
jacques.grillot at matooma.com
Tue Sep 22 09:03:55 UTC 2015
Bonjour everyone,
I work for a company that supplies services around connected devices.
I build a new infrastructure for our customers in which there is a DHCP server (v4.2.5 provides by Centos 7.1).
I need these devices register dynamically with a hostname in our DNS.
The constraint is that many devices send no information concerning their hostname (in fact, they have not this information).
What I whished was to use « host-identifier » option (which is the MSISDN, that is the phone number of the device) and use it as a parameter to build a hostname.
I groped a little bit at random and I thought of finding a solution with the conditional instructions but it dosn't work either.
This in one configuration file (/etc/dhcp/subnets/customer001.conf :
----- BEGIN -----
shared-network customer001 {
if exists dhcp-client-identifier {
option dhcp-client-identifier = option dhcp-client-identifier;
}
if exists host-name {
option host-name = option host-name;
}
else if exists dhcp-client-identifier {
option host-name = option dhcp-client-identifier;
}
zone device.m2m. {
primary 10.0.0.211;
secondary 10.0.0.212, 10.0.0.216;
key DDNS_UPDATE;
}
zone 10.in-addr.arpa. {
primary 10.0.0.211;
secondary 10.0.0.212, 10.0.0.216;
key DDNS_UPDATE;
}
deny unknown-clients ;
ddns-rev-domainname "in-addr.arpa.";
ddns-updates on;
ddns-update-style interim;
ignore client-updates;
infinite-is-reserved on;
do-forward-updates on;
option domain-name-servers 10.0.0.211, 10.0.0.212;
update-static-leases on;
use-host-decl-names on;
ddns-domainname "device.m2m.";
default-lease-time 604800;
max-lease-time 604800;
subnet 10.1.0.0 netmask 255.255.0.0 {
range 10.1.0.2 10.1.255.250;
option routers 10.1.255.252;
option subnet-mask 255.255.0.0;
option broadcast-address 10.1.255.255;
}
subnet 10.129.0.0 netmask 255.255.0.0 {
range 10.129.0.2 10.129.255.250;
option routers 10.129.255.252;
option subnet-mask 255.255.0.0;
option broadcast-address 10.129.255.255;
}
}
host 00033611987141 {
if exists host-name {
option host-name = option host-name;
}
else if exists dhcp-client-identifier {
option host-name = option dhcp-client-identifier;
}
fixed-address 10.1.0.3;
option dhcp-client-identifier "\00033123456789";
}
host 00033625232212 {
if exists host-name {
option host-name = option host-name;
}
else if exists dhcp-client-identifier {
option host-name = option dhcp-client-identifier;
}
fixed-address 10.1.0.4;
option dhcp-client-identifier "\000330987654321";
}
----- END -----
Some help will be appreciate :)
Regards,
Jacques
Jacques GRILLOT
Administrateur Réseaux et Systèmes
+33 (0) 4 88 36 07 52
+33 (0) 6 08 33 06 02
[cid:part1.09070605.03080102 at matooma.com]<http://www.matooma.fr/>
Siège social : Cap Oméga Rond-point Benjamin Franklin
34960 Montpellier Cedex 2
Agence de Paris : Le village 55 Rue de la Boétie 75008 Paris
Restons connecté ! [cid:part3.09030806.03030500 at matooma.com] <https://twitter.com/MatoomaM2M> [cid:part5.05060705.08030108 at matooma.com] <https://www.facebook.com/matoomam2m> [cid:part7.01080909.08020300 at matooma.com] <https://www.linkedin.com/company/matooma> [cid:part9.09010008.08030004 at matooma.com] <http://www.viadeo.com/fr/company/matooma-sas> [cid:part11.09010908.03060004 at matooma.com] <https://plus.google.com/+Matooma/>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20150922/a393ac00/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 14304 bytes
Desc: image001.png
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20150922/a393ac00/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image002.png
Type: image/png
Size: 1462 bytes
Desc: image002.png
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20150922/a393ac00/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.png
Type: image/png
Size: 1522 bytes
Desc: image003.png
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20150922/a393ac00/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.png
Type: image/png
Size: 1344 bytes
Desc: image004.png
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20150922/a393ac00/attachment-0009.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image005.png
Type: image/png
Size: 1399 bytes
Desc: image005.png
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20150922/a393ac00/attachment-0010.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image006.png
Type: image/png
Size: 1487 bytes
Desc: image006.png
URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20150922/a393ac00/attachment-0011.png>
More information about the dhcp-users
mailing list