Skip to content

Instantly share code, notes, and snippets.

@jacobweinstock
Created March 16, 2023 00:50
Show Gist options
  • Save jacobweinstock/875608dc7517a5341b806795c42ff2cf to your computer and use it in GitHub Desktop.
Save jacobweinstock/875608dc7517a5341b806795c42ff2cf to your computer and use it in GitHub Desktop.
DHCP server configurations that have been tested with the Tinkerbell Stack
port=0
# Tinkerbell requires that the Host must use a reservation (static ip).
dhcp-host=52:54:00:ee:0d:0b,thedoctor,192.168.2.144
dhcp-option=6,8.8.8.8
dhcp-option=3,192.168.2.1
dhcp-range=192.168.2.0,static
# This is the part that gets us through the iPXE infinite boot loop. https://ipxe.org/howto/chainloading
dhcp-match=tinkerbell, option:user-class, Tinkerbell
dhcp-boot=tag:!tinkerbell,ipxe.efi,none,192.168.2.112
dhcp-boot=tag:tinkerbell,http://192.168.2.112/auto.ipxe
{
"Dhcp4": {
"control-socket": {
"socket-type": "unix",
"socket-name": "/var/run/socket-dhcp-v4"
},
"interfaces-config": {
"interfaces": [
"*"
]
},
"lease-database": {
"type": "memfile",
"name": "leases4"
},
"valid-lifetime": 4000,
"host-reservation-identifiers": [
"hw-address"
],
"client-classes": [
{
"name": "tinkerbell",
"test": "substring(option[77].hex,0,10) == 'Tinkerbell'",
"boot-file-name": "http://192.168.2.112/auto.ipxe"
},
{
"name": "default",
"test": "not(substring(option[77].hex,0,10) == 'Tinkerbell')",
"boot-file-name": "ipxe.efi"
}
],
"subnet4": [
{
"subnet": "192.168.2.0/24",
"next-server": "192.168.2.112",
"option-data": [
{
"name": "routers",
"data": "192.168.2.1"
},
{
"name": "domain-name-servers",
"data": "1.1.1.1,8.8.8.8"
}
],
"reservations": [
{
"hw-address": "52:54:00:ee:0d:0b",
"ip-address": "192.168.2.144",
"hostname": "testvm1"
}
]
}
],
"loggers": [
{
"name": "kea-dhcp4",
"output_options": [
{
"output": "stdout"
}
],
"severity": "WARN"
}
]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment