Mikrotik DHCP and PXE boot

If you want to boot with DHCP/PXE/TFTP method and your DHCP is handled by a Mikrotik router and your TFTP server is on another server, then you need to set the next-server and boot-file-name parameters in the network definition.

Do not try to set DHCP options (codes 66 and 67) and assign them to the network definition, it will not work. The same applies to the NTP servers option.

So, do not do this:

/ip dhcp-server option
add code=42 name=ntp value=193.190.198.10
add code=66 name=next-server value=172.16.20.9
add code=67 name=boot-file value=pxelinux.0

But instead, do this:

/ip dhcp-server network
add address=192.168.0.0/24 boot-file-name=pxelinux.0 comment=dhcp-lan dhcp-option="" dns-server=192.168.0.1 gateway=192.168.0.1 netmask=25 next-server=192.168.0.2 ntp-server=192.168.0.2

It seems that if there is an option present in the network definition (even if it is not set), then setting an option with the proper code is useless.

Good to know.

This entry was posted in Computer, Linux, Mikrotik, Networking. Bookmark the permalink.

3 Responses to Mikrotik DHCP and PXE boot

  1. Rob Barrett says:

    Thanks for this – worked straight away.

  2. Dido says:

    I tried and failed for 2 hours before I find your helpful advice. Thank you.

  3. Blecchi says:

    I found that this issue also occurs when assigning an option to a specific client reservation. However only for the boot server option. The bootfile name can be set using an option.

Leave a Reply

Your email address will not be published. Required fields are marked *