iVentoy and Third-part DHCP Server
- 1. Background
The first step of PXE progress is that the client will send DHCP request for IP address. So there must be a DHCP server in the network.
iVentoy contains an internal DHCP Server and you can use it in most simple usage scenarios.
iVentoy can also work together with external DHCP Server.
- 2. Bootfile
When iVentoy works together with the third-party DHCP Server, it no longer provides the function of DHCP Server itself, but only serves as a file server to provide file download services.
When the client start PXE booting, it will firstly send DHCP request packet to the DHCP server to get IP address and next-server and bootfile option.
Then the client will download the bootfile from next-server (iVentoy) with TFTP. After that the bootfile will boot and show the boot menu.
One difficult thing to deal with here is that the client may be in Legacy BIOS mode or UEFI mode, and the bootfiles are different for Legacy BIOS mode and UEFI mode.
If the client is UEFI mode and iVentoy send it the Legacy BIOS mode bootfile, then the client will hang.
Well, is there a way to determine whether the client is in Legacy BIOS mode or UEFI mode (and IA32 UEFI mode and ARM64 UEFI mode)?
Yes!
When the client start PXE booting, it will firstly send DHCP request packet to the DHCP server to get IP address.
There is information in the request packet to identify the client's BIOS mode. However, the information only exist in the DHCP request packet,
when the client get the IP address and download bootfile from iVentoy, iVentoy still cannot know the client's BIOS mode.
So here iVentoy provides different methods to solve this problem for different scenarios corresponding to different DHCP Server modes.
iVentoy provides 4 DHCP server modes: Proxy mode, ProxyNet mode, External mode and ExternalNet mode.
- 2.1 Proxy & ProxyNet Mode
The usage scenario of Proxy & ProxyNet mode is that iVentoy and the third-party DHCP Server are located in the same LAN/VLAN.
In this mode, iVentoy will still start its internal DHCP server, but the internal DHCP server will only response to offer the next-server and bootfile options
and will never offser an IP address to the client.
If iVentoy and third-party DHCP Server are running on different OS then choose ProxyNet Mode.
If iVentoy and third-party DHCP Server are running on the same OS then choose Proxy Mode.
Some times you already have a DHCP server in your network but it can only offer ip address and can not provide bootfile option, then you can use Proxy or ProxyNet mode.
In these two modes, you don't need to do any configuration on the third-party DHCP server.
In ProxyNet mode, iVentoy will listen on UDP 67 and UDP 4011 port.
In Proxy mode, iVentoy will only listen on UDP 4011 port.
- 2.2 External Mode
The usage scenario of External mode is that iVentoy and the third-party DHCP Server are located in the same LAN/VLAN.
In this mode, iVentoy will still start its internal DHCP server, but the internal DHCP server will only snoop the DHCP packet and will not send any response.
So it will not interfere with the work of the external DHCP Server.
By snooping the DHCP packet, iVentoy will record the client's BIOS mode, when the client request bootfile through TFTP, iVentoy will send it the right bootfile.
So in this mode, the DHCP server does not need to care about the client's BIOS mode. It only provides a common bootfile name (for example iventoy_loader_16000)
The bootfile name is actually a virtual file name. iVentoy will provide the real bootfile to the client according to its BIOS mode.
Prioritize ProxyNet mode under all circumstances. Use External mode only if ProxyNet mode is insufficient.
- 2.3 ExternalNet Mode
The usage scenario of ExternalNet mode is that iVentoy and the third-party DHCP Server are located in different LANs/VLANs.
In this mode, iVentoy can not snoop the DHCP packet, because the DHCP packet is isolated in the LAN/VLAN where the client is located, it cannot reach iVentoy.
So iVentoy will not start its internal DHCP server at all. So how to distinguish the bootfile in this mode? It's done by the third-part DHCP server.
That is to say, in this mode, the third-part DHCP server must dynamically provides different bootfile options
according to the client machine's hardware architecture (by the information in the client's DHCP request packet).
Therefore, this mode has high requirements for the third-party DHCP server,
which must be able to dynamically set the bootfile option according to the information in the DHCP request packet.
Most DHCP Servers do not support this advanced feature (even some DHCP Servers do not even support the configuration of next-server and bootfile options).
The linux ISC DHCP Server or dnsmasq supports this feature. Please refer the example script at the end of this article.
Of course, if all your computers are in UEFI mode, then you can use ExternalNet mode even if the third-party DHCP Server does not support this advanced feature.
You can just configure the bootfile value directly according to UEFI mode.
- 2.3 About IPv6
The above explanation primarily applies to IPv4. For IPv6, only Internal and ExternalNet modes are supported.
This is mainly because the IPv6 protocol is relatively new, and almost all DHCP Server software that supports IPv6
is capable of configuring Option 59 (i.e., the boot file URL).
- 3. How to use
1. Choose DHCP Server Mode with Proxy, ProxyNet, Extenal or ExtenalNet in Configuration page as follows.

