Community discussions

MUM Europe 2020
 
fatboy
just joined
Topic Author
Posts: 8
Joined: Tue Mar 06, 2012 12:03 pm

DHCP option add bug? (SOLVED)

Wed Apr 17, 2013 1:18 pm

Hi, I try to add DHCP-Server option 252
RoS version 6.0rc13 on CCR1016-12G

/ip dhcp-server option add name=wpad code=252 value=http://192.168.0.235/wpad.dat

and get error “failure: Unknown data type!”

In RoS version 5.24 this option works fine.
Last edited by fatboy on Thu Apr 18, 2013 9:22 am, edited 1 time in total.
 
User avatar
patrikg
Member Candidate
Member Candidate
Posts: 155
Joined: Thu Feb 07, 2013 6:38 pm
Location: Stockholm, Sweden

Re: DHCP option add bug?

Thu Apr 18, 2013 2:14 am

Look at this to se how to do it..

http://forum.mikrotik.com/viewtopic.php ... 97#p364932

You have to add " and ' to the beginning and to the end of the string.

Like this
/ip dhcp-server option add name=wpad code=252 value="'http://192.168.0.235/wpad.dat'"
Last edited by patrikg on Thu Apr 18, 2013 11:46 am, edited 1 time in total.
 
fatboy
just joined
Topic Author
Posts: 8
Joined: Tue Mar 06, 2012 12:03 pm

Re: DHCP option add bug?

Thu Apr 18, 2013 9:21 am

It works, thanks!
SOLVED.
 
User avatar
janisk
MikroTik Support
MikroTik Support
Posts: 6283
Joined: Tue Feb 14, 2006 9:46 am
Location: Riga, Latvia

Re: DHCP option add bug? (SOLVED)

Thu Apr 18, 2013 9:38 am

if you are adding hex value, you can simply use
value="0xaa0a0b0c"

when printing you will see raw value set to aa0a0b0c

if you want to add some text as a value for option use
value="'your text'"

result raw-value=796f75722074657874
if you add text and hex value in one value option use
value="'your text'0xaa0a0b0c"

result raw-value=796f75722074657874aa0b0c0d
 
BelWave
Member Candidate
Member Candidate
Posts: 184
Joined: Wed Aug 04, 2004 12:49 am

Re: DHCP option add bug? (SOLVED)

Tue Jan 07, 2014 5:40 pm

So, we have a client asking us this morning as well.

I need is option 156 set to:

FtpServers=10.230.11.51,country=1,launguage=1,Layer2Tagging=1,vlanid=111


Simply adding the ' ' on the ends of the string worked!

Thanks!

Brad
 
User avatar
interpoint
Frequent Visitor
Frequent Visitor
Posts: 91
Joined: Wed Jun 06, 2007 3:42 pm
Location: Ireland
Contact:

Re: DHCP option add bug? (SOLVED)

Mon Aug 25, 2014 12:30 am

Hi,

Could someone in Mikrotik confirm if this is a bug or not. I have only seen this issue on latest ROS 6.18.

When I upgraded to 6.18 and started testing the DHCP option function. I use Option 43 on lots of sites (over 50) and it always works pretty well.

I have been / in the past entering it like this on ROS 6.1
/ip dhcp-server option add code=43 name=option43 value="'172.17.30.253'"

Correct Result:

/ip dhcp-server option> print
# NAME CODE VALUE RAW-VALUE
0 option43 43 '172.17.30.253' 3137322e31372e33302e323533

However on ROS 6.18 when I use the same command
/ip dhcp-server option add code=43 name=option43 value="'172.17.30.253'"

Incorrect Result:

/ip dhcp-server option> print
# NAME CODE VALUE RAW-VALUE
0 option43 43 '172.17.30.253' ac111efd

Obviously there is a difference in HEX values 3137322e31372e33302e323533 and ac111efd
My option 43 did not work as a result.

Fix: I entered the string value that I wanted as HEX using this website http://chxo.com/scripts/hex2string.php

/ip dhcp-server option add code=43 name=option43 value=0x3137322e31372e33302e323533

It Works

/ip dhcp-server option> print
# NAME CODE VALUE RAW-VALUE
0 option43 43 0x3137322e31372e33302e323533 3137322e31372e33302e323533
Shane Hartigan
Director - Integrated Media Solutions
MikroTik Certified Trainer
MTCNA, MTCRE, MTCWE, MTCINE, MTCTCE, MTCIPv6E
 
User avatar
patrikg
Member Candidate
Member Candidate
Posts: 155
Joined: Thu Feb 07, 2013 6:38 pm
Location: Stockholm, Sweden

Re: DHCP option add bug? (SOLVED)

Mon Aug 25, 2014 1:08 am

Mikrotik has updated the wiki on this.
It's more clear now how to edit this.


Copy from the :Wiki

Parameter's value.
Starting from v6.8 available data types for options are:

0xXXXX - hex string (works also in v5)
'XXXXX' - string (works also in v5 but without ' ' around the text)
$(XXXXX) - variable (currently there are no variables for server)
'10.10.10.10' - IP address
s'10.10.10.10' - IP address converted to string
'10' - decimal number
s'10' - decimal number converted to string
Now it is also possible to combine data types into one, for example: "0x01'vards'$(HOSTNAME)"

For example if HOSTNAME is 'kvm', then raw value will be 0x0176617264736b766d
 
User avatar
interpoint
Frequent Visitor
Frequent Visitor
Posts: 91
Joined: Wed Jun 06, 2007 3:42 pm
Location: Ireland
Contact:

Re: DHCP option add bug? (SOLVED)

Mon Aug 25, 2014 1:43 am

Thanks.. Didn't see the update on the wiki.

I can confirm that this works in ROS 6.18

/ip dhcp-server option add code=43 name=option43 value="s'172.17.30.253'"

/ip dhcp-server option> print
# NAME CODE VALUE RAW-VALUE
0 option43 43 s'172.17.30.253' 3137322e31372e33302e323533
Shane Hartigan
Director - Integrated Media Solutions
MikroTik Certified Trainer
MTCNA, MTCRE, MTCWE, MTCINE, MTCTCE, MTCIPv6E
 
redy
just joined
Posts: 2
Joined: Thu May 15, 2014 9:03 pm

Re: DHCP option add bug? (SOLVED)

Thu May 04, 2017 2:12 am

Hello,

i need a little help with moving DHCP configuration (options) from ISC DHCP server to MikroTik. I have two separate vlans and subnets (one for untag and other for tagged traffic). Here is my configuration.

Global dhcpd.conf:
option space genexis;
option genexis.gaps code 1 = text;
option space vivso code width 4 length width 1;
option vivso.genexis code 25167 = encapsulate genexis;
option vivso.iana code 0 = string;
option op125 code 125 = encapsulate vivso;
class "drgos" {match if substring (option vendor-class-identifier, 0, 6) = "drgos-";}

Untagged vlan.conf
option genexis.gaps = "m=0;v=10;s=IP ADDRESS;";
option vivso.iana 01:01:01;

Tagged vlan.conf
option genexis.gaps = "m=0;v=10;s=IP ADDRESS;";
option vivso.iana 01:01:01;

Thanks in advance!

Who is online

Users browsing this forum: No registered users and 108 guests