I’m trying to get some custom options into dhcpd.conf and I’m 99% there, but I can’t figure out how to get this into the shared network declaration:
option vendor.foo “value”;
When I run this command:
set service dhcp-server shared-network-name my_network shared-network-parameters “option vendor.foo “value”;”
I get this error:
Cannot use the double quote (") character in a value string
Value validation failed
Set failed
I tried escaping the quote (") and using single quotes (') and nothing seems to work… any thoughts or guidance on how to get this shared-network-parameter which requires quotes around the value working?
vyos@vyos:~$ show version
Version: VyOS 1.2.0-rolling+201811160337
I can’t imagine the quote is relevant or necessary, and making it the literal “"” would probably probably break it, or at least not do what is desired. It’s doubtful isc-dhcp would know what to do with an HTML quote.
Seems like the following would accomplish what the OP wants here:
set shared-network-parameters 'option vendor.foo value'
Created a phabricator task at T1129. The quote thing is definitely an issue, though it may open up another can of worms.
As a secondary note here, notice that option vendor.foo “value”; isn’t just free-form. It’s got to be from a specific list, meaning vendor.foo would always be invalid without first defining it.
You could add it as a valid option if you defined it first under:
service dhcp-server global-parameters
with
option option.foo code new-code = text ;,
though you would probably run into the same quote issue.
Also note that the reason this passes validation is per this note in the tab completion:
Additional shared-network parameters for DHCP server.
You must use the syntax of dhcpd.conf in this text-field.
Using this without proper knowledge may result in a crashed
DHCP server. Check system log to look for errors.