Community discussions

 
User avatar
eworm
Member
Member
Topic Author
Posts: 377
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

[Feature request] conditional dhcp options

Wed Apr 08, 2015 12:59 am

Hello everybody,

currently RouterOS supports adding dhcp options and it does send these only when requested from client. What I need is to send conditional options based on information the client sends.

My first example is PXE booting. Depending on what the client is, supports or what architecture it is based on I need to send different options. This is configuration snippet for ISC dhcpd:
# Declare the iPXE option space
option space ipxe;
option ipxe-encap-opts code 175 = encapsulate ipxe;

# iPXE feature flags, set in DHCP request packet
option ipxe.http      code 19 = unsigned integer 8;
option ipxe.bzimage   code 24 = unsigned integer 8;
option ipxe.pxe       code 33 = unsigned integer 8;
option ipxe.elf       code 34 = unsigned integer 8;
option ipxe.efi       code 36 = unsigned integer 8;
option ipxe.menu      code 39 = unsigned integer 8;

# Other useful general options
option arch code 93 = unsigned integer 16;

class "PXEClient" {
        match if substring(option vendor-class-identifier, 0, 9) = "PXEClient";
        
        allow booting;
        allow bootp;

        next-server 10.0.0.1;

        # Make sure the iPXE we're loading supports what we need,
        # if not load a full-featured version.
        if exists ipxe.http
          and exists ipxe.menu
          and ((exists ipxe.pxe
              and exists ipxe.bzimage
              and exists ipxe.elf)
            or (exists ipxe.efi)) {
                # Everything is fine, just send the boot configuration file.
                filename "http://10.0.0.1:3928/default.ipxe";
        } elsif exists user-class and option user-class = "iPXE" {
                # We're already using iPXE, but not a feature-full version,
                # and possibly an out-of-date version from ROM, so load a more
                # complete version with native drivers.
                if option arch = 00:06 {
                        filename "/ipxe/efi-i386.efi";
                } elsif option arch = 00:07 {
                        filename "/ipxe/efi-x86_64.efi";
                } else {
                        filename "/ipxe/ipxe.pxe";
                }
        } elsif exists user-class and option user-class = "gPXE" {
                # If someone has an old version of gPXE burned into their ROM,
                # load a more recent iPXE
                filename "/ipxe/ipxe.pxe";
        } elsif option arch = 00:06 {
                filename "/ipxe/efi-i386.efi";
        } elsif option arch = 00:07 {
                filename "/ipxe/efi-x86_64.efi";
        } else {
                filename "/ipxe/ipxe.pxe";
        }
}
This is kind of complex... It uses information from vendor-class-identifier, ipxe option space and architecture (general option code 93). But having a solution for that in RouterOS would be really great.

Another example is a mix of VoIP phones. Depending on the manufacturer I have to send different options...
# Siemens Opti Stage IP Phones
class "OptiIpPhone" {
        match if option vendor-class-identifier = "OptiIpPhone";
        option vendor-encapsulated-options 01:07:53:69:65:6D:65:6E:73:02:...;
}
 
 # Lync Phone
