The current DHCP server implementation comes with options (see below) which allow the user to pass in any arbitrary option(s) in a verbatim way which will manifest in `dhcpd.conf`.
The options are:
* `set service dhcp-server global-parameters`
* `set service dhcp-server shared-network-name foo shared-network-parameters`
* `set service dhcp-server shared-network-name foo subnet 192.0.2.0/25 subnet-parameters`
* `set service dhcp-server shared-network-name foo subnet 192.0.2.0/25 static-mapping ff static-mapping-parameters`
Those options can not be validated and are simply taken "as is" which can also badly go wrong by breaking DHCPd.
In order to avoid this the idea is to "test" the newly rendered configuration with the building test-mode of dhcpd and only on pass, continue.
```
dhcpd [ -p port ] [ -f ] [ -d ] [ -q ] [ -t | -T ] [ -4 | -6 ] [ -4o6 port ] [ -s server ] [ -cf config-file ] [ -lf lease-file ] [ -pf pid-file ] [ --no-pid ] [ -user user ] [ -group group ] [ -chroot dir ] [ -tf trace-output-file ] [ -play trace-playback-file ] [ if0 [ ...ifN ] ]
-t Test the configuration file. The server tests the configuration file for correct syntax, but will not attempt to perform any network operations. This can be used to test a new configuration file automatically before installing it.
```
```
[email protected]# show service dhcp-server
global-parameters sadf
global-parameters ff
+global-parameters ff5
shared-network-name foo {
subnet 172.18.201.0/24 {
default-router 172.18.201.1
range 0 {
start 172.18.201.10
stop 172.18.201.20
}
}
}
```
```
[email protected]# commit
[ service dhcp-server ]
Configuration file errors encountered - check your options!
[[service dhcp-server]] failed
```