diff options
-rw-r--r-- | data/templates/dhcp-client/ipv4.tmpl | 4 | ||||
-rw-r--r-- | interface-definitions/include/interface/dhcp-options.xml.i | 18 |
2 files changed, 22 insertions, 0 deletions
diff --git a/data/templates/dhcp-client/ipv4.tmpl b/data/templates/dhcp-client/ipv4.tmpl index 71b429db6..c934b7cdb 100644 --- a/data/templates/dhcp-client/ipv4.tmpl +++ b/data/templates/dhcp-client/ipv4.tmpl @@ -20,5 +20,9 @@ interface "{{ ifname }}" { # The require statement lists options that must be sent in order for an offer to be # accepted. Offers that do not contain all the listed options will be ignored! require subnet-mask; +{% if dhcp_options.reject is defined and dhcp_options.reject is not none %} + # Block addresses coming from theses dhcp servers if configured. + reject {{ dhcp_options.reject | join(', ') }}; +{% endif %} } diff --git a/interface-definitions/include/interface/dhcp-options.xml.i b/interface-definitions/include/interface/dhcp-options.xml.i index bd327da2d..b65b0802a 100644 --- a/interface-definitions/include/interface/dhcp-options.xml.i +++ b/interface-definitions/include/interface/dhcp-options.xml.i @@ -37,6 +37,24 @@ </constraint> </properties> </leafNode> + <leafNode name="reject"> + <properties> + <help>IP addresses or subnets from which to reject DHCP leases</help> + <valueHelp> + <format>ipv4</format> + <description>IPv4 address to match</description> + </valueHelp> + <valueHelp> + <format>ipv4net</format> + <description>IPv4 prefix to match</description> + </valueHelp> + <constraint> + <validator name="ipv4-address"/> + <validator name="ipv4-prefix"/> + </constraint> + <multi/> + </properties> + </leafNode> </children> </node> <!-- include end --> |