2. For External mode or ExternalNet mode, must set next-server option value to the iVentoy IP address in the third-part DHCP server.
3. For External mode, set bootfile option value to iventoy_loader_16000
Note that the suffix 16000 is the iVentoy http server port, if you change it on the page then the bootfile should match it.
(For example: iventoy_loader_17000).
4. For IPv4 and IPv6 PXE ExternalNet mode, the bootfile option value should be set as follows:
Attention: For iVentoy 1.0.51+, please config as follows: bios/iventoy_loader.bin uefi/iventoy_loader.efi ia32/iventoy_loader.efi aa64/iventoy_loader.efi la64/iventoy_loader.efi Attention: For iVentoy 1.0.50 and earlier release, please config as follows: iventoy_loader_16000_bios or has any suffix, such as iventoy_loader_16000_bios.bin iventoy_loader_16000_bios.img iventoy_loader_16000_uefi or has any suffix, such as iventoy_loader_16000_uefi.efi iventoy_loader_16000_uefi.img iventoy_loader_16000_ia32 or has any suffix, such as iventoy_loader_16000_ia32.efi iventoy_loader_16000_ia32.img iventoy_loader_16000_aa64 or has any suffix, such as iventoy_loader_16000_aa64.efi iventoy_loader_16000_aa64.img iventoy_loader_16000_la64 or has any suffix, such as iventoy_loader_16000_la64.efi iventoy_loader_16000_la64.img
5. For IPv4 HTTP Boot, both External and ExternalNet mode should set bootfile as follows:
http://192.168.10.100:16000/hboot/loader/uefi/iventoy_loader.efi http://192.168.10.100:16000/hboot/loader/ia32/iventoy_loader.efi http://192.168.10.100:16000/hboot/loader/aa64/iventoy_loader.efi http://192.168.10.100:16000/hboot/loader/la64/iventoy_loader.efi
6. For IPv4 HTTPS Boot, both External and ExternalNet mode should set bootfile as follows:
https://192.168.10.100:16001/hboot/loader/uefi/iventoy_loader.efi https://192.168.10.100:16001/hboot/loader/ia32/iventoy_loader.efi https://192.168.10.100:16001/hboot/loader/aa64/iventoy_loader.efi https://192.168.10.100:16001/hboot/loader/la64/iventoy_loader.efi Attention: HTTPS port = HTTP port + 1 (e.g. HTTP port is 16000 then HTTPS port is 16001)
7. For IPv6 HTTP Boot, both External and ExternalNet mode should set bootfile as follows:
http://[fd12:3456:789a:7::1]:16000/hboot/loader/uefi/iventoy_loader.efi http://[fd12:3456:789a:7::1]:16000/hboot/loader/ia32/iventoy_loader.efi http://[fd12:3456:789a:7::1]:16000/hboot/loader/aa64/iventoy_loader.efi http://[fd12:3456:789a:7::1]:16000/hboot/loader/la64/iventoy_loader.efi
8. For IPv6 HTTPS Boot, both External and ExternalNet mode should set bootfile as follows:
https://[fd12:3456:789a:7::1]:16001/hboot/loader/uefi/iventoy_loader.efi https://[fd12:3456:789a:7::1]:16001/hboot/loader/ia32/iventoy_loader.efi https://[fd12:3456:789a:7::1]:16001/hboot/loader/aa64/iventoy_loader.efi https://[fd12:3456:789a:7::1]:16001/hboot/loader/la64/iventoy_loader.efi Attention: HTTPS port = HTTP port + 1 (e.g. HTTP port is 16000 then HTTPS port is 16001)
- 4. Example DHCP Configuration
ISC DHCP Server IPv4
default-lease-time 600;
max-lease-time 7200;
authoritative;
option client-arch code 93 = unsigned integer 16;
subnet 192.168.20.0 netmask 255.255.255.0 {
range 192.168.20.130 192.168.20.140;
option routers 192.168.20.1;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.20.255;
class "pxe_clients" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
next-server 192.168.20.3;
if option client-arch = 00:07 {
filename "uefi/iventoy_loader.efi";
} elsif option client-arch = 00:09 {
filename "uefi/iventoy_loader.efi";
} elsif option client-arch = 00:06 {
filename "ia32/iventoy_loader.efi";
} elsif option client-arch = 00:0b {
filename "aa64/iventoy_loader.efi";
} elsif option client-arch = 00:27 {
filename "la64/iventoy_loader.efi";
} else {
filename "bios/iventoy_loader.bin";
}
}
class "http_clients" {
match if substring (option vendor-class-identifier, 0, 10) = "HTTPClient";
next-server 192.168.20.3;
#EDK UEFI HTTP Boot requires that the DHCP server must send option 60 with HTTPClient prefix.
option vendor-class-identifier "HTTPClient";
if option client-arch = 00:0f {
filename "http://192.168.20.3:16000/hboot/loader/ia32/iventoy_loader.efi";
} elsif option client-arch = 00:10 {
filename "http://192.168.20.3:16000/hboot/loader/uefi/iventoy_loader.efi";
} elsif option client-arch = 00:13 {
filename "http://192.168.20.3:16000/hboot/loader/aa64/iventoy_loader.efi";
} elsif option client-arch = 00:28 {
filename "http://192.168.20.3:16000/hboot/loader/la64/iventoy_loader.efi";
} else {
filename "bios/iventoy_loader.bin";
}
}
}
dnsmasq IPv4
interface=eth0 dhcp-range=192.168.20.60,192.168.20.80,12h dhcp-option=option:router,192.168.20.1 dhcp-no-override dhcp-match=set:arch-uefi,93,7 dhcp-match=set:arch-uefi,93,9 dhcp-match=set:arch-bios,93,0 dhcp-match=set:arch-ia32,93,6 dhcp-match=set:arch-aa64,93,11 dhcp-match=set:arch-la64,93,39 dhcp-match=set:arch-uefi-httpboot,93,16 dhcp-match=set:arch-ia32-httpboot,93,15 dhcp-match=set:arch-aa64-httpboot,93,19 dhcp-match=set:arch-la64-httpboot,93,40 #EDK UEFI HTTP Boot requires that the DHCP server must send option 60 with HTTPClient prefix. dhcp-option-force=tag:arch-uefi-httpboot,60,HTTPClient dhcp-option-force=tag:arch-ia32-httpboot,60,HTTPClient dhcp-option-force=tag:arch-aa64-httpboot,60,HTTPClient dhcp-option-force=tag:arch-la64-httpboot,60,HTTPClient dhcp-boot=tag:arch-bios,bios/iventoy_loader.bin,,192.168.20.3 dhcp-boot=tag:arch-uefi,uefi/iventoy_loader.efi,,192.168.20.3 dhcp-boot=tag:arch-ia32,ia32/iventoy_loader.efi,,192.168.20.3 dhcp-boot=tag:arch-aa64,aa64/iventoy_loader.efi,,192.168.20.3 dhcp-boot=tag:arch-la64,la64/iventoy_loader.efi,,192.168.20.3 dhcp-boot=tag:arch-uefi-httpboot,http://192.168.20.3:16000/hboot/loader/uefi/iventoy_loader.efi,,192.168.20.3 dhcp-boot=tag:arch-ia32-httpboot,http://192.168.20.3:16000/hboot/loader/ia32/iventoy_loader.efi,,192.168.20.3 dhcp-boot=tag:arch-aa64-httpboot,http://192.168.20.3:16000/hboot/loader/aa64/iventoy_loader.efi,,192.168.20.3 dhcp-boot=tag:arch-la64-httpboot,http://192.168.20.3:16000/hboot/loader/la64/iventoy_loader.efi,,192.168.20.3
dnsmasq IPv6
interface=eth0 enable-ra dhcp-range=fd12:3456:789a:7::1000,fd12:3456:789a:7::FFFF,64,12h dhcp-match=set:arch-uefi,option6:61,7 dhcp-match=set:arch-uefi,option6:61,9 dhcp-match=set:arch-bios,option6:61,0 dhcp-match=set:arch-ia32,option6:61,6 dhcp-match=set:arch-aa64,option6:61,11 dhcp-match=set:arch-la64,option6:61,39 dhcp-match=set:arch-uefi-httpboot,option6:61,16 dhcp-match=set:arch-ia32-httpboot,option6:61,15 dhcp-match=set:arch-aa64-httpboot,option6:61,19 dhcp-match=set:arch-la64-httpboot,option6:61,40 dhcp-userclass=set:ipxe6,iPXE #EDK UEFI HTTP Boot requires that the DHCP server must send option 16 with HTTPClient prefix. dhcp-option-force=tag:arch-uefi-httpboot,option6:16,1234HTTPClient dhcp-option-force=tag:arch-ia32-httpboot,option6:16,1234HTTPClient dhcp-option-force=tag:arch-aa64-httpboot,option6:16,1234HTTPClient dhcp-option-force=tag:arch-la64-httpboot,option6:16,1234HTTPClient dhcp-option=tag:arch-uefi,option6:bootfile-url,tftp://[fd12:3456:789a:7::3]/uefi/iventoy_loader.efi dhcp-option=tag:arch-ia32,option6:bootfile-url,tftp://[fd12:3456:789a:7::3]/ia32/iventoy_loader.efi dhcp-option=tag:arch-aa64,option6:bootfile-url,tftp://[fd12:3456:789a:7::3]/aa64/iventoy_loader.efi dhcp-option=tag:arch-la64,option6:bootfile-url,tftp://[fd12:3456:789a:7::3]/la64/iventoy_loader.efi dhcp-option=tag:arch-uefi,tag:ipxe6,option6:bootfile-url,tftp://[fd12:3456:789a:7::3]/autoexec.ipxe dhcp-option=tag:arch-ia32,tag:ipxe6,option6:bootfile-url,tftp://[fd12:3456:789a:7::3]/autoexec.ipxe dhcp-option=tag:arch-aa64,tag:ipxe6,option6:bootfile-url,tftp://[fd12:3456:789a:7::3]/autoexec.ipxe dhcp-option=tag:arch-la64,tag:ipxe6,option6:bootfile-url,tftp://[fd12:3456:789a:7::3]/autoexec.ipxe # HTTP Boot dhcp-option=tag:arch-uefi-httpboot,option6:bootfile-url,http://[fd12:3456:789a:7::3]:16000/hboot/loader/uefi/iventoy_loader.efi dhcp-option=tag:arch-ia32-httpboot,option6:bootfile-url,http://[fd12:3456:789a:7::3]:16000/hboot/loader/ia32/iventoy_loader.efi dhcp-option=tag:arch-aa64-httpboot,option6:bootfile-url,http://[fd12:3456:789a:7::3]:16000/hboot/loader/aa64/iventoy_loader.efi dhcp-option=tag:arch-la64-httpboot,option6:bootfile-url,http://[fd12:3456:789a:7::3]:16000/hboot/loader/la64/iventoy_loader.efi #If you need to enable HTTPS Boot, please configure as follows (and comment out the HTTP Boot configuration above): #dhcp-option=tag:arch-uefi-httpboot,option6:bootfile-url,https://[fd12:3456:789a:7::3]:16001/hboot/loader/uefi/iventoy_loader.efi #dhcp-option=tag:arch-ia32-httpboot,option6:bootfile-url,https://[fd12:3456:789a:7::3]:16001/hboot/loader/ia32/iventoy_loader.efi #dhcp-option=tag:arch-aa64-httpboot,option6:bootfile-url,https://[fd12:3456:789a:7::3]:16001/hboot/loader/aa64/iventoy_loader.efi #dhcp-option=tag:arch-la64-httpboot,option6:bootfile-url,https://[fd12:3456:789a:7::3]:16001/hboot/loader/la64/iventoy_loader.efi