I have a DHCP server used to do unattended installations of Debian: boot from PXE, and then install the operating system with a preseed.
The DHCP server (Debian's isc-dhcp-server
package) is configured to do an operation (do an HTTP POST) when handing out a new lease:
subnet 192.168.0.0 netmask 255.255.252.0 {
[...]
filename "pxelinux.0";
on commit {
set client_ip = binary-to-ascii(10, 8, ".", leased-address);
execute("curl", "-X", "POST", [...])
}
}
[...]
host vmhost2 {
hardware ethernet 00:19:66:60:c3:61;
fixed-address 192.168.1.13;
}
I noticed that during the unattended installation, the HTTP POST is done twice: the first time a few seconds after the machine starts (this is expected), and approximately thirty seconds later when Debian installer is configuring the network.
I wasn't expecting the second request. In fact, this is the corresponding preseed configuration:
d-i netcfg/get_hostname string vmhost2 d-i netcfg/get_domain string pelicandd.com d-i netcfg/choose_interface select auto d-i netcfg/disable_autoconfig boolean true d-i netcfg/disable_dhcp boolean true d-i netcfg/dhcp_failed note d-i netcfg/dhcp_options select Configure network manually d-i netcfg/get_ipaddress string 192.168.1.13 d-i netcfg/get_netmask string 255.255.252.0 d-i netcfg/get_gateway string 192.168.1.1 d-i netcfg/get_nameservers string 192.168.1.3 192.168.1.4 8.8.8.8 8.8.4.4 d-i netcfg/confirm_static boolean true
I thought that the netcfg/disable_dhcp
option indicates that the installer should not need to contact the DHCP server, but still, it does.
Questions:
Why is the installer contacting the DHCP server the second time, despite the preseed options?
Is there a way to stop it doing it, either through a preseed option, or by modifying the configuration of ISC DHCP server to ignore the second lease?