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.

6 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.

  4. Helio says:

    Hello,

    I know this is old but a post i checked when I tried to fix my issue.

    It didn’t fix my issue but what i did was add:

    Option66
    66
    s’172.16.20.9′

    Then my Polycom phones downloaded the correct config.

    Previous to this I didnt have the s before the ‘server ip’ | ‘172.16.20.9’

  5. Majdi Razick says:

    Thank you, this saved me after pulling my hair out for hours! I can finally pxe boot from my FOG server.

  6. jimmyz says:

    Had to change “pxelinux.0” to “undionly.kpxe”, to work wih fog.

    Thank you

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.