Community discussions

MikroTik App
 
marrold
Member
Member
Topic Author
Posts: 427
Joined: Wed Sep 04, 2013 10:45 am

Sending DHCP Option 10 with RouterOS DHCP Server

Sat Sep 29, 2018 1:34 am

Hi All,

I am trying to send DHCP Option 10 with the inbuilt RouterOS DHCP Server, however if I perform a packet capture, option 10 is not being included in the DHCP offer. However if I set the "code" to 12, its sent as expected.

Does anyone have any ideas?

My config looks like this:
 / ip dhcp-server option print
 # NAME                                                            CODE VALUE                                                           RAW-VALUE
 0 option10                                                          10 '95.177.139.87'                                                 5fb38b56

/ip dhcp-server network print detail
 0 ;;; Default Network
   address=10.0.130.0/24 gateway=10.0.130.1 dns-server=10.0.130.1 wins-server="" ntp-server=109.74.206.120 caps-manager="" boot-file-name="iprfp2G.tftp"
   dhcp-option=option10
Thanks!
 
sindy
Forum Guru
Forum Guru
Posts: 10206
Joined: Mon Dec 04, 2017 9:19 pm

Re: Sending DHCP Option 10 with RouterOS DHCP Server

Sat Sep 29, 2018 11:06 am

The DHCP RFC says that the server may only send options which the client has asked for. So as a first step, take your capture and see the list of options supported by client in its DHCPDISCOVER and/or DHCPREQUEST - if Option 10 is not listed there, there is no way to force it to the DHCPOFFER etc.
 
marrold
Member
Member
Topic Author
Posts: 427
Joined: Wed Sep 04, 2013 10:45 am

Re: Sending DHCP Option 10 with RouterOS DHCP Server

Sat Sep 29, 2018 11:31 pm

Thanks, this helped point me in the right direction.

The Client requests Option 43 and expects Option 10 in the offer as a "sub" option of 43

So for my case it was:
Hex for Option 10: 0A
Hex for Len 4: 04
Hex for 95.177.139.87: 5fb18b57

Combined Hex: 0x0A045fb38b56
/ip dhcp-server option add name=option43 code=43 value=0x0A045fb38b56
 
sindy
Forum Guru
Forum Guru
Posts: 10206
Joined: Mon Dec 04, 2017 9:19 pm

Re: Sending DHCP Option 10 with RouterOS DHCP Server

Sat Sep 29, 2018 11:57 pm

Just double-check your hex - you've twice given the IP address with .87 as the last byte but in the final hex, you've put 0x56 instead of correct 0x57 both times.

Who is online

Users browsing this forum: Buckeye, Google [Bot] and 89 guests