From ed6e1f556b290231f1683a06ec366dbeb4c0776a Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sat, 7 Nov 2020 21:30:31 +0100 Subject: 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" --- data/templates/dhcp-client/ipv4.tmpl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'data/templates') 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; } -- cgit v1.2.3