Flexibel DHCP-client options

I’m looking into options to bypass my ISP devices and work directly on my RB5009. However for the TV-service of my ISP, they have published detailed specs what you need to be capable of.
Apparently

DHCPv4 Option spoofing:
The following options provided on WAN side need to be provided to the TV decoder:
• Option 6 : DNS
• Option 42 : NTP server
• Option 67 : Bootfilename
• Option 43 : Vendor specific

Now there lies the problem … the RouterOS DHCP-client service (which is used to obtain info from the ISP - when on GPON/fiber PPPoE is not used anymore - solely DHCPv4 to request your IP) seems only capable of requesting/storing/processing CERTAIN option ?
No flexibility ??


T_he MikroTik RouterOS DHCP client may be enabled on any Ethernet-like interface at a time. The client will accept an address, netmask, default gateway, and two dns server addresses. The received IP address will be added to the interface with the respective netmask. The default gateway will be added to the routing table as a dynamic entry. Should the DHCP client be disabled or not renew an address, the dynamic default route will be removed. If there is already a default route installed prior the DHCP client obtains one, the route obtained by the DHCP client would be shown as invalid.

RouterOS DHCP cilent asks for following options:

option 1 - SUBNET_MASK,
option 3 - GATEWAY_LIST,
option 6 - TAG_DNS_LIST,
option 33 - STATIC_ROUTE,
option 42 - NTP_LIST,
option 121 - CLASSLESS_ROUTE,_

** Actually exactly like this one which was never answered.

http://forum.mikrotik.com/t/routeros-dhcp-client-options/77460/1


In theory I could start wiresharking and put the values in DHCP-options on the LAN-side, until the ISP changes them for some reason then my TV-box would not work anymore.

I’ve never used them, but did you try to add those additional options via:

/ip/dhcp-client/option/add name=bootfilename code=67 value="'somefile'"

Those are also in winbox, and docs are explain the format for value follows the dhcp-server scheme:

DHCP client has the possibility to set up options that are sent to the DHCP server. For example, hostname and MAC address. > The syntax is the same as for DHCP server options.

which is funky, see https://help.mikrotik.com/docs/display/ROS/DHCP#DHCP-DHCPOptions.1

Parameter’s value. Available data types for options are:
‘test’ → ASCII to Hex 0x74657374
‘10.10.10.10’ → Unicode IP to Hex 0x0a0a0a0a
s’10.10.10.10’ → ASCII to hex 0x31302e31302e31302e3130
s’160’ → ASCII to hex 0x313630
‘10’ → Decimal to Hex 0x0a
0x0a0a → No conversion
$(VARIABLE) → hardcoded values
RouterOS has predefined variables that can be used:
HOSTNAME - client hostname
RADIUS_MT_STR1 - from radius MT attr nr. 24
RADIUS_MT_STR2 - from radius MT attr nr. 25
REMOTE_ID - agent remote-id
NETWORK_GATEWAY - the first gateway from ‘/ip dhcp-server network’, note that this option won’t work if used from lease

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.

Maybe you can try with DHCP option 55, see:
http://forum.mikrotik.com/t/dhcp-option-55-example/146792/1
Have a look at this too:
http://forum.mikrotik.com/t/dhcp-client-issues/158947/1

It seems that “custom DHCP client request” is one of the least documented topics.

You’d still need to sniff the existing DHCP from your ISP router what’s in the Option 43 Vendor. Hard to know if it’s dynamically generated, but imagine it some fixed identifier that it’s a TV set-top box.

And if you are dealing with sub options you can do it like me code them by your self, and like @Amm0 says the best thing you have to sniff the traffic to get a know how…then you can do it trough the mikrotik device,
You can use the mikrotik device and mirror some port to your computer and run like wireshark on that.
Here my old thread about sub options for IPTV.
And when I wrote this i think it was on ver 6 not the latest 7.

http://forum.mikrotik.com/t/dhcp-option-help/65722/1