class "CPE-OCPHONE" {
        match if option vendor-class-identifier = "CPE-OCPHONE";
        option vendor-encapsulated-options 01:0B:43:50:45:...;
}
class "MS-UC-Client" {
        match if option vendor-class-identifier = "MS-UC-Client";
        option vendor-encapsulated-options 01:0C:4d:53:2d:...;
Thanks for your excellent devices and a great operating system for routers!

Best regards,
Chris
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts
 
jinzhanhua
just joined
Posts: 9
Joined: Sun Nov 22, 2015 6:05 am

Re: [Feature request] conditional dhcp options

Sun Nov 22, 2015 12:49 pm

Hi, I have simular custom DHCP options too.

If DHCP->Leases has static item of DHCP client and this item has custom DHCP options, DHCP Server could offer this custom DHCP options to DHCP client even if DHCP client didn't send these options during DHCP Discovery package.

Thanks!
 
sw25481
just joined
Posts: 2
Joined: Fri Sep 04, 2015 1:32 pm

Re: [Feature request] conditional dhcp options

Mon Jan 18, 2016 1:51 am

I have a simmilar, all be it simplified requirement that this would be great for.

I want to be able to PXEboot systems with traditional BIOS and systems with EFI. Each needs a different boot file. You would usually enable this with

if option arch = 00:06 {
filename "pxelinux/bootia32.efi";
} else {
filename "pxelinux/pxelinux.0";
}

I would lover RouterOS to support this
 
marianob85
just joined
Posts: 15
Joined: Wed Feb 08, 2017 9:47 pm

Re: [Feature request] conditional dhcp options

Wed Feb 08, 2017 9:50 pm

Hi,

Is there any progress with this issue ? I'm also will be grateful for possibility returning different boot file depends of pxeboot system.
 
sebus
newbie
Posts: 38
Joined: Sun Mar 12, 2017 6:29 pm

Re: [Feature request] conditional dhcp options

Mon Mar 13, 2017 9:30 am

Anything ever came out of it?

sebus
 
sebus
newbie
Posts: 38
Joined: Sun Mar 12, 2017 6:29 pm

Re: [Feature request] conditional dhcp options

Wed Mar 15, 2017 3:29 pm

Nobody?
 
biatche
Member Candidate
Member Candidate
Posts: 128
Joined: Tue Oct 13, 2015 6:50 am

Re: [Feature request] conditional dhcp options

Sun Mar 19, 2017 3:13 pm

This is one attitude i dislike about mikrotik. They won't reply even when faced with important bugs. Maybe they only communicate with people they know. Disappointing.

But I'm so much so looking forward to this feature. We should have modern networking booting for modern times.

dnsmasq supports conditions, isc dhcpd supports it, even microsoft dhcp probably supports it.
 
User avatar
ziegenberg
Frequent Visitor
Frequent Visitor
Posts: 51
Joined: Thu Mar 07, 2013 11:14 am
Location: Vienna
Contact:

Re: [Feature request] conditional dhcp options

Mon Mar 20, 2017 8:42 am

This is one attitude i dislike about mikrotik. They won't reply even when faced with important bugs. Maybe they only communicate with people they know. Disappointing.
Did you shoot them a mail at support@mikrotik.com? They always answer those mails and that's the address to turn to when you have:
  • found a bug
  • a feature request
  • questions not suitable for the forum
  • the need for a defintive answer
greetings, Daniel
 
biatche
Member Candidate
Member Candidate
Posts: 128
Joined: Tue Oct 13, 2015 6:50 am

Re: [Feature request] conditional dhcp options

Tue Mar 21, 2017 12:25 am

This is one attitude i dislike about mikrotik. They won't reply even when faced with important bugs. Maybe they only communicate with people they know. Disappointing.
Did you shoot them a mail at support@mikrotik.com? They always answer those mails and that's the address to turn to when you have:
  • found a bug
  • a feature request
  • questions not suitable for the forum
  • the need for a defintive answer
greetings, Daniel
On conditional dhcp? no. Did send a mail on issues prevalent with bridge+vlan on 6.38.5 to which i havent received a reply after a week. How about you send them an email on this on 'our' behalf and see if they do actually reply. (Since they always reply to you) You could then let us know of the wonderful news.
 
User avatar
ziegenberg
Frequent Visitor
Frequent Visitor
Posts: 51
Joined: Thu Mar 07, 2013 11:14 am
Location: Vienna
Contact:

Re: [Feature request] conditional dhcp options

Fri Mar 24, 2017 12:47 pm

Hey!
On conditional dhcp? no. Did send a mail on issues prevalent with bridge+vlan on 6.38.5 to which i havent received a reply after a week. How about you send them an email on this on 'our' behalf and see if they do actually reply. (Since they always reply to you) You could then let us know of the wonderful news.
I did write to them and they answered in less than a day. They told me the same jinzhanhua did some posts above. "DHCP lease menu allows you to set different DHCP option or option set for specific client."
Well, I wasn't pleased with the answer and asked more specifically for "rule-based conditional DHCP options". They replied "We will see what we can do about it."

So this is probably not the "wonderful news" you were looking for, but they replied.

If you want to refer to my inquiry you may use the following ticket number: Ticket#2017032222001004. If they see more people requesting certain features it helps them decide what to implement next.

greetings, Daniel
 
biatche
Member Candidate
Member Candidate
Posts: 128
Joined: Tue Oct 13, 2015 6:50 am

Re: [Feature request] conditional dhcp options

Mon Mar 27, 2017 1:06 pm

Hey!
On conditional dhcp? no. Did send a mail on issues prevalent with bridge+vlan on 6.38.5 to which i havent received a reply after a week. How about you send them an email on this on 'our' behalf and see if they do actually reply. (Since they always reply to you) You could then let us know of the wonderful news.
I did write to them and they answered in less than a day. They told me the same jinzhanhua did some posts above. "DHCP lease menu allows you to set different DHCP option or option set for specific client."
Well, I wasn't pleased with the answer and asked more specifically for "rule-based conditional DHCP options". They replied "We will see what we can do about it."

So this is probably not the "wonderful news" you were looking for, but they replied.

If you want to refer to my inquiry you may use the following ticket number: Ticket#2017032222001004. If they see more people requesting certain features it helps them decide what to implement next.

greetings, Daniel
Heh I don't know, but that's great that they do reply to you promptly. Thanks for helping those of us here who wish to see this feature.

So dear mikrotik, hoping to see a more complete dhcp/dns server package in routeros, like dnsmasq/isc dhcpd.
 
User avatar
ziegenberg
Frequent Visitor
Frequent Visitor
Posts: 51
Joined: Thu Mar 07, 2013 11:14 am
Location: Vienna
Contact:

Re: [Feature request] conditional dhcp options

Mon Mar 27, 2017 1:12 pm

Heh I don't know, but that's great that they do reply to you promptly. Thanks for helping those of us here who wish to see this feature.

So dear mikrotik, hoping to see a more complete dhcp/dns server package in routeros, like dnsmasq/isc dhcpd.
As I mentioned before: write them an email. Refere to the ticketnumber. It has much more of an effect.

greetings, Daniel
 
thomaz40
just joined
Posts: 2
Joined: Sat Jun 30, 2018 10:31 am

Re: [Feature request] conditional dhcp options

Sat Jun 30, 2018 10:58 am

Any solution?
I think so, because I managed with these configurations, boot via legacy and uefi in a virtual machine, without having to manually change the d boot file.
Sorry for the English, by google translator.

/ip dhcp-server
add address-pool=dhcp_pool0 bootp-support=dynamic disabled=no interface=\
ether5 lease-time=8h10m name=dhcp1
/ip dhcp-server option
add code=67 name=bios value="'undionly.kpxe'"
add code=67 name=uefi value="'ipxe.efi'"
/ip dhcp-server option sets
add name=legacy options=bios
/ip dhcp-server network
add address=10.100.100.0/24 boot-file-name=undionly.kpxe dhcp-option=uefi \
dns-server=10.100.100.1 domain=mkhome.lan.br gateway=10.100.100.1 \
next-server=10.100.100.252
 
User avatar
eworm
Member
Member
Topic Author
Posts: 377
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: [Feature request] conditional dhcp options

Fri Dec 14, 2018 1:09 am

You define an option set named "legacy", but it is not used anywhere. I do not think this works.
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts
 
shivansps
just joined
Posts: 24
Joined: Fri Sep 22, 2017 1:18 am

Re: [Feature request] conditional dhcp options

Fri Dec 28, 2018 11:29 pm

You can use DHCP option 67 to change the boot file name, in fact ive been using that to easily change PXE and UEFI boot mode from winbox, and yes you can set a dhcp option to one filename and having a dhcp option set pointing to the other one(what i think he was missing on the last command) active at the same time on a network but it dosent work.
 
velonet
just joined
Posts: 2
Joined: Tue Jun 04, 2019 11:22 am

Re: [Feature request] conditional dhcp options

Mon Jul 08, 2019 1:21 pm

Hey, for those coming across this post, see the latest (at this time) changelog for RouterOS:
dhcpv4-server - added "vendor-class-id" matcher (CLI only);
source: https://mikrotik.com/download/changelog ... 486e7f63b5

Your wishes might have been fulfilled. (haven't tested it myself).
 
User avatar
eworm
Member
Member
Topic Author
Posts: 377
Joined: Wed Oct 22, 2014 9:23 am
Location: Oberhausen, Germany
Contact:

Re: [Feature request] conditional dhcp options

Mon Jul 08, 2019 3:35 pm

That's a step forward, but not a solution. We need the matcher for the architecture.
Manage RouterOS scripts and extend your devices' functionality: RouterOS Scripts
 
karloch
just joined
Posts: 5
Joined: Sun Feb 14, 2016 3:07 am

Re: [Feature request] conditional dhcp options

Sun Aug 18, 2019 1:25 pm

I am also looking forward this feature so I can network boot EFI, BIOS and amd64/i386/arm64 architectures.

Who is online

Users browsing this forum: Google [Bot] and 59 guests