RouterOS 6.9 and DHCP Options

Hello,

I was using the following line in my previous config file on OS 5.24:

/ip dhcp-server option add code=66 name=TFTP value=10.3.3.251

I’ve just tried to upgrade to 6.9 and now that line is giving me an error: “Unknown Data Type”

What has changed between these two versions which breaks my script?

Thanks!

In V5.x, the string didn’t need single quotes. V6.x requires single quotes. I haven’t tried it, but this looks like it will work.

/ip dhcp-server option add code=66 name=TFTP value='10.3.3.251'

http://wiki.mikrotik.com/wiki/Manual:IP/DHCP_Server

Thanks for the reply and suggestion. I was also trying to use the syntax from the wiki page, but when I tried the single quotes like in your code I received a Syntax Error!

After playing around a bit in winbox I discovered that the value has to encapsulated by single quotes and when I set the value equal to ‘10.3.3.251’ the raw data came out to be 0a0303fb, I threw this into a HEX to IP calc I googled and it came out as 10.3.3.251.

In the script, however, the syntax error. Well after playing around some more in the terminal I discovered that the single quotes must also be enclosed in double quotes as follows, this is the code that worked for me:

/ip dhcp-server option add code=66 name=TFTP value="'10.3.3.251'"