Page MenuHomeVyOS Platform

Add options for custom DHCP client-id and hostname
Closed, ResolvedPublic


For some ISPs, it may be necessary to send a custom client-id and hostname different from the system hostname in DHCP requests.

Proposed syntax:

set interfaces ethernet eth0 dhcp-options client-id foo
set interfaces ethernet eth0 dhcp-options host-name bar


Difficulty level
Unknown (require assessment)
Why the issue appeared?
Will be filled on close

Event Timeline

dmbaturin triaged this task as Normal priority.Jun 11 2019, 3:52 AM
dmbaturin created this task.

Why plural and not singular dhcp-option?

Fully supportive of this. My ISP (Swisscom) require the setting of DHCP option 60 (vendor-class-identifier) in order for an IP to be granted to xDSL lines.

More info here,

Anecdotally I believe some other ISPs require DHCP option 60 to be set.

Current reference is EdgeOS which allows the setting of DHCP options. The command set is shown below.

phillipmcmahon@router# set interfaces ethernet eth4 dhcp-options
client-option           default-route-distance  name-server
default-route           global-option
phillipmcmahon@router# set interfaces ethernet eth4 dhcp-options client-option
Possible completions:
  <text>        Additional options for DHCP client. You must
                use the syntax of dhclient.conf in this text-field. Using this
                without proper knowledge may result in a crashed DHCP client.
                Check system log to look for errors.

phillipmcmahon@router# set interfaces ethernet eth4 dhcp-options client-option send vendor-class-identifier &quot;100008,0001&quot;;

This results in the following config.boot snippet

ethernet eth4 {
    address dhcp
    description Swisscom
    dhcp-options {
        client-option "send vendor-class-identifier &quot;100008,0001&quot;;"
    duplex auto
    speed auto

Would love to see this added to a future and imminent release. Happy to test as required.

@c-po We have plurals everywhere we have more than one option under a subtree. dhcpv6-options, offload-options, "system options"
Since there's also the hostname option, and possibly other options we may want to send, that makes sense I guess.

dmbaturin changed the task status from Open to Backport candidate.Jul 10 2019, 6:05 PM

I see in v1.2.3 that the option to supply client-id and hostname exists which is great. My ISP requires the sending of DHCP Option 60 (VCI) in order to correctly get a lease. In EdgeOS it ends up looking like the following

ethernet eth4 {

address dhcp
description Swisscom
dhcp-options {
    client-option "send vendor-class-identifier &quot;100008,0001&quot;;"
duplex auto
speed auto


Will this DHCP option also be supported, or maybe is already but through some other means?

@phillipmcmahon personally I'm not a fan of general raw option passing as we have in other places like OpenVPN oder DHCP server.

I fully understand your concern but I'm more friendly with a CLI like:

address dhcp
description Swisscom
dhcp-options {
    vendor-class-identifier "&quot;100008,0001&quot;;"
duplex auto
speed auto

Which is "failsafe" ... raw options tend to break the running daemon if not handled with extreme care.

I'm somewhat agnostic to the implementation method. Whether as raw options or explicitly supported options handled natively in the CLI. Both work for me.

Currently I don't see a way to add the vendor-class-identifier as an option via any route, which means anyone wishing to use Vyos to interface with Swisscom, and any other ISP requiring VCI, are totally out of luck. Maybe a niche use case but I'm hopeful it still can be added, especially now the general framework for adding DHCP options is in place for v1.2.3

How do I go about making this into a formal request to support VCI?


set interfaces ethernet ethß dhcp-options vendor-class-id "bar fooo vyos" is what you get 😄 > [udp sum ok] BOOTP/DHCP, Request from 00:0d:b9:53:07:ec, length 300, xid 0xe3090e7a, Flags [none] (0x0000)
      Client-Ethernet-Address 00:0d:b9:xx:xx:xx
      Vendor-rfc1048 Extensions
        Magic Cookie 0x63825363
        DHCP-Message Option 53, length 1: Discover
        Requested-IP Option 50, length 4:
        Hostname Option 12, length 3: "foo"
        Parameter-Request Option 55, length 7:
          Subnet-Mask, BR, Default-Gateway, Domain-Name-Server
          Classless-Static-Route, Domain-Name, MTU
        Vendor-Class Option 60, length 13: "bar fooo vyos"
        END Option 255, length 0
        PAD Option 0, length 0, occurs 21

Next rolling release (newer then vyos-1.2-rolling-201910090117-amd64.iso) will have it.

Well, shame on me for not trying. Appreciate you checking that on my behalf.

That is great to know. I will get that tested this weekend.

@phillipmcmahon I only implemented it as of yesterday ....

Well, shame on you in that case ;0)

I will pull the latest 1.3 tree and build a custom ISO to get this change tested.

In all seriousness, thanks a lot for adding that in.

The original client-id has been cherry-picked into crux, but the vendor-class commands are not backportable since they rely on the new interface scripts.

syncer moved this task from Backlog to Finished on the VyOS 1.2 Crux (VyOS 1.2.4) board.