Page MenuHomeVyOS Platform

How to configure DHCP servers option with quotes?
Closed, WontfixPublic

Description

I need to configure DHCP like this:

# ...
option space ubnt;
option ubnt.unifi-address code 1 = ip-address;
 class "ubnt" {
       match if substring (option vendor-class-identifier, 0, 4) = "ubnt";
       option vendor-class-identifier "ubnt";
       vendor-option-space ubnt;
}
 subnet 10.10.10.0 netmask 255.255.255.0 {
       range 10.10.10.100 10.10.10.160;
       option ubnt.unifi-address 201.10.7.31; ### UniFi Controller IP ###
       option routers 10.10.10.2;
       option broadcast-address 10.10.10.255;
       option domain-name-servers 168.95.1.1, 8.8.8.8;
       # ...
 }

but i got:

Cannot use the double quote (") character in a value string
Value validation failed
Set failed

Details

Difficulty level
Unknown (require assessment)
Version
current
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

hexes created this task.Feb 6 2020, 7:47 AM
hexes created this object in space S1 VyOS Public.
c-po added a subscriber: c-po.EditedFeb 6 2020, 7:20 PM

For the time being please see the instructions at https://docs.vyos.io/en/latest/services/dhcp.html#dhcp-server about the pre and post usage of "

So if you need to place anything in quotes refer to the " string as it will be rendered correctly in to the config.

c-po closed this task as Wontfix.EditedFeb 6 2020, 7:22 PM

Maybe there will be a better option one day. Right now we only have https://github.com/vyos/vyos-1x/blob/current/src/conf_mode/dhcp_server.py#L816

hexes added a comment.Feb 7 2020, 4:14 AM

c-po, thanks a lot, didn't see this trick... There is too much different docs. We need to combine in one place. Here is nothing about quotes... :-( https://wiki.vyos.net/wiki/DHCP_server

hexes added a comment.Feb 7 2020, 5:38 AM

(It's possible to spy decision on Ubnt, this issue solved there, in attach:)


/opt/vyatta/share/vyatta-cfg/templates/service/dhcp-server/shared-network-name/node.tag/subnet/node.tag/unifi-controller/node.def
/opt/vyatta/sbin/dhcpd-config.pl

pasik added a subscriber: pasik.Feb 7 2020, 10:32 AM
c-po added a comment.Feb 7 2020, 6:14 PM

@hexes that's why there is a big banner on top indicating this page is outdated and links you to the new docs.

Well that's a vendor specific option from UBNT for UBNT and can not be imported. As VyOS now uses a more modern CLI generator this could be easily extended by you.

Use a new <leafNode name="unifi-controller"> in https://github.com/vyos/vyos-1x/blob/current/interface-definitions/dhcp-server.xml.in#L92-L96
and then read the value as the example here: https://github.com/vyos/vyos-1x/blob/current/src/conf_mode/dhcp_server.py#L425-L427

As I'm a UBNT Wireless user too I'm happy for a pull request