Closes #15117.
"link" scope will be used. For anything else, scope defaults to "global".</para>
</listitem>
</varlistentry>
-
+ <varlistentry>
+ <term><varname>UseGateway=</varname></term>
+ <listitem>
+ <para>When true (the default), the gateway will be requested from the DHCP server and added to the
+ routing table with a metric of 1024, and a scope of "link".</para>
+ </listitem>
+ </varlistentry>
<varlistentry>
<term><varname>UseTimezone=</varname></term>
}
}
+ if (!link->network->dhcp_use_gateway)
+ return 0;
+
r = sd_dhcp_lease_get_router(link->dhcp_lease, &router);
if (IN_SET(r, 0, -ENODATA))
log_link_info(link, "DHCP: No gateway received from DHCP server.");
assert(link);
assert(address);
- if (!link->network->dhcp_use_routes)
+ if (!link->network->dhcp_use_gateway)
return 0;
r = sd_dhcp_lease_get_router(lease, &router);
DHCPv4.UseHostname, config_parse_bool, 0, offsetof(Network, dhcp_use_hostname)
DHCPv4.UseDomains, config_parse_dhcp_use_domains, 0, offsetof(Network, dhcp_use_domains)
DHCPv4.UseRoutes, config_parse_bool, 0, offsetof(Network, dhcp_use_routes)
+DHCPv4.UseGateway, config_parse_bool, 0, offsetof(Network, dhcp_use_gateway)
DHCPv4.RequestOptions, config_parse_dhcp_request_options, 0, 0
DHCPv4.Anonymize, config_parse_bool, 0, offsetof(Network, dhcp_anonymize)
DHCPv4.SendHostname, config_parse_bool, 0, offsetof(Network, dhcp_send_hostname)
.dhcp_use_dns = true,
.dhcp_use_hostname = true,
.dhcp_use_routes = true,
+ .dhcp_use_gateway = true,
/* NOTE: this var might be overwritten by network_apply_anonymize_if_set */
.dhcp_send_hostname = true,
.dhcp_send_release = true,
bool dhcp_use_sip;
bool dhcp_use_mtu;
bool dhcp_use_routes;
+ bool dhcp_use_gateway;
bool dhcp_use_timezone;
bool rapid_commit;
bool dhcp_use_hostname;
RoutesToDNS=
UseDomains=
UseRoutes=
+UseGateway=
IAID=
UserClass=
UseNTP=