pub trait SettingIPConfigExt: IsA<SettingIPConfig> + 'static {
Show 92 methods
// Provided methods
fn add_address(&self, address: &IPAddress) -> bool { ... }
fn add_dns(&self, dns: &str) -> bool { ... }
fn add_dns_option(&self, dns_option: &str) -> bool { ... }
fn add_dns_search(&self, dns_search: &str) -> bool { ... }
fn add_route(&self, route: &IPRoute) -> bool { ... }
fn add_routing_rule(&self, routing_rule: &IPRoutingRule) { ... }
fn clear_addresses(&self) { ... }
fn clear_dns(&self) { ... }
fn clear_dns_options(&self, is_set: bool) { ... }
fn clear_dns_searches(&self) { ... }
fn clear_routes(&self) { ... }
fn clear_routing_rules(&self) { ... }
fn address(&self, idx: i32) -> IPAddress { ... }
fn auto_route_ext_gw(&self) -> Ternary { ... }
fn dad_timeout(&self) -> i32 { ... }
fn dhcp_hostname(&self) -> GString { ... }
fn dhcp_iaid(&self) -> GString { ... }
fn is_dhcp_send_hostname(&self) -> bool { ... }
fn dhcp_timeout(&self) -> i32 { ... }
fn dns(&self, idx: i32) -> GString { ... }
fn dns_option(&self, idx: u32) -> GString { ... }
fn dns_priority(&self) -> i32 { ... }
fn dns_search(&self, idx: i32) -> GString { ... }
fn gateway(&self) -> GString { ... }
fn ignores_auto_dns(&self) -> bool { ... }
fn ignores_auto_routes(&self) -> bool { ... }
fn is_may_fail(&self) -> bool { ... }
fn method(&self) -> GString { ... }
fn is_never_default(&self) -> bool { ... }
fn num_addresses(&self) -> u32 { ... }
fn num_dns(&self) -> u32 { ... }
fn num_dns_options(&self) -> u32 { ... }
fn num_dns_searches(&self) -> u32 { ... }
fn num_routes(&self) -> u32 { ... }
fn num_routing_rules(&self) -> u32 { ... }
fn route(&self, idx: i32) -> IPRoute { ... }
fn route_metric(&self) -> i64 { ... }
fn route_table(&self) -> u32 { ... }
fn routing_rule(&self, idx: u32) -> IPRoutingRule { ... }
fn has_dns_options(&self) -> bool { ... }
fn remove_address(&self, idx: i32) { ... }
fn remove_address_by_value(&self, address: &IPAddress) -> bool { ... }
fn remove_dns(&self, idx: i32) { ... }
fn remove_dns_by_value(&self, dns: &str) -> bool { ... }
fn remove_dns_option(&self, idx: i32) { ... }
fn remove_dns_option_by_value(&self, dns_option: &str) -> bool { ... }
fn remove_dns_search(&self, idx: i32) { ... }
fn remove_dns_search_by_value(&self, dns_search: &str) -> bool { ... }
fn remove_route(&self, idx: i32) { ... }
fn remove_route_by_value(&self, route: &IPRoute) -> bool { ... }
fn remove_routing_rule(&self, idx: u32) { ... }
fn addresses(&self) -> Vec<IPAddress> { ... }
fn set_addresses(&self, addresses: &[&IPAddress]) { ... }
fn set_auto_route_ext_gw(&self, auto_route_ext_gw: Ternary) { ... }
fn set_dad_timeout(&self, dad_timeout: i32) { ... }
fn set_dhcp_hostname(&self, dhcp_hostname: Option<&str>) { ... }
fn set_dhcp_send_hostname(&self, dhcp_send_hostname: bool) { ... }
fn set_dhcp_timeout(&self, dhcp_timeout: i32) { ... }
fn set_dns(&self, dns: &[&str]) { ... }
fn dns_options(&self) -> Vec<GString> { ... }
fn set_dns_options(&self, dns_options: &[&str]) { ... }
fn set_dns_priority(&self, dns_priority: i32) { ... }
fn set_dns_search(&self, dns_search: &[&str]) { ... }
fn set_gateway(&self, gateway: Option<&str>) { ... }
fn set_ignore_auto_dns(&self, ignore_auto_dns: bool) { ... }
fn set_ignore_auto_routes(&self, ignore_auto_routes: bool) { ... }
fn set_may_fail(&self, may_fail: bool) { ... }
fn set_method(&self, method: Option<&str>) { ... }
fn set_never_default(&self, never_default: bool) { ... }
fn set_route_metric(&self, route_metric: i64) { ... }
fn set_route_table(&self, route_table: u32) { ... }
fn routes(&self) -> Vec<IPRoute> { ... }
fn set_routes(&self, routes: &[&IPRoute]) { ... }
fn connect_addresses_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_auto_route_ext_gw_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_dad_timeout_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_dhcp_hostname_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_dhcp_send_hostname_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_dhcp_timeout_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_dns_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_dns_options_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_dns_priority_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_dns_search_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_gateway_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_ignore_auto_dns_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_ignore_auto_routes_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_may_fail_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_method_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_never_default_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_route_metric_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_route_table_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
fn connect_routes_notify<F: Fn(&Self) + 'static>(
&self,
f: F,
) -> SignalHandlerId { ... }
}Expand description
Trait containing all SettingIPConfig methods.
§Implementors
Provided Methods§
Sourcefn add_address(&self, address: &IPAddress) -> bool
fn add_address(&self, address: &IPAddress) -> bool
Sourcefn add_dns(&self, dns: &str) -> bool
fn add_dns(&self, dns: &str) -> bool
Adds a new DNS server to the setting.
§dns
the IP address of the DNS server to add
§Returns
true if the DNS server was added; false if the server was already
known
Before 1.42, setting @dns to an invalid string was treated as user-error. Now, also invalid DNS values can be set, but will be rejected later during nm_connection_verify().
Sourcefn add_dns_option(&self, dns_option: &str) -> bool
Available on crate feature v1_2 only.
fn add_dns_option(&self, dns_option: &str) -> bool
v1_2 only.Sourcefn add_dns_search(&self, dns_search: &str) -> bool
fn add_dns_search(&self, dns_search: &str) -> bool
Sourcefn add_route(&self, route: &IPRoute) -> bool
fn add_route(&self, route: &IPRoute) -> bool
Appends a new route and associated information to the setting. The
given route is duplicated internally and is not changed by this function.
If an identical route (considering attributes as well) already exists, the
route is not added and the function returns false.
Note that before 1.10, this function would not consider route attributes and not add a route that has an existing route with same dest/prefix,next_hop,metric parameters.
§route
the route to add
§Returns
true if the route was added; false if the route was already known.
Sourcefn add_routing_rule(&self, routing_rule: &IPRoutingRule)
Available on crate feature v1_18 only.
fn add_routing_rule(&self, routing_rule: &IPRoutingRule)
v1_18 only.Appends a new routing-rule and associated information to the setting. The given routing rules gets sealed and the reference count is incremented. The function does not check whether an identical rule already exists and always appends the rule to the end of the list.
§routing_rule
the #NMIPRoutingRule to add. The address family of the added rule must be compatible with the setting.
Sourcefn clear_addresses(&self)
fn clear_addresses(&self)
Removes all configured addresses.
Sourcefn clear_dns_options(&self, is_set: bool)
Available on crate feature v1_2 only.
fn clear_dns_options(&self, is_set: bool)
v1_2 only.Removes all configured DNS options.
§is_set
the dns-options can be either empty or unset (default). Specify how to clear the options.
Sourcefn clear_dns_searches(&self)
fn clear_dns_searches(&self)
Removes all configured DNS search domains.
Sourcefn clear_routes(&self)
fn clear_routes(&self)
Removes all configured routes.
Sourcefn clear_routing_rules(&self)
Available on crate feature v1_18 only.
fn clear_routing_rules(&self)
v1_18 only.Removes all configured routing rules.
Sourcefn auto_route_ext_gw(&self) -> Ternary
Available on crate feature v1_42 only.
fn auto_route_ext_gw(&self) -> Ternary
v1_42 only.§Returns
the #NMSettingIPConfig:auto-route-ext-gw property of the setting
Sourcefn dad_timeout(&self) -> i32
Available on crate feature v1_2 only.
fn dad_timeout(&self) -> i32
v1_2 only.§Returns
the #NMSettingIPConfig:dad-timeout property.
Sourcefn dhcp_hostname(&self) -> GString
fn dhcp_hostname(&self) -> GString
Returns the value contained in the #NMSettingIPConfig:dhcp-hostname property.
§Returns
the configured hostname to send to the DHCP server
Sourcefn dhcp_iaid(&self) -> GString
Available on crate feature v1_42 only.
fn dhcp_iaid(&self) -> GString
v1_42 only.Returns the value contained in the #NMSettingIPConfig:dhcp-iaid property.
§Returns
the configured DHCP IAID (Identity Association Identifier)
Sourcefn is_dhcp_send_hostname(&self) -> bool
fn is_dhcp_send_hostname(&self) -> bool
Returns the value contained in the #NMSettingIPConfig:dhcp-send-hostname property.
§Deprecated since 1.52
Use nm_setting_ip_config_get_dhcp_send_hostname_v2() instead.
§Returns
true if NetworkManager should send the machine hostname to the
DHCP server when requesting addresses to allow the server to automatically
update DNS information for this machine.
Sourcefn dhcp_timeout(&self) -> i32
Available on crate feature v1_2 only.
fn dhcp_timeout(&self) -> i32
v1_2 only.Returns the value contained in the #NMSettingIPConfig:dhcp-timeout property.
§Returns
the configured DHCP timeout in seconds. 0 = default for the particular kind of device.
Sourcefn dns_option(&self, idx: u32) -> GString
Available on crate feature v1_2 only.
fn dns_option(&self, idx: u32) -> GString
v1_2 only.Sourcefn dns_priority(&self) -> i32
Available on crate feature v1_4 only.
fn dns_priority(&self) -> i32
v1_4 only.§Returns
the priority of DNS servers
Sourcefn dns_search(&self, idx: i32) -> GString
fn dns_search(&self, idx: i32) -> GString
Sourcefn ignores_auto_dns(&self) -> bool
fn ignores_auto_dns(&self) -> bool
Sourcefn ignores_auto_routes(&self) -> bool
fn ignores_auto_routes(&self) -> bool
Sourcefn is_may_fail(&self) -> bool
fn is_may_fail(&self) -> bool
Sourcefn method(&self) -> GString
fn method(&self) -> GString
§Returns
the #NMSettingIPConfig:method property of the setting; see #NMSettingIP4Config and #NMSettingIP6Config for details of the methods available with each type.
Sourcefn is_never_default(&self) -> bool
fn is_never_default(&self) -> bool
Sourcefn num_addresses(&self) -> u32
fn num_addresses(&self) -> u32
§Returns
the number of configured addresses
Sourcefn num_dns_options(&self) -> u32
Available on crate feature v1_2 only.
fn num_dns_options(&self) -> u32
v1_2 only.§Returns
the number of configured DNS options
Sourcefn num_dns_searches(&self) -> u32
fn num_dns_searches(&self) -> u32
§Returns
the number of configured DNS search domains
Sourcefn num_routes(&self) -> u32
fn num_routes(&self) -> u32
§Returns
the number of configured routes
Sourcefn num_routing_rules(&self) -> u32
Available on crate feature v1_18 only.
fn num_routing_rules(&self) -> u32
v1_18 only.§Returns
the number of configured routing rules
Sourcefn route_metric(&self) -> i64
fn route_metric(&self) -> i64
Returns the value contained in the #NMSettingIPConfig:route-metric property.
§Returns
the route metric that is used for routes that don’t explicitly specify a metric. See #NMSettingIPConfig:route-metric for more details.
Sourcefn route_table(&self) -> u32
Available on crate feature v1_10 only.
fn route_table(&self) -> u32
v1_10 only.Returns the value contained in the #NMSettingIPConfig:route-table property.
§Returns
the configured route-table.
Sourcefn routing_rule(&self, idx: u32) -> IPRoutingRule
Available on crate feature v1_18 only.
fn routing_rule(&self, idx: u32) -> IPRoutingRule
v1_18 only.Sourcefn has_dns_options(&self) -> bool
Available on crate feature v1_2 only.
fn has_dns_options(&self) -> bool
v1_2 only.NMSettingIPConfig can have a list of dns-options. If the list is empty, there are two similar (but differentiated) states. Either the options are explicitly set to have no values, or the options are left undefined. The latter means to use a default configuration, while the former explicitly means “no-options”.
§Returns
whether DNS options are initialized or left unset (the default).
Sourcefn remove_address(&self, idx: i32)
fn remove_address(&self, idx: i32)
Sourcefn remove_address_by_value(&self, address: &IPAddress) -> bool
fn remove_address_by_value(&self, address: &IPAddress) -> bool
Sourcefn remove_dns(&self, idx: i32)
fn remove_dns(&self, idx: i32)
Sourcefn remove_dns_by_value(&self, dns: &str) -> bool
fn remove_dns_by_value(&self, dns: &str) -> bool
Sourcefn remove_dns_option(&self, idx: i32)
Available on crate feature v1_2 only.
fn remove_dns_option(&self, idx: i32)
v1_2 only.Sourcefn remove_dns_option_by_value(&self, dns_option: &str) -> bool
Available on crate feature v1_2 only.
fn remove_dns_option_by_value(&self, dns_option: &str) -> bool
v1_2 only.Sourcefn remove_dns_search(&self, idx: i32)
fn remove_dns_search(&self, idx: i32)
Sourcefn remove_dns_search_by_value(&self, dns_search: &str) -> bool
fn remove_dns_search_by_value(&self, dns_search: &str) -> bool
Sourcefn remove_route(&self, idx: i32)
fn remove_route(&self, idx: i32)
Sourcefn remove_route_by_value(&self, route: &IPRoute) -> bool
fn remove_route_by_value(&self, route: &IPRoute) -> bool
Sourcefn remove_routing_rule(&self, idx: u32)
Available on crate feature v1_18 only.
fn remove_routing_rule(&self, idx: u32)
v1_18 only.Sourcefn set_addresses(&self, addresses: &[&IPAddress])
fn set_addresses(&self, addresses: &[&IPAddress])
Array of IP addresses.
Sourcefn set_auto_route_ext_gw(&self, auto_route_ext_gw: Ternary)
Available on crate feature v1_42 only.
fn set_auto_route_ext_gw(&self, auto_route_ext_gw: Ternary)
v1_42 only.Sourcefn set_dad_timeout(&self, dad_timeout: i32)
Available on crate feature v1_2 only.
fn set_dad_timeout(&self, dad_timeout: i32)
v1_2 only.Maximum timeout in milliseconds used to check for the presence of duplicate IP addresses on the network. If an address conflict is detected, the activation will fail. The property is currently implemented only for IPv4.
A zero value means that no duplicate address detection is performed, -1 means the default value (either the value configured globally in NetworkManger.conf or 200ms). A value greater than zero is a timeout in milliseconds. Note that the time intervals are subject to randomization as per RFC 5227 and so the actual duration can be between half and the full time specified in this property.
Sourcefn set_dhcp_hostname(&self, dhcp_hostname: Option<&str>)
fn set_dhcp_hostname(&self, dhcp_hostname: Option<&str>)
If the #NMSettingIPConfig:dhcp-send-hostname property is true, then the
specified name will be sent to the DHCP server when acquiring a lease.
This property and #NMSettingIP4Config:dhcp-fqdn are mutually exclusive and
cannot be set at the same time.
Sourcefn set_dhcp_send_hostname(&self, dhcp_send_hostname: bool)
fn set_dhcp_send_hostname(&self, dhcp_send_hostname: bool)
Since 1.52 this property is deprecated and is only used as fallback value for #NMSettingIPConfig:dhcp-send-hostname-v2 if it’s set to ‘default’. This is only done to avoid breaking existing configurations, the new property should be used from now on.
§Deprecated since 1.52
use the new version of dhcp-send-hostname instead.
Sourcefn set_dhcp_timeout(&self, dhcp_timeout: i32)
fn set_dhcp_timeout(&self, dhcp_timeout: i32)
A timeout for a DHCP transaction in seconds. If zero (the default), a globally configured default is used. If still unspecified, a device specific timeout is used (usually 45 seconds).
Set to 2147483647 (MAXINT32) for infinity.
Sourcefn set_dns(&self, dns: &[&str])
fn set_dns(&self, dns: &[&str])
Array of DNS servers.
Each server can be specified either as a plain IP address (optionally followed by a “#” and the SNI server name for DNS over TLS) or with a URI syntax.
When it is specified as an URI, the following forms are supported: dns+udp://ADDRESS[:PORT], dns+tls://ADDRESS[:PORT][#SERVERNAME] .
When using the URI syntax, IPv6 addresses must be enclosed in square brackets (‘[’, ‘]’).
Sourcefn dns_options(&self) -> Vec<GString>
Available on crate feature v1_2 only.
fn dns_options(&self) -> Vec<GString>
v1_2 only.Array of DNS options to be added to resolv.conf.
None means that the options are unset and left at the default.
In this case NetworkManager will use default options. This is
distinct from an empty list of properties.
The following options are directly added to resolv.conf: “attempts”, “debug”, “edns0”, “inet6”, “ip6-bytestring”, “ip6-dotint”, “ndots”, “no-aaaa”, “no-check-names”, “no-ip6-dotint”, “no-reload”, “no-tld-query”, “rotate”, “single-request”, “single-request-reopen”, “timeout”, “trust-ad”, “use-vc”. See the resolv.conf(5) man page for a detailed description of these options.
In addition, NetworkManager supports the special options “_no-add-edns0” and “_no-add-trust-ad”. They are not added to resolv.conf, and can be used to prevent the automatic addition of options “edns0” and “trust-ad” when using caching DNS plugins (see below).
The “trust-ad” setting is only honored if the profile contributes name servers to resolv.conf, and if all contributing profiles have “trust-ad” enabled.
When using a caching DNS plugin (dnsmasq or systemd-resolved in NetworkManager.conf) then “edns0” and “trust-ad” are automatically added, unless “_no-add-edns0” and “_no-add-trust-ad” are present.
Sourcefn set_dns_options(&self, dns_options: &[&str])
Available on crate feature v1_2 only.
fn set_dns_options(&self, dns_options: &[&str])
v1_2 only.Array of DNS options to be added to resolv.conf.
None means that the options are unset and left at the default.
In this case NetworkManager will use default options. This is
distinct from an empty list of properties.
The following options are directly added to resolv.conf: “attempts”, “debug”, “edns0”, “inet6”, “ip6-bytestring”, “ip6-dotint”, “ndots”, “no-aaaa”, “no-check-names”, “no-ip6-dotint”, “no-reload”, “no-tld-query”, “rotate”, “single-request”, “single-request-reopen”, “timeout”, “trust-ad”, “use-vc”. See the resolv.conf(5) man page for a detailed description of these options.
In addition, NetworkManager supports the special options “_no-add-edns0” and “_no-add-trust-ad”. They are not added to resolv.conf, and can be used to prevent the automatic addition of options “edns0” and “trust-ad” when using caching DNS plugins (see below).
The “trust-ad” setting is only honored if the profile contributes name servers to resolv.conf, and if all contributing profiles have “trust-ad” enabled.
When using a caching DNS plugin (dnsmasq or systemd-resolved in NetworkManager.conf) then “edns0” and “trust-ad” are automatically added, unless “_no-add-edns0” and “_no-add-trust-ad” are present.
Sourcefn set_dns_priority(&self, dns_priority: i32)
Available on crate feature v1_4 only.
fn set_dns_priority(&self, dns_priority: i32)
v1_4 only.DNS servers priority.
The relative priority for DNS servers specified by this setting. A lower numerical value is better (higher priority).
Negative values have the special effect of excluding other configurations with a greater numerical priority value; so in presence of at least one negative priority, only DNS servers from connections with the lowest priority value will be used. To avoid all DNS leaks, set the priority of the profile that should be used to the most negative value of all active connections profiles.
Zero selects a globally configured default value. If the latter is missing or zero too, it defaults to 50 for VPNs (including WireGuard) and 100 for other connections.
Note that the priority is to order DNS settings for multiple active connections. It does not disambiguate multiple DNS servers within the same connection profile.
When multiple devices have configurations with the same priority, VPNs will be considered first, then devices with the best (lowest metric) default route and then all other devices.
When using dns=default, servers with higher priority will be on top of resolv.conf. To prioritize a given server over another one within the same connection, just specify them in the desired order. Note that commonly the resolver tries name servers in /etc/resolv.conf in the order listed, proceeding with the next server in the list on failure. See for example the “rotate” option of the dns-options setting. If there are any negative DNS priorities, then only name servers from the devices with that lowest priority will be considered.
When using a DNS resolver that supports Conditional Forwarding or Split DNS (with dns=dnsmasq or dns=systemd-resolved settings), each connection is used to query domains in its search list. The search domains determine which name servers to ask, and the DNS priority is used to prioritize name servers based on the domain. Queries for domains not present in any search list are routed through connections having the ‘~.’ special wildcard domain, which is added automatically to connections with the default route (or can be added manually). When multiple connections specify the same domain, the one with the best priority (lowest numerical value) wins. If a sub domain is configured on another interface it will be accepted regardless the priority, unless parent domain on the other interface has a negative priority, which causes the sub domain to be shadowed. With Split DNS one can avoid undesired DNS leaks by properly configuring DNS priorities and the search domains, so that only name servers of the desired interface are configured.
Sourcefn set_dns_search(&self, dns_search: &[&str])
fn set_dns_search(&self, dns_search: &[&str])
List of DNS search domains. Domains starting with a tilde (‘~’) are considered ‘routing’ domains and are used only to decide the interface over which a query must be forwarded; they are not used to complete unqualified host names.
When using a DNS plugin that supports Conditional Forwarding or Split DNS, then the search domains specify which name servers to query. This makes the behavior different from running with plain /etc/resolv.conf. For more information see also the dns-priority setting.
When set on a profile that also enabled DHCP, the DNS search list received automatically (option 119 for DHCPv4 and option 24 for DHCPv6) gets merged with the manual list. This can be prevented by setting “ignore-auto-dns”. Note that if no DNS searches are configured, the fallback will be derived from the domain from DHCP (option 15).
Sourcefn set_gateway(&self, gateway: Option<&str>)
fn set_gateway(&self, gateway: Option<&str>)
The gateway associated with this configuration. This is only meaningful if #NMSettingIPConfig:addresses is also set.
Setting the gateway causes NetworkManager to configure a standard default route with the gateway as next hop. This is ignored if #NMSettingIPConfig:never-default is set. An alternative is to configure the default route explicitly with a manual route and /0 as prefix length.
Note that the gateway usually conflicts with routing that NetworkManager configures for WireGuard interfaces, so usually it should not be set in that case. See #NMSettingWireGuard:ip4-auto-default-route.
Sourcefn set_ignore_auto_dns(&self, ignore_auto_dns: bool)
fn set_ignore_auto_dns(&self, ignore_auto_dns: bool)
When #NMSettingIPConfig:method is set to “auto” and this property to
true, automatically configured name servers and search domains are
ignored and only name servers and search domains specified in the
#NMSettingIPConfig:dns and #NMSettingIPConfig:dns-search properties, if
any, are used.
Sourcefn set_ignore_auto_routes(&self, ignore_auto_routes: bool)
fn set_ignore_auto_routes(&self, ignore_auto_routes: bool)
When #NMSettingIPConfig:method is set to “auto” and this property to
true, automatically configured routes are ignored and only routes
specified in the #NMSettingIPConfig:routes property, if any, are used.
Sourcefn set_may_fail(&self, may_fail: bool)
fn set_may_fail(&self, may_fail: bool)
If true, allow overall network configuration to proceed even if the
configuration specified by this property times out. Note that at least
one IP configuration must succeed or overall network configuration will
still fail. For example, in IPv6-only networks, setting this property to
true on the #NMSettingIP4Config allows the overall network configuration
to succeed if IPv4 configuration fails but IPv6 configuration completes
successfully.
Sourcefn set_method(&self, method: Option<&str>)
fn set_method(&self, method: Option<&str>)
IP configuration method.
#NMSettingIP4Config and #NMSettingIP6Config both support “disabled”, “auto”, “manual”, and “link-local”. See the subclass-specific documentation for other values.
In general, for the “auto” method, properties such as #NMSettingIPConfig:dns and #NMSettingIPConfig:routes specify information that is added on to the information returned from automatic configuration. The #NMSettingIPConfig:ignore-auto-routes and #NMSettingIPConfig:ignore-auto-dns properties modify this behavior.
For methods that imply no upstream network, such as “shared” or “link-local”, these properties must be empty.
For IPv4 method “shared”, the IP subnet can be configured by adding one manual IPv4 address or otherwise 10.42.x.0/24 is chosen. Note that the shared method must be configured on the interface which shares the internet to a subnet, not on the uplink which is shared.
Sourcefn set_never_default(&self, never_default: bool)
fn set_never_default(&self, never_default: bool)
If true, this connection will never be the default connection for this
IP type, meaning it will never be assigned the default route by
NetworkManager.
Sourcefn set_route_metric(&self, route_metric: i64)
fn set_route_metric(&self, route_metric: i64)
The default metric for routes that don’t explicitly specify a metric. The default value -1 means that the metric is chosen automatically based on the device type. The metric applies to dynamic routes, manual (static) routes that don’t have an explicit metric setting, address prefix routes, and the default route. Note that for IPv6, the kernel accepts zero (0) but coerces it to 1024 (user default). Hence, setting this property to zero effectively mean setting it to 1024. For IPv4, zero is a regular value for the metric.
Sourcefn set_route_table(&self, route_table: u32)
Available on crate feature v1_10 only.
fn set_route_table(&self, route_table: u32)
v1_10 only.Enable policy routing (source routing) and set the routing table used when adding routes.
This affects all routes, including device-routes, IPv4LL, DHCP, SLAAC, default-routes and static routes. But note that static routes can individually overwrite the setting by explicitly specifying a non-zero routing table.
If the table setting is left at zero, it is eligible to be overwritten via global configuration. If the property is zero even after applying the global configuration value, policy routing is disabled for the address family of this connection.
Policy routing disabled means that NetworkManager will add all routes to the main table (except static routes that explicitly configure a different table). Additionally, NetworkManager will not delete any extraneous routes from tables except the main table. This is to preserve backward compatibility for users who manage routing tables outside of NetworkManager.
Sourcefn set_routes(&self, routes: &[&IPRoute])
fn set_routes(&self, routes: &[&IPRoute])
Array of IP routes.
fn connect_addresses_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_auto_route_ext_gw_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
v1_42 only.fn connect_dad_timeout_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
v1_2 only.fn connect_dhcp_hostname_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_dhcp_send_hostname_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_dhcp_timeout_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_dns_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_dns_options_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
v1_2 only.fn connect_dns_priority_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
v1_4 only.fn connect_dns_search_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_gateway_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_ignore_auto_dns_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_ignore_auto_routes_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_may_fail_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_method_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
fn connect_never_default_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_route_metric_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
fn connect_route_table_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId
v1_10 only.fn connect_routes_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.