Community discussions

MikroTik App
 
Emil66
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 62
Joined: Tue Aug 28, 2018 2:09 am

[Feature Request] DHCP(v4/v6) client: Make arbitrary option codes requestable and provide their values to the script

Fri Nov 02, 2018 12:23 am

Motivation:
The DHCP server in Mikrotik routers can be configured to supply arbitrary options to clients, and the DHCP client in Mikrotik routers can be configured to add arbitrary options too, but the DHCP client has no method of requesting arbitrary options from the server and does not make values from arbitrary options available to the user script. Several IPv6 transition mechanisms rely on DHCP(v4/v6) options to give extended IP configuration information to the clients. This includes two of the most widely used protocols at the moment, 6rd and DS-Lite. Without a way to get this information from the ISP's DHCP server, there is no way to reliably use Mikrotik routers on many ISP connections.

Technical:
RFC 5969 defines 6rd, a protocol based on 6to4. OPTION_6RD (212) for DHCPv4 provides the prefix, mask and length and the addresses of 6rd border relays to the client.
RFC 6333 defines DS-Lite, which uses an IPIPv6 tunnel to a remote CGNAT gateway (called AFTR) in order to move IPv4 through a native IPv6 network. RFC 6334 defines the corresponding OPTION_AFTR_NAME (64) for DHCPv6 to inform the client of the fully qualified domain name of the AFTR.

Request:
Ideally these protocols would be supported directly, but in the meantime they could be scripted, if the DHCP(v4/v6) client could be configured to request arbitrary options and provide the returned values to a script. Please add that functionality to the DHCP clients in RouterOS.
 
pospanko
Member Candidate
Member Candidate
Posts: 279
Joined: Sun Dec 18, 2005 4:23 pm

Re: [Feature Request] DHCP(v4/v6) client: Make arbitrary option codes requestable and provide their values to the script

Wed Nov 07, 2018 10:47 pm

+100
 
eduplant
Member Candidate
Member Candidate
Posts: 139
Joined: Tue Dec 19, 2017 9:45 am

Re: [Feature Request] DHCP(v4/v6) client: Make arbitrary option codes requestable and provide their values to the script

Sat Nov 17, 2018 9:51 am

+100, again.

Even if the actual mechanisms aren't directly supported, arbitrary DHCP option requests and values would be really handy.
 
bluenobbe
newbie
Posts: 33
Joined: Wed Jan 26, 2005 1:04 pm
Location: Germany

Re: [Feature Request] DHCP(v4/v6) client: Make arbitrary option codes requestable and provide their values to the script

Sun Mar 01, 2020 8:42 pm

When can we expect the feature? Otherwise I have to kick out the mikrotik devices from my network!!!!
It is really poor such reaction for implementation.
 
lvader
just joined
Posts: 11
Joined: Tue Mar 27, 2018 8:10 pm

Re: [Feature Request] DHCP(v4/v6) client: Make arbitrary option codes requestable and provide their values to the script

Thu Sep 17, 2020 11:56 pm

+1 for supporting rfc5969. it will help a lot with using ipv6.
 
Omosa
just joined
Posts: 7
Joined: Mon Sep 20, 2021 11:45 am

Re: [Feature Request] DHCP(v4/v6) client: Make arbitrary option codes requestable and provide their values to the script

Mon Sep 27, 2021 6:48 pm

+1 for this feature!
 
nescafe2002
Forum Veteran
Forum Veteran
Posts: 897
Joined: Tue Aug 11, 2015 12:46 pm
Location: Netherlands

Re: [Feature Request] DHCP(v4/v6) client: Make arbitrary option codes requestable and provide their values to the script

Mon Sep 27, 2021 8:41 pm

To request options:

/ip dhcp-client option
# 01 = Subnet Mask, 03 = Router, 06 = Domain Server, d4 = OPTION_6RD
add code=55 name=req_6rd value=0x010306d4

To process responses, I haven't been able to figure this further out.. I think DHCP option 212 deserves an actual implementation by MikroTik.

/ip dhcp-client
add dhcp-options=req_6rd,hostname,clientid disabled=no interface=ether1 \
    script=":log info [:len (\$\"lease-options\"->\"212\")]"

For DS-lite, would be something similar:

/ipv6 dhcp-client option
# 0017 = OPTION_DNS_SERVERS, 0040 = OPTION_AFTR_NAME
add code=6 name=req_dns_aftr value=0x00170040

But unfortunately $"lease-options" is not implemented.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12001
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: [Feature Request] DHCP(v4/v6) client: Make arbitrary option codes requestable and provide their values to the script

Tue Sep 28, 2021 3:51 pm

The default options request on 6.47.10 is
0x010306212A2B333536798A

corresponding to options:
1,3,6,33,42,43,51,53,54,121,138
Subnet Mask, Gateway, DNS Servers, Static Routes, NTP Servers, Vendor Specific, Lease Time,
DHCP Message Type, DHCP Server ID, Classless Static Routes, CAP Access Controller IPs

You can add, for example a request for option "212" (0xD4) [6RD for IPv6] at the end without "destroy" all the other options:
/ip dhcp-client option
add code=55 name=Default-Options-Request value=0x010306212A2B333536798AD4

then add Default-Options-Request to DHCP Client "DHCP option" and add this to "Script" for read it and put on global variable:
:global dhcpClientLEOP $"lease-options"
:global dhcpClient6RD ($dhcpClientLEOP->"212")
:global dhcpClientIF $interface

But you must add and configure on your other router on dhcp-server / network the option 212 [6RD for IPv6] after add the option:
/ip dhcp-server option
add code=212 name=option-6rd value="<INSERT THE RIGHT VALUE HERE>"
Script inside the router, than have the dhcp server active, can change the value.

Who is online

Users browsing this forum: Bing [Bot], Paternot and 39 guests