Page MenuHomeVyOS Platform

DHCP Server Custom Options
Open, WishlistPublicFEATURE REQUEST

Description

Summary

Add support back for custom DHCP options. Apparently, this was removed due to using the Kea DHCP server in the new version.

Use case

I am running FreePBX at home with Cisco SIP phones. I need to add option 150 to tell them where to download their configuration, but I can't do that in 1.5. I'm trying to migrate away from an Ubiquiti Edgerouter to a custom device running VyOS 1.5 and this is a hard stop. I also can't use v1.4 since that one removed the "modify" firewall statement, so I can't tag my SIP provider's packets with DSCP.

Additional information

I've found that Kea does make it possible to do this. Please see here: https://www.isc.org/docs/2023kea_custom_options.pdf

Details

Version
-
Is it a breaking change?
Config syntax change (non-migratable)
Issue type
Feature (new functionality)

Event Timeline

How do you see it in the CLI?
In my opinion each option should be configurable from the proper CLI if such option does not exist, it should be added.

Viacheslav triaged this task as Wishlist priority.Mar 21 2025, 9:47 AM

At the moment, it's not configurable in the CLI or if it is, it's not documented or it's buried somewhere that my question marking through the whole thing hasn't revealed it.

Which option do you propose for CLI to configure it?

Well, it could go something like this:

set service dhcp-server custom-option ciscotftp code 150
set service dhcp-server custom-option ciscotftp type ipv4-address
set service dhcp-server shared-network-name NetworkNameHere option custom-option ciscotftp '192.168.x.x'

*I forgot to include the type definition previously. That is apparently necessary. I found the full docs on that here: https://kea.readthedocs.io/en/kea-2.6.1/arm/dhcp4-srv.html#custom-dhcpv4-options

My use case is testing the newish rfc9463 which is DHCP option 162 for IPv4.
In Kea, the config looks like this

"option-def": [
        {
            "name": "foo",
            "code": 222,
            "type": "uint32",
            "array": false,
            "record-types": "",
            "space": "dhcp4",
            "encapsulate": ""
        }, ...
    ],

So it might make sense for the VyOS config to look like:

set service dhcp-server custom-option dnr code 162
set service dhcp-server custom-option dnr type record
set service dhcp-server custom-option dnr type record-types uint16
set service dhcp-server custom-option dnr type record-types uint16
set service dhcp-server custom-option dnr type record-types uint8
set service dhcp-server custom-option dnr type record-types fqdn
set service dhcp-server custom-option dnr type record-types binary

And set as follows, the option-data object.

set service dhcp-server shared-network-name name custom-option dnr '1, myresolver.example.com., 96.7.128.198, "alpn=h2,h3 port=443 dohpath=/dns-query{?dns}"'

To add to this there are many standard options available in https://kea.readthedocs.io/en/latest/arm/dhcp4-srv.html#dhcp4-std-options-list that are not exposed in the VyOS configuration interface.
So it would make sense to allow custom-option to specific the standard name of any the built-in standard options as well.

The maintainers do not like the idea of the raw options, so raw options were disabled/removed where possible.
The only exception is openvpn-option
I do not see easy solution for this

OK so @Viacheslav would the maintainers be OK with adding all standard Kea DHCP options to the vyos config interface? That seems like it also could be overwhelming, but maybe it is the best option.

This comment was removed by matthew.