Created
August 20, 2026 20:34
-
-
Save robinsmidsrod/90f158524535f78437cd3f5602a387d1 to your computer and use it in GitHub Desktop.
Using iPXE with KEA DHCP server
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "Dhcp4": { | |
| "authoritative": true, | |
| "calculate-tee-times": true, | |
| "client-classes": [ | |
| { | |
| "name": "bios", | |
| "test": "option[client-system].hex == 0x0000", | |
| "user-context": { | |
| "comment": "Intel x86PC (Intel x86 32-bit legacy BIOS mode)" | |
| } | |
| }, | |
| { | |
| "name": "efi_x86", | |
| "test": "option[client-system].hex == 0x0006", | |
| "user-context": { | |
| "comment": "EFI IA32 (Intel x86 32-bit EFI mode) - almost never seen in the wild" | |
| } | |
| }, | |
| { | |
| "name": "efi_x64", | |
| "test": "option[client-system].hex == 0x0007", | |
| "user-context": { | |
| "comment": "EFI x86-64 (Intel x86 64-bit EFI mode) - most commonly used on newer hardware" | |
| } | |
| }, | |
| { | |
| "name": "ipxe_http", | |
| "test": "option[ipxe-encap-opts].option[19].exists" | |
| }, | |
| { | |
| "name": "ipxe_menu", | |
| "test": "option[ipxe-encap-opts].option[39].exists" | |
| }, | |
| { | |
| "name": "ipxe_nfs", | |
| "test": "option[ipxe-encap-opts].option[41].exists", | |
| "user-context": { | |
| "comment": "NB: not enabled in iPXE by default" | |
| } | |
| }, | |
| { | |
| "name": "ipxe_pxe", | |
| "test": "option[ipxe-encap-opts].option[33].exists" | |
| }, | |
| { | |
| "name": "ipxe_bzimage", | |
| "test": "option[ipxe-encap-opts].option[24].exists" | |
| }, | |
| { | |
| "name": "ipxe_elf", | |
| "test": "option[ipxe-encap-opts].option[34].exists" | |
| }, | |
| { | |
| "name": "ipxe_comboot", | |
| "test": "option[ipxe-encap-opts].option[35].exists", | |
| "user-context": { | |
| "comment": "NB: not enabled in iPXE by default" | |
| } | |
| }, | |
| { | |
| "name": "ipxe_iscsi", | |
| "test": "option[ipxe-encap-opts].option[17].exists" | |
| }, | |
| { | |
| "name": "ipxe_efi", | |
| "test": "option[ipxe-encap-opts].option[36].exists" | |
| }, | |
| { | |
| "name": "ipxe", | |
| "test": "option[user-class].hex == 'iPXE'" | |
| }, | |
| { | |
| "name": "ipxe_full", | |
| "test": "member('ipxe') and member('ipxe_http') and member('ipxe_menu') and member('ipxe_nfs')" | |
| }, | |
| { | |
| "name": "ipxe_efi_full", | |
| "test": "member('ipxe_full') and member('ipxe_efi')" | |
| }, | |
| { | |
| "name": "ipxe_bios_full", | |
| "test": "member('ipxe_full') and member('ipxe_pxe') and member('ipxe_bzimage') and member('ipxe_elf') and member('ipxe_comboot') and member('ipxe_iscsi')" | |
| }, | |
| { | |
| "boot-file-name": "nfs://10.1.2.10/raid/boot/boot.ipxe", | |
| "name": "ipxe_ready", | |
| "option-data": [ | |
| { | |
| "data": "1", | |
| "name": "no-pxedhcp", | |
| "space": "ipxe", | |
| "user-context": { | |
| "comment": "Disable ProxyDHCP, we're in control of the primary DHCP server" | |
| } | |
| } | |
| ], | |
| "test": "member('ipxe_bios_full') or member('ipxe_efi_full')", | |
| "user-context": { | |
| "comment": "Must use IPv4 (zfs sharenfs with IPv6 is not supported)" | |
| } | |
| }, | |
| { | |
| "name": "pxe", | |
| "next-server": "10.1.2.2", | |
| "test": "substring( option[vendor-class-identifier].text, 0, 9 ) == 'PXEClient' and not member('ipxe_ready')" | |
| }, | |
| { | |
| "boot-file-name": "ipxe.pxe", | |
| "name": "pxe_bios", | |
| "test": "member('pxe') and member('bios')" | |
| }, | |
| { | |
| "boot-file-name": "ipxe-x86.efi", | |
| "name": "pxe_efi_x86", | |
| "test": "member('pxe') and member('efi_x86')" | |
| }, | |
| { | |
| "boot-file-name": "ipxe-x64.efi", | |
| "name": "pxe_efi_x64", | |
| "test": "member('pxe') and member('efi_x64')" | |
| }, | |
| { | |
| "name": "windows", | |
| "option-data": [ | |
| { | |
| "always-send": true, | |
| "name": "vendor-encapsulated-options" | |
| }, | |
| { | |
| "data": "2", | |
| "name": "msft-disable-netbios", | |
| "space": "vendor-encapsulated-options-space", | |
| "user-context": { | |
| "comment": "Disables NetBIOS over TCP/IP for that network interface" | |
| } | |
| }, | |
| { | |
| "data": "1", | |
| "name": "msft-release-lease-on-shutdown", | |
| "space": "vendor-encapsulated-options-space", | |
| "user-context": { | |
| "comment": "Enables client behavior of sending DHCPRELEASE message on operating system shutdown" | |
| } | |
| }, | |
| { | |
| "data": "0xA", | |
| "name": "msft-default-router-metric-base", | |
| "space": "vendor-encapsulated-options-space", | |
| "user-context": { | |
| "comment": "Greater than 200 Mbps" | |
| } | |
| } | |
| ], | |
| "test": "substring( option[vendor-class-identifier].text, 0, 4 ) == 'MSFT'" | |
| }, | |
| { | |
| "name": "fbf", | |
| "option-data": [ | |
| { | |
| "data": "mynetwork.lan, fbf.fbf.tld", | |
| "name": "domain-search" | |
| } | |
| ], | |
| "test": "member('KNOWN') and ( lcase(option[host-name].text) == 'robin-desktop' or lcase(option[host-name].text) == 'fh-osl-robin' )" | |
| }, | |
| { | |
| "name": "mynetwork", | |
| "option-data": [ | |
| { | |
| "data": "mynetwork.lan", | |
| "name": "domain-search" | |
| } | |
| ], | |
| "test": "not member('fbf')" | |
| } | |
| ], | |
| "hooks-libraries": [ | |
| { | |
| "library": "/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_lease_cmds.so" | |
| }, | |
| { | |
| "library": "/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_ha.so", | |
| "parameters": { | |
| "high-availability": [ | |
| { | |
| "mode": "hot-standby", | |
| "peers": [ | |
| { | |
| "name": "netsvc-core", | |
| "role": "primary", | |
| "url": "http://10.1.2.160:6780/" | |
| }, | |
| { | |
| "name": "netsvc-nas", | |
| "role": "standby", | |
| "url": "http://10.1.2.161:6780/" | |
| } | |
| ], | |
| "this-server-name": "netsvc-core" | |
| } | |
| ] | |
| } | |
| } | |
| ], | |
| "interfaces-config": { | |
| "dhcp-socket-type": "raw", | |
| "interfaces": [ | |
| "eth0" | |
| ] | |
| }, | |
| "lease-database": { | |
| "name": "/var/lib/kea/kea-leases4.csv", | |
| "persist": true, | |
| "type": "memfile" | |
| }, | |
| "loggers": [ | |
| { | |
| "debuglevel": 0, | |
| "name": "kea-dhcp4", | |
| "output-options": [ | |
| { | |
| "output": "stdout", | |
| "pattern": "severity=%p source=%c msg=\"%m\"\n" | |
| } | |
| ], | |
| "severity": "INFO" | |
| }, | |
| { | |
| "name": "kea-dhcp4.commands", | |
| "severity": "WARN" | |
| } | |
| ], | |
| "max-valid-lifetime": 86400, | |
| "option-data": [ | |
| { | |
| "data": "CET1CEST2\\,M3.5.0\\,M10.5.0/3", | |
| "name": "pcode" | |
| }, | |
| { | |
| "data": "Europe/Oslo", | |
| "name": "tcode" | |
| }, | |
| { | |
| "data": "80.89.32.121,77.40.226.121,83.109.34.152,195.64.118.26", | |
| "name": "ntp-servers", | |
| "user-context": { | |
| "source": "3.no.pool.ntp.org" | |
| } | |
| } | |
| ], | |
| "option-def": [ | |
| { | |
| "code": 1, | |
| "name": "msft-disable-netbios", | |
| "space": "vendor-encapsulated-options-space", | |
| "type": "uint32", | |
| "user-context": { | |
| "url": "https://msdn.microsoft.com/en-us/library/cc227276.aspx" | |
| } | |
| }, | |
| { | |
| "code": 2, | |
| "name": "msft-release-lease-on-shutdown", | |
| "space": "vendor-encapsulated-options-space", | |
| "type": "uint32", | |
| "user-context": { | |
| "url": "https://msdn.microsoft.com/en-us/library/cc227278.aspx" | |
| } | |
| }, | |
| { | |
| "code": 3, | |
| "name": "msft-default-router-metric-base", | |
| "space": "vendor-encapsulated-options-space", | |
| "type": "uint32", | |
| "user-context": { | |
| "url": "https://msdn.microsoft.com/en-us/library/cc227277.aspx" | |
| } | |
| }, | |
| { | |
| "code": 175, | |
| "encapsulate": "ipxe", | |
| "name": "ipxe-encap-opts", | |
| "type": "empty" | |
| }, | |
| { | |
| "code": 16, | |
| "name": "pxeext", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 17, | |
| "name": "iscsi", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 18, | |
| "name": "aoe", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 19, | |
| "name": "http", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 20, | |
| "name": "https", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 21, | |
| "name": "tftp", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 22, | |
| "name": "ftp", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 23, | |
| "name": "dns", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 24, | |
| "name": "bzimage", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 25, | |
| "name": "multiboot", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 26, | |
| "name": "slam", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 27, | |
| "name": "srp", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 32, | |
| "name": "nbi", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 33, | |
| "name": "pxe", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 34, | |
| "name": "elf", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 35, | |
| "name": "comboot", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 36, | |
| "name": "efi", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 37, | |
| "name": "fcoe", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 38, | |
| "name": "vlan", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 39, | |
| "name": "menu", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 40, | |
| "name": "sdi", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 41, | |
| "name": "nfs", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 1, | |
| "name": "priority", | |
| "space": "ipxe", | |
| "type": "int8" | |
| }, | |
| { | |
| "code": 8, | |
| "name": "keep-san", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 9, | |
| "name": "skip-san-boot", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 85, | |
| "name": "syslogs", | |
| "space": "ipxe", | |
| "type": "string" | |
| }, | |
| { | |
| "code": 91, | |
| "name": "cert", | |
| "space": "ipxe", | |
| "type": "string" | |
| }, | |
| { | |
| "code": 92, | |
| "name": "privkey", | |
| "space": "ipxe", | |
| "type": "string" | |
| }, | |
| { | |
| "code": 93, | |
| "name": "crosscert", | |
| "space": "ipxe", | |
| "type": "string" | |
| }, | |
| { | |
| "code": 176, | |
| "name": "no-pxedhcp", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 177, | |
| "name": "bus-id", | |
| "space": "ipxe", | |
| "type": "string" | |
| }, | |
| { | |
| "code": 188, | |
| "name": "san-filename", | |
| "space": "ipxe", | |
| "type": "string" | |
| }, | |
| { | |
| "code": 189, | |
| "name": "bios-drive", | |
| "space": "ipxe", | |
| "type": "uint8" | |
| }, | |
| { | |
| "code": 190, | |
| "name": "username", | |
| "space": "ipxe", | |
| "type": "string" | |
| }, | |
| { | |
| "code": 191, | |
| "name": "password", | |
| "space": "ipxe", | |
| "type": "string" | |
| }, | |
| { | |
| "code": 192, | |
| "name": "reverse-username", | |
| "space": "ipxe", | |
| "type": "string" | |
| }, | |
| { | |
| "code": 193, | |
| "name": "reverse-password", | |
| "space": "ipxe", | |
| "type": "string" | |
| }, | |
| { | |
| "code": 235, | |
| "name": "version", | |
| "space": "ipxe", | |
| "type": "string" | |
| }, | |
| { | |
| "code": 203, | |
| "name": "iscsi-initiator-iqn", | |
| "type": "string", | |
| "user-context": { | |
| "comment": "This is custom, but not an ipxe-encapsulated, option used by iPXE" | |
| } | |
| } | |
| ], | |
| "reservations-global": false, | |
| "reservations-in-subnet": true, | |
| "reservations-out-of-pool": true, | |
| "subnet4": [ | |
| { | |
| "ddns-qualifying-suffix": "mynetwork.lan.", | |
| "id": 1, | |
| "option-data": [ | |
| { | |
| "data": "10.1.2.1", | |
| "name": "routers" | |
| }, | |
| { | |
| "data": "10.1.2.4, 10.1.2.44", | |
| "name": "domain-name-servers" | |
| }, | |
| { | |
| "data": "mynetwork.lan", | |
| "name": "domain-name" | |
| }, | |
| { | |
| "data": "10.1.2.8", | |
| "name": "lpr-servers", | |
| "user-context": { | |
| "hostname": "laserjet.mynetwork.lan" | |
| } | |
| } | |
| ], | |
| "pools": [ | |
| { | |
| "pool": "10.1.2.200 - 10.1.2.249" | |
| } | |
| ], | |
| "reservations": [ | |
| { | |
| "hostname": "core", | |
| "hw-address": "ab:cd:ef:01:02:03", | |
| "ip-address": "10.1.2.2", | |
| "user-context": { | |
| "comment": "Compute server br0 - Proxmox-CORE: Ubuntu 24.04" | |
| } | |
| }, | |
| { | |
| "hostname": "nas", | |
| "hw-address": "ab:cd:ef:01:02:04", | |
| "ip-address": "10.1.2.10", | |
| "user-context": { | |
| "comment": "File server br0 - Proxmox-NAS: Ubuntu 24.04" | |
| } | |
| } | |
| ], | |
| "subnet": "10.1.2.0/24", | |
| "user-context": { | |
| "name": "LAN", | |
| "vlan": 1 | |
| } | |
| } | |
| ], | |
| "valid-lifetime": 21600 | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "Dhcp6": { | |
| "calculate-tee-times": true, | |
| "hooks-libraries": [ | |
| { | |
| "library": "/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_lease_cmds.so" | |
| }, | |
| { | |
| "library": "/usr/lib/x86_64-linux-gnu/kea/hooks/libdhcp_ha.so", | |
| "parameters": { | |
| "high-availability": [ | |
| { | |
| "mode": "hot-standby", | |
| "peers": [ | |
| { | |
| "name": "netsvc-core", | |
| "role": "primary", | |
| "url": "http://[abcd:ef::::160]:6780/" | |
| }, | |
| { | |
| "name": "netsvc-nas", | |
| "role": "standby", | |
| "url": "http://[abcd:ef::::161]:6780/" | |
| } | |
| ], | |
| "this-server-name": "netsvc-core" | |
| } | |
| ] | |
| } | |
| } | |
| ], | |
| "host-reservation-identifiers": [ | |
| "hw-address", | |
| "duid" | |
| ], | |
| "interfaces-config": { | |
| "interfaces": [ | |
| "eth0" | |
| ] | |
| }, | |
| "lease-database": { | |
| "name": "/var/lib/kea/kea-leases6.csv", | |
| "persist": true, | |
| "type": "memfile" | |
| }, | |
| "loggers": [ | |
| { | |
| "debuglevel": 0, | |
| "name": "kea-dhcp6", | |
| "output-options": [ | |
| { | |
| "output": "stdout", | |
| "pattern": "severity=%p source=%c msg=\"%m\"\n" | |
| } | |
| ], | |
| "severity": "INFO" | |
| }, | |
| { | |
| "name": "kea-dhcp6.commands", | |
| "severity": "WARN" | |
| } | |
| ], | |
| "mac-sources": [ | |
| "client-link-addr-option", | |
| "remote-id", | |
| "subscriber-id", | |
| "ipv6-link-local", | |
| "duid" | |
| ], | |
| "max-valid-lifetime": 86400, | |
| "option-data": [ | |
| { | |
| "data": "CET1CEST2\\,M3.5.0\\,M10.5.0/3", | |
| "name": "new-posix-timezone" | |
| }, | |
| { | |
| "data": "Europe/Oslo", | |
| "name": "new-tzdb-timezone" | |
| }, | |
| { | |
| "data": "2a03:94e0:ffff:185:181:61:0:91, 2606:4700:f1::123, 2a0d:5600:30:3e::bade, 2a0e:dc0:4:9187::123", | |
| "name": "sntp-servers", | |
| "user-context": { | |
| "source": "2.no.pool.ntp.org" | |
| } | |
| } | |
| ], | |
| "reservations-global": false, | |
| "reservations-in-subnet": true, | |
| "reservations-out-of-pool": true, | |
| "subnet6": [ | |
| { | |
| "ddns-qualifying-suffix": "mynetwork.lan.", | |
| "id": 1, | |
| "interface": "eth0", | |
| "option-data": [ | |
| { | |
| "data": "abcd:ef::::4, abcd:ef::::44", | |
| "name": "dns-servers" | |
| } | |
| ], | |
| "pools": [ | |
| { | |
| "pool": "abcd:ef::::8000 - abcd:ef::::8fff" | |
| } | |
| ], | |
| "reservations": [ | |
| { | |
| "hostname": "core", | |
| "hw-address": "ab:cd:ef:01:02:03", | |
| "ip-addresses": [ | |
| "abcd:ef::::2" | |
| ], | |
| "user-context": { | |
| "comment": "Compute server br0 - Proxmox-CORE: Ubuntu 24.04" | |
| } | |
| }, | |
| { | |
| "hostname": "nas", | |
| "hw-address": "ab:cd:ef:01:02:04", | |
| "ip-addresses": [ | |
| "abcd:ef::::10" | |
| ], | |
| "user-context": { | |
| "comment": "File server br0 - Proxmox-NAS: Ubuntu 24.04" | |
| } | |
| } | |
| ], | |
| "subnet": "abcd:ef::::/64", | |
| "user-context": { | |
| "name": "LAN", | |
| "routing": "global", | |
| "vlan": 1 | |
| } | |
| } | |
| ], | |
| "valid-lifetime": 21600 | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment