Skip to content

Custom DHCP Options, PXE Boot, and Vendor Option Sets

Custom DHCP Options, PXE Boot, and Vendor Option Sets

Section titled “Custom DHCP Options, PXE Boot, and Vendor Option Sets”

RouterOS DHCP server supports arbitrary DHCP options beyond the standard gateway and DNS fields. You define options under /ip dhcp-server option, group them into named option sets, then attach those sets to servers, networks, or individual leases. A matcher lets you dynamically select which option set a client receives based on the content of options the client sends — for example, its vendor-class string (option 60) or client architecture (option 93).

ComponentMenuPurpose
Option/ip dhcp-server optionDefine a single option: code, name, value
Option Set/ip dhcp-server option setsGroup multiple options under one name
Matcher/ip dhcp-server matcherMap client-sent option values to server option sets

Assignment precedence (highest wins): RADIUS > per-lease > per-server > per-network.


RouterOS accepts several value formats for the value field. The encoding determines exactly what bytes the client receives:

FormatExampleResult
Quoted string'pxelinux.0'ASCII bytes (auto-detected)
s'...' prefixs'192.168.1.10'ASCII string bytes literally
Quoted IP'192.168.1.10'4-byte IP encoding
Decimal'10'Single byte (0x0a)
Raw hex0x0a0a0a0aExact bytes, no conversion
Concatenation'10.0.0.1'.'10.0.0.2'Two IPs back-to-back

Use s'...' when the option expects the value as a readable ASCII string (e.g., option 66 TFTP server name, option 67 boot filename). Use raw hex (0x...) for binary TLV payloads such as option 43 vendor-specific data.

/ip dhcp-server option
add name=tftp-server code=66 value=s"192.168.88.10"
add name=bios-bootfile code=67 value=s"pxelinux.0"
add name=uefi-bootfile code=67 value=s"bootx64.efi"
add name=vendor-class code=60 value=s"PXEClient"
add name=vendor-specific code=43 value=0x0104C0A85810

Note: Option code 67 can be defined with different names for BIOS and UEFI. Matchers select which one to use per client. Only one option 67 is sent per DHCP response.

By default, RouterOS only sends an option if the client requests it (Parameter Request List, option 55). Set force=yes to always send the option regardless:

/ip dhcp-server option set [find name=tftp-server] force=yes
/ip dhcp-server option set [find name=bios-bootfile] force=yes

Group related options under a named set for easy reuse:

/ip dhcp-server option sets
add name=pxe-bios options=tftp-server,bios-bootfile
add name=pxe-uefi options=tftp-server,uefi-bootfile

To a DHCP network (all clients on a subnet):

/ip dhcp-server network
set [find address="192.168.88.0/24"] dhcp-option-set=pxe-bios

To a specific DHCP server (all clients on that server):

/ip dhcp-server set [find name=dhcp1] dhcp-option-set=pxe-bios

To a single client lease (highest precedence, overrides network/server):

/ip dhcp-server lease
set [find mac-address="AA:BB:CC:DD:EE:FF"] dhcp-option-set=pxe-bios

Matchers dynamically assign option sets based on options the client sends. Rules are evaluated in order — the first match wins. Place specific rules above generic ones.

/ip dhcp-server matcher
add name=<rule-name> server=<server-name|all> code=<option-code> \
matching-type=<exact|substring> value=<string|hex> option-set=<name>
FieldDescription
codeDHCP option code to inspect in the client’s request
matching-typeexact — full match; substring — value appears anywhere
valueString or hex to match against
option-setOption set to apply when this rule matches
serverLimit rule to a specific server, or all for any server

PXE boot requires the DHCP server to tell the client where to find a TFTP server (option 66) and which file to download (option 67). BIOS and UEFI firmware expect different boot files, so use matchers to serve each correctly.

OptionCodePurpose
Vendor Class Identifier60Client identifies itself (e.g., PXEClient)
TFTP Server Name66Hostname or IP of the TFTP server
Boot File Name67Path to the boot file on the TFTP server
Vendor-Specific43Binary TLV payload (iPXE sub-options, UNDI info)
Client System Architecture930x0000 = BIOS x86, 0x0007 = UEFI x64

This example serves BIOS clients pxelinux.0 and UEFI x64 clients bootx64.efi from a TFTP server at 192.168.88.10:

# Step 1: Define options
/ip dhcp-server option
add name=opt66-tftp code=66 value=s"192.168.88.10"
add name=opt67-bios code=67 value=s"pxelinux.0"
add name=opt67-uefi code=67 value=s"bootx64.efi"
# Step 2: Build option sets
/ip dhcp-server option sets
add name=pxe-bios options=opt66-tftp,opt67-bios
add name=pxe-uefi options=opt66-tftp,opt67-uefi
# Step 3: Add matchers (most-specific first)
/ip dhcp-server matcher
# UEFI x64 clients send option 93 = 0x0007
add name=match-uefi64 server=dhcp1 code=93 matching-type=exact \
value=0x0007 option-set=pxe-uefi
# All other PXEClient firmware falls back to BIOS
add name=match-pxeclient server=dhcp1 code=60 matching-type=substring \
value=PXEClient option-set=pxe-bios
# Step 4: Set default option set on the network (non-PXE clients get nothing extra)
/ip dhcp-server network
set [find address="192.168.88.0/24"] gateway=192.168.88.1 dns-server=192.168.88.1

iPXE clients identify themselves with vendor-class iPXE. Once booted into iPXE, they re-request DHCP and need a different boot file (e.g., an iPXE script):

/ip dhcp-server option
add name=opt67-ipxe-script code=67 value=s"http://192.168.88.10/boot.ipxe"
/ip dhcp-server option sets
add name=pxe-ipxe options=opt66-tftp,opt67-ipxe-script
/ip dhcp-server matcher
# iPXE re-request — must be above the generic PXEClient rule
add name=match-ipxe server=dhcp1 code=60 matching-type=exact \
value=iPXE option-set=pxe-ipxe

Matcher order in the list determines priority. Place match-ipxe above match-pxeclient so iPXE clients receive the script URL rather than the initial boot file.

Option 43 for iPXE / Vendor-Specific Extensions

Section titled “Option 43 for iPXE / Vendor-Specific Extensions”

Option 43 carries a binary TLV blob whose format is defined by the vendor. For iPXE, the suboptions control features like PXE extensions and server discovery. RouterOS sends it as a raw hex value:

/ip dhcp-server option
add name=opt43-ipxe code=43 value=0x0104C0A85810

The exact bytes depend on your PXE stack. Consult your iPXE or PXE vendor documentation for the correct suboption encoding.


Many IP phones use option 66 (TFTP) or option 43 to discover their provisioning server, and announce themselves with a vendor-class string in option 60.

/ip dhcp-server option
add name=voip-tftp code=66 value=s"192.168.1.200"
add name=voip-vendor code=43 value=0x0104C0A801C8
/ip dhcp-server option sets
add name=voip-set options=voip-tftp,voip-vendor
/ip dhcp-server matcher
add name=match-voip server=dhcp1 code=60 matching-type=substring \
value=Polycom option-set=voip-set

Replace Polycom with the vendor-class string your phones send. Use /tool sniffer or packet-capture to inspect what option 60 your phones advertise if unknown.

DOCSIS modems expect option 43 with DOCSIS-specific sub-options. RouterOS supports vendor option spaces for building these payloads:

/ip dhcp-server option space
add name=docsis code=4491
/ip dhcp-server option
add name=cm-tftp code=2 value=s"/nvram/modem.cfg" space=docsis
add name=cm-swver code=4 value=s"DOCSIS3.0" space=docsis
# Combine suboptions into a single option 43 payload
add name=docsis-opt43 code=43 \
value=0x02112F6E7672616D2F6D6F64656D2E63666704084443534953332E30
/ip dhcp-server option sets
add name=docsis-set options=docsis-opt43
/ip dhcp-server matcher
add name=match-docsis server=dhcp1 code=60 matching-type=substring \
value=docsis option-set=docsis-set

The hex payload in value=0x... must encode the full TLV sub-option structure per DOCSIS specification. Use your cable vendor’s tools to generate the correct bytes.

Thin clients often announce themselves with a vendor-class string and require a specific boot server or configuration file. Use the same option 60 matcher pattern:

/ip dhcp-server option
add name=tc-bootserver code=66 value=s"192.168.10.50"
add name=tc-bootfile code=67 value=s"thinOS/wtos.pkg"
/ip dhcp-server option sets
add name=thinclient-set options=tc-bootserver,tc-bootfile
/ip dhcp-server matcher
add name=match-wyse server=dhcp1 code=60 matching-type=substring \
value=Wyse option-set=thinclient-set

When RouterOS acts as a DHCP relay (/ip dhcp-relay), it can insert option 82 (Relay Agent Information) to identify the subscriber port and location. This is used in ISP, wholesale/retail, and CGNAT deployments.

See DHCP Relay Option 82 for full configuration details, including add-relay-info, relay-info-remote-id, and lease-script usage of lease-agent-circuit-id / lease-agent-remote-id variables.


Check that the option code is in the client’s Parameter Request List:

/tool sniffer start filter-ip-protocol=udp filter-port=67,68
/tool sniffer print

Look for option 55 in the DISCOVER/REQUEST packets. If the client does not request the option code, enable force=yes on the option definition.

Verify the option set is attached:

/ip dhcp-server network print detail
/ip dhcp-server print detail

Check matcher order: Matchers run top-to-bottom; earlier rules take priority. Print matchers in list order and verify the intended rule appears before any overlapping rule:

/ip dhcp-server matcher print

Capture the DHCP exchange and inspect which options the client sends (especially option 60 and option 93). Compare against your matcher rules — the client’s option 60 string or option 93 architecture value may not match the matcher value exactly. Use matching-type=substring for partial matches, exact only when you know the full string.

Option 43 is vendor-specific and must be encoded as a binary TLV matching exactly what your client firmware expects. Capture the PXE exchange with Wireshark on the LAN side to decode what bytes the client expects in option 43.



  • RFC 2132 — DHCP Options and BOOTP Vendor Extensions
  • RFC 3046 — DHCP Relay Agent Information Option (Option 82)
  • RFC 4578 — Dynamic Host Configuration Protocol (DHCP) Options for the Intel Preboot eXecution Environment (PXE)
  • RFC 5071 — Dynamic Host Configuration Protocol Options Used by PXELINUX
  • MikroTik DHCP Documentation