summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2020-11-07 21:30:31 +0100
committerChristian Poessinger <christian@poessinger.com>2020-11-07 21:30:31 +0100
commited6e1f556b290231f1683a06ec366dbeb4c0776a (patch)
tree4c6c711dbb18de8ca9485fe12efa1d785cf8881d
parentd1b68af630b20c0d66f2f0a840c91dcb5823e829 (diff)
downloadvyos-1x-ed6e1f556b290231f1683a06ec366dbeb4c0776a.tar.gz
vyos-1x-ed6e1f556b290231f1683a06ec366dbeb4c0776a.zip
interfaces: dhcp-client: T2997: add option to not request DHCP router address
Some might want to have an IP address handed out by a DHCP server but not want a default route to be installed. This can be done using the CLI command: "set interfaces ethernet eth2 dhcp-options no-default-route"
-rw-r--r--data/templates/dhcp-client/ipv4.tmpl7
-rw-r--r--interface-definitions/include/dhcp-options.xml.i12
2 files changed, 15 insertions, 4 deletions
diff --git a/data/templates/dhcp-client/ipv4.tmpl b/data/templates/dhcp-client/ipv4.tmpl
index 8a44a9761..71b429db6 100644
--- a/data/templates/dhcp-client/ipv4.tmpl
+++ b/data/templates/dhcp-client/ipv4.tmpl
@@ -12,8 +12,13 @@ interface "{{ ifname }}" {
{% if dhcp_options.vendor_class_id is defined and dhcp_options.vendor_class_id is not none %}
send vendor-class-identifier "{{ dhcp_options.vendor_class_id }}";
{% endif %}
- request subnet-mask, broadcast-address, routers, domain-name-servers,
+ # The request statement causes the client to request that any server responding to the
+ # client send the client its values for the specified options.
+ request subnet-mask, broadcast-address,{{ " routers," if dhcp_options.no_default_route is not defined }} domain-name-servers,
rfc3442-classless-static-routes, domain-name, interface-mtu;
+
+ # 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;
}
diff --git a/interface-definitions/include/dhcp-options.xml.i b/interface-definitions/include/dhcp-options.xml.i
index e33022361..df9c7a97a 100644
--- a/interface-definitions/include/dhcp-options.xml.i
+++ b/interface-definitions/include/dhcp-options.xml.i
@@ -6,17 +6,23 @@
<children>
<leafNode name="client-id">
<properties>
- <help>DHCP client identifier</help>
+ <help>Identifier used by client to identify itself to the DHCP server</help>
</properties>
</leafNode>
<leafNode name="host-name">
<properties>
- <help>DHCP client host name (overrides system host name)</help>
+ <help>Override system host-name sent to DHCP server</help>
</properties>
</leafNode>
<leafNode name="vendor-class-id">
<properties>
- <help>DHCP client vendor type</help>
+ <help>Identify the vendor client type to the DHCP server</help>
+ </properties>
+ </leafNode>
+ <leafNode name="no-default-route">
+ <properties>
+ <help>Do not request routers from DHCP server</help>
+ <valueless/>
</properties>
</leafNode>
</children>