Community discussions

MikroTik App
 
User avatar
evince
Member
Member
Topic Author
Posts: 355
Joined: Thu Jul 05, 2012 12:11 pm
Location: Harzé - Belgique
Contact:

DHCP OPTION 160

Wed Sep 25, 2019 12:47 pm

Dear all,

Can you tell me if option 160 is working on Mikrotik? I'm not able to make it working.

Thank you in advance,
 
talz
newbie
Posts: 49
Joined: Wed Mar 15, 2017 9:01 pm

Re: DHCP OPTION 160

Wed Mar 18, 2020 12:53 am

Ran into this problem recently too.
For anyone that comes across this, here's the solution, as it's not well-documented.

I'm using RouterOS v6.46.4.
To setup Option 160, do this:

/ip dhcp-server option add code=160 name="Captive Portal" value="'https://my.server.com/some/page'"

Note that the single quotes MUST be there. It's how Mikrotik knows it's a string.

This creates a DHCP Option, but it won't be used until you assign it to a DHCP server. To do that, you have a few options:

  • Create a DHCP Option Set, add your Option to it, and add it to the DHCP Server; OR
  • Create a DHCP Option Set, add your Option to it, and add it to the DHCP Network; OR
  • Add the DHCP Option to the DHCP Network, without making an Option Set

All 3 should work in theory, but I only tested the last option.

At this point, it's setup, but there's a catch. If you have a device, like a Windows device, running Wireshark, and you do an "ipconfig /release" and "ipconfig /renew", your Wireshark will see some Options sent to you by the Mikrotik but you will NOT see Option 160. This is because:

According to the DHCP protocol, a parameter is returned to the DHCP client only if it requests this parameter, specifying the respective code in DHCP request Parameter-List (code 55) attribute. If the code is not included in Parameter-List attribute, the DHCP server will not send it to the DHCP client. -- https://wiki.mikrotik.com/wiki/Manual:I ... CP_Options

This is what tripped me up. Windows isn't requesting Option 160, so the Mikrotik won't send it. You need a device that explicitly requests Option 160 for the Mikrotik to send it.
If you want to test if the option is working, and you don't have a device that will request Option 160 handy, one thing you can do is this:

  • Get the source code for dhcptest from https://github.com/CyberShadow/dhcptest
  • Get and install DMD
    • The tool is written in D (a programming language). You'll need the D compiler (DMD) to compile it
    • During install of DMD, don't install Visual Studio, or anything extra when it asks. You don't need that.
  • Compile the tool with: dmd dhcptest.d
  • Run it with dhcptest --quiet --query --request 160 --print-only 160

This will request Option 160 from your DHCP server, and the Mikrotik will respond with that option. You should see it in Wireshark, and see the result printed by the tool.
 
Guscht
Member Candidate
Member Candidate
Posts: 267
Joined: Thu Jul 01, 2010 5:32 pm

Re: DHCP OPTION 160

Sun Jul 19, 2020 1:22 pm

Hi talz,

thank you for your outstanding(!) description regarding RFC7710 and Mikrotik! :D

Just one note, Option 160 was changed to Option 114!

Please see: https://www.iana.org/assignments/bootp- ... ters.xhtml
Or in detail, the new draft: https://datatracker.ietf.org/doc/draft- ... 710bis/10/

This document replaces [RFC7710]. [RFC7710] used DHCP code point
160. Due to a conflict, this document specifies 114. Consequently,
this document also updates [RFC3679].

It seems there was a conflict with Option 160, but no further details are given, regarding which conflict.

Option 114 will be implemented by Apple (and hopefully by more and more manufacturer):
https://developer.apple.com/news/?id=q78sq5rv
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 13055
Joined: Thu Mar 03, 2016 10:23 pm

Re: DHCP OPTION 160

Sun Jul 19, 2020 1:49 pm

It seems there was a conflict with Option 160, but no further details are given, regarding which conflict.

Quick googling reveals that option 160 is being used by polycom VoIP system.

Who is online

Users browsing this forum: No registered users and 17 guests