Page MenuHomeVyOS Platform

Support for DHCP option 26 (MTU)
Closed, ResolvedPublicFEATURE REQUEST

Description

Summary

Add support for setting DHCP option 28 (MTU) in DHCP server configuration

Use case

When using VPNs or other types of tunneling (e.g. PPPoE) it is typically required to set an MTU lower than the physical interface MTU, to avoid issues with fragmentation

A common configuration:

  • eth0 WAN mtu 1500
  • wg0 mtu 1420

To avoid fragmentation as a result of *clients* using their default physical interface MTU, a common workaround is to use MSS clamp, which injects a TCP option into connections originating from the client, so that their tcp/ip stack effectively respects the MTU of the tunnel without any specific setting of the MTU on the interface

This is a widely used “solution” but it has problems, primarily that, as a TCP option, it can’t be used for UDP datagrams. If a client sends a UDP datagram larger than the tunnel MTU, bad things happen and I get sad

The proper solutions are either:

  1. Explicitly set the MTU on each client
  2. Provide the MTU dynamically to the client via DHCP option 28

Using option 28 is simpler, especially if you have multiple clients and/or need to change the MTU on the tunnel on the router and don’t want to update each clients interface

Additional information

  • Option 28 is very simple and well documented. I don’t expect it to be problematic to add
  • I’ve read not all DHCP clients honor this option, but my DHCP client on Linux does
  • I previously used this option on an EdgeRouter (old Vyatta-based) and it worked very well for me

Details

Version
-
Is it a breaking change?
Perfectly compatible
Issue type
Feature (new functionality)

Event Timeline

To clarify, I’m only asking that this option can be set to an integer. It would be neat to be able to instruct it to set the option to a value dynamically, deriving it from a specified interface, but that’s a lot more effort and probably rarely worth it

Pardon my typo in the notes, the correct option number is 26 as in the title of the issue

Viacheslav triaged this task as Wishlist priority.Aug 15 2025, 8:28 AM

I would like to send a PR for this if I have time as it seems like a relatively good first issue to work on.

It’s very similar to https://vyos.dev/T7263 so I may try to submit a separate PR for that at roughly the same time

Any tips on what projects need to be touched for this are appreciated, I’ve found what needs to be changed in vyos-1x but I’ll have to go through the other 3-4 repositories that VyOS seems to be comprised of

Thx

You need to add changes only in the vyos-1x repo

You need to add changes only in the vyos-1x repo

Fantastic, thank you!

Are you familiar with any discussions there may have been about supporting users specifying the option type and value as (essentially) opaque blobs, to enable users to add options supported by kea but not explicitly supported bia the VyOS configuration?

I understand the problem would be that users that enter option names or values that aren’t correct when kea loads the configuration would result in a broken configuration after the template is rendered. I imagine it’s possible this goes against general guidelines about how VyOS prefers to approach things like this, which is why I’m asking

An alternative and more correct approach would be to parse the supported options from the kea options definitions which are in a friendly JSON format (https://github.com/isc-projects/kea/blob/master/doc/examples/kea4/all-options.json) which could provide support for everything without one-off changes- which I believe are not great uses of developer time :)

The behavior would be:

  1. Parse kea json options definitions
  2. Transform each option name (excluding vendor options, to avoid complexity) based on pre-existing mappings for those explicitly supported by VyOS already, but with names that differ from the kea names
  3. Ensure the type is known/supported (there are only so many types in DHCP v4, so this shouldn’t be a challenge)
  4. Use that data to validate configuration entries from the user

Both of those changes go beyond the scope of this and probably belong in another ticket. But if you have time and are already familiar with any decisions about doing these (or not doing it) I’m happy to hear them if they’re easy to summarize. Otherwise I’ll raise them later in a separate ticket another time

Regardless, I’ll proceed with the in-scope changes, explicit support for option 26 and option 50 (for the linked request from another user)

Thanks again for making this easy

As a note for myself and any other users not familiar with the project who need to perform a task like this in the feature, a few notes on changes needed based on a quick survey:

Correction to the steps required to support ALL kea options programatically- it may need to be more like this:

  1. Parse the kea options json before shipping (at build time, probably)
  2. Dynamically generate the kea-dhcp4.conf.j2 template based on that information
  3. Add dummy information in the option-v4.xml file for each option

Basically, I realize this will be a bit of a departure from the existing logic and will require extended testing.

Viacheslav changed the task status from Open to In progress.Aug 18 2025, 3:25 PM
Viacheslav assigned this task to mz.