Page MenuHomeVyOS Platform

Conditional DHCP option
Closed, ResolvedPublicFEATURE REQUEST

Description

In a Mikrotik environment, I use a conditional DHCP server where, for each Yealink IP phone model, a provisioning link is used
In a setup with multiple different IP phone models, Mikrotik’s ‘matcher’ feature is brilliant
Because using option 66 for an entire subnet isn’t suitable (even if the number of models isn’t huge – usually 3–4 models)
I believe Kea DHCP allows for this sort of thing, but it doesn’t seem to have been implemented via the CLI yet.
Is that correct?
Could this be possible in a future version of VyOS?
Here’s an example of a Mikrotik configuration that works very well

ip dhcp-server add interface=ether4 name="DHCP Server P" address-pool=DHCP_z172_P lease-time=7d add-arp=no
ip dhcp-server network add address=172.31.34.0/24 dns-server=1.1.1.1,1.0.0.1 gateway=172.31.34.1 netmask=24
ip dhcp-server option add name=Yealink_T42S code=66 value=0x68747470733a2f2f7777772e6578616d706c652e62652f646d732f5965616C696E6B543432532F comment="https://ccdms.proximus.be/dms/YealinkT42S/"
ip dhcp-server option add name=Yealink_T54W code=66 value=0x68747470733a2f2f7777772e6578616d706c652e62652f646d732f5965616C696E6B543534572F comment="https://ccdms.proximus.be/dms/YealinkT54W/"
ip dhcp-server option add name=Yealink_T73U code=66 value=0x68747470733a2f2f7777772e6578616d706c652e62652f646d732f5965616C696E6B543733552F comment="https://ccdms.proximus.be/dms/YealinkT73U/"
ip dhcp-server option add name=Yealink_T74U code=66 value=0x68747470733a2f2f7777772e6578616d706c652e62652f646d732f5965616C696E6B543734552F comment="https://ccdms.proximus.be/dms/YealinkT74U/"
ip dhcp-server option add name=Yealink_W70B code=66 value=0x68747470733a2f2f7777772e6578616d706c652e62652f646d732f5965616C696E6B573730422F comment="https://ccdms.proximus.be/dms/YealinkW70B/"
ip dhcp-server option sets add name=set_Yealink_T42S options=Yealink_T42S
ip dhcp-server option sets add name=set_Yealink_T54W options=Yealink_T54W
ip dhcp-server option sets add name=set_Yealink_T73U options=Yealink_T73U
ip dhcp-server option sets add name=set_Yealink_T74U options=Yealink_T74U
ip dhcp-server option sets add name=set_Yealink_W70B options=Yealink_W70B
ip dhcp-server matcher add server="DHCP Server P" address-pool=DHCP_z172_P name=match_Yealink_T42S code=12 matching-type=substring value=T42S option-set=set_Yealink_T42S
ip dhcp-server matcher add server="DHCP Server P" address-pool=DHCP_z172_P name=match_Yealink_T54W code=12 matching-type=substring value=T54W option-set=set_Yealink_T54W
ip dhcp-server matcher add server="DHCP Server P" address-pool=DHCP_z172_P name=match_Yealink_T73U code=12 matching-type=substring value=T73U option-set=set_Yealink_T73U
ip dhcp-server matcher add server="DHCP Server P" address-pool=DHCP_z172_P name=match_Yealink_T74U code=12 matching-type=substring value=T74U option-set=set_Yealink_T74U
ip dhcp-server matcher add server="DHCP Server P" address-pool=DHCP_z172_P name=match_Yealink_W70B code=12 matching-type=substring value=W70B option-set=set_Yealink_W70B

Thanks

Details

Version
1.5
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Feature (new functionality)

Event Timeline

DuxOv8 created this object in space S1 VyOS Public.

Sorry, I forgot to say hello

Implemented conditional DHCP options via client classification, extending the existing client-class framework (previously limited to Option 82 relay-agent matching):

  • client-class <name> hostname value|substring ... — match on the client's DHCP hostname (Option 12)
  • client-class <name> vendor-class-id value|substring ... — match on the vendor class identifier (Option 60)
  • A client-class can now deliver its own options directly (reusing the existing subnet/range option syntax)

    This covers the reported use case directly: multiple device models sharing one subnet can each get a different Option 66 (or any other option) based on a substring of their hostname, without splitting the subnet into per-model pools.

    PRs:
  • vyos-1x (implementation + smoketest): https://github.com/vyos/vyos-1x/pull/5436
  • vyos-documentation: https://github.com/vyos/vyos-documentation/pull/2227

    Example config in the documentation PR shows the Yealink-style scenario from this ticket.
Viacheslav changed the task status from Open to In progress.Aug 31 2026, 12:07 PM
Viacheslav assigned this task to rherold.
Viacheslav triaged this task as Normal priority.

Hello all
Thanks for response but i have a bug
set service dhcp-server client-class Yealink_T42S hostname substring value 'T42S'

vyos@vyos# set service dhcp-server client-class Yealink_T42S hostname substring value 'T42S'

Configuration path: service dhcp-server client-class Yealink_T42S [hostname] is not valid
Set failed

[edit]
vyos@vyos#

And with tab

vyos@vyos# set service dhcp-server client-class Yealink_T42S
Possible completions:

disable              Disable instance

> relay-agent-information

Match DHCP Option 82 (relay agent information)

[edit]
vyos@vyos# set service dhcp-server client-class Yealink_T42S

vyos@vyos# run show version
Version: VyOS 2026.10.07-0712-rolling
Release train: rolling
Release flavor: generic

Built by: autobuild@vyos.net
Built on: Wed 07 Oct 2026 09:52 UTC
Build UUID: dba9f656-4a45-4687-bc9e-5451fb086ab4
Build commit ID:

Architecture: x86_64
Boot via: installed image
System type: bare metal
Secure Boot: n/a (BIOS)

Hardware vendor: Dell Inc.
Hardware model: OptiPlex 3040
Hardware S/N: F28JXJ2
Hardware UUID: 4c4c4544-0032-3810-804a-c6c04f584a32

Copyright: VyOS maintainers and contributors
[edit]
vyos@vyos#

Or maybe it hasn't been implemented in the code yet

@DuxOv8 as you could see on the PR link is it not merged yet.

Viacheslav moved this task from Need Triage to Completed on the VyOS Rolling board.
Viacheslav subscribed.

@DuxOv8 feel free to test/check it. It will be available in the next rolling release (after the 15th of October)

Great @Viacheslav ! I'll wait for the next rolling release to test this new feature. Thank you both (you and @rherold) and VyOS Team