SettingIPConfigExt

Trait SettingIPConfigExt 

Source
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

SettingIP4Config, SettingIP6Config, SettingIPConfig

Provided Methods§

Source

fn add_address(&self, address: &IPAddress) -> bool

Adds a new IP address and associated information to the setting. The given address is duplicated internally and is not changed by this function.

§address

the new address to add

§Returns

true if the address was added; false if the address was already known.

Source

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().

Source

fn add_dns_option(&self, dns_option: &str) -> bool

Available on crate feature v1_2 only.

Adds a new DNS option to the setting.

§dns_option

the DNS option to add

§Returns

true if the DNS option was added; false otherwise

Adds a new DNS search domain to the setting.

the search domain to add

§Returns

true if the DNS search domain was added; false if the search domain was already known

Source

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.

Source

fn add_routing_rule(&self, routing_rule: &IPRoutingRule)

Available on crate feature 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.

Source

fn clear_addresses(&self)

Removes all configured addresses.

Source

fn clear_dns(&self)

Removes all configured DNS servers.

Source

fn clear_dns_options(&self, is_set: bool)

Available on crate feature 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.

Source

fn clear_dns_searches(&self)

Removes all configured DNS search domains.

Source

fn clear_routes(&self)

Removes all configured routes.

Source

fn clear_routing_rules(&self)

Available on crate feature v1_18 only.

Removes all configured routing rules.

Source

fn address(&self, idx: i32) -> IPAddress

§idx

index number of the address to return

§Returns

the address at index @idx

Source

fn auto_route_ext_gw(&self) -> Ternary

Available on crate feature v1_42 only.
§Returns

the #NMSettingIPConfig:auto-route-ext-gw property of the setting

Source

fn dad_timeout(&self) -> i32

Available on crate feature v1_2 only.
§Returns

the #NMSettingIPConfig:dad-timeout property.

Source

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

Source

fn dhcp_iaid(&self) -> GString

Available on crate feature v1_42 only.

Returns the value contained in the #NMSettingIPConfig:dhcp-iaid property.

§Returns

the configured DHCP IAID (Identity Association Identifier)

Source

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.

Source

fn dhcp_timeout(&self) -> i32

Available on crate feature 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.

Source

fn dns(&self, idx: i32) -> GString

§idx

index number of the DNS server to return

§Returns

the IP address of the DNS server at index @idx

Source

fn dns_option(&self, idx: u32) -> GString

Available on crate feature v1_2 only.

Since 1.46, access at index “len” is allowed and returns NULL.

§idx

index number of the DNS option

§Returns

the DNS option at index @idx

Source

fn dns_priority(&self) -> i32

Available on crate feature v1_4 only.
§Returns

the priority of DNS servers

Since 1.46, access at index “len” is allowed and returns NULL.

§idx

index number of the DNS search domain to return

§Returns

the DNS search domain at index @idx

Source

fn gateway(&self) -> GString

§Returns

the IP address of the gateway associated with this configuration, or None.

Source

fn ignores_auto_dns(&self) -> bool

Returns the value contained in the #NMSettingIPConfig:ignore-auto-dns property.

§Returns

true if automatically configured (ie via DHCP) DNS information should be ignored.

Source

fn ignores_auto_routes(&self) -> bool

Returns the value contained in the #NMSettingIPConfig:ignore-auto-routes property.

§Returns

true if automatically configured (ie via DHCP) routes should be ignored.

Source

fn is_may_fail(&self) -> bool

Returns the value contained in the #NMSettingIPConfig:may-fail property.

§Returns

true if this connection doesn’t require this type of IP addressing to complete for the connection to succeed.

Source

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.

Source

fn is_never_default(&self) -> bool

Returns the value contained in the #NMSettingIPConfig:never-default property.

§Returns

true if this connection should never be the default connection

Source

fn num_addresses(&self) -> u32

§Returns

the number of configured addresses

Source

fn num_dns(&self) -> u32

§Returns

the number of configured DNS servers

Source

fn num_dns_options(&self) -> u32

Available on crate feature v1_2 only.
§Returns

the number of configured DNS options

Source

fn num_dns_searches(&self) -> u32

§Returns

the number of configured DNS search domains

Source

fn num_routes(&self) -> u32

§Returns

the number of configured routes

Source

fn num_routing_rules(&self) -> u32

Available on crate feature v1_18 only.
§Returns

the number of configured routing rules

Source

fn route(&self, idx: i32) -> IPRoute

§idx

index number of the route to return

§Returns

the route at index @idx

Source

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.

Source

fn route_table(&self) -> u32

Available on crate feature v1_10 only.

Returns the value contained in the #NMSettingIPConfig:route-table property.

§Returns

the configured route-table.

Source

fn routing_rule(&self, idx: u32) -> IPRoutingRule

Available on crate feature v1_18 only.
§idx

index number of the routing_rule to return

§Returns

the routing rule at index @idx

Source

fn has_dns_options(&self) -> bool

Available on crate feature 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).

Source

fn remove_address(&self, idx: i32)

Removes the address at index @idx.

§idx

index number of the address to remove

Source

fn remove_address_by_value(&self, address: &IPAddress) -> bool

Removes the address @address.

§address

the IP address to remove

§Returns

true if the address was found and removed; false if it was not.

Source

fn remove_dns(&self, idx: i32)

Removes the DNS server at index @idx.

§idx

index number of the DNS server to remove

Source

fn remove_dns_by_value(&self, dns: &str) -> bool

Removes the DNS server @dns.

§dns

the DNS server to remove

§Returns

true if the DNS server was found and removed; false if it was not.

Before 1.42, setting @dns to an invalid string was treated as user-error.

Source

fn remove_dns_option(&self, idx: i32)

Available on crate feature v1_2 only.

Removes the DNS option at index @idx.

§idx

index number of the DNS option

Source

fn remove_dns_option_by_value(&self, dns_option: &str) -> bool

Available on crate feature v1_2 only.

Removes the DNS option @dns_option.

§dns_option

the DNS option to remove

§Returns

true if the DNS option was found and removed; false if it was not.

Removes the DNS search domain at index @idx.

§idx

index number of the DNS search domain

Source

fn remove_dns_search_by_value(&self, dns_search: &str) -> bool

Removes the DNS search domain @dns_search.

§dns_search

the search domain to remove

§Returns

true if the DNS search domain was found and removed; false if it was not.

Source

fn remove_route(&self, idx: i32)

Removes the route at index @idx.

§idx

index number of the route

Source

fn remove_route_by_value(&self, route: &IPRoute) -> bool

Removes the first matching route that matches @route. Note that before 1.10, this function would only compare dest/prefix,next_hop,metric and ignore route attributes. Now, @route must match exactly.

§route

the route to remove

§Returns

true if the route was found and removed; false if it was not.

Source

fn remove_routing_rule(&self, idx: u32)

Available on crate feature v1_18 only.

Removes the routing_rule at index @idx.

§idx

index number of the routing_rule

Source

fn addresses(&self) -> Vec<IPAddress>

Array of IP addresses.

Source

fn set_addresses(&self, addresses: &[&IPAddress])

Array of IP addresses.

Source

fn set_auto_route_ext_gw(&self, auto_route_ext_gw: Ternary)

Available on crate feature v1_42 only.

VPN connections will default to add the route automatically unless this setting is set to false.

For other connection types, adding such an automatic route is currently not supported and setting this to true has no effect.

Source

fn set_dad_timeout(&self, dad_timeout: i32)

Available on crate feature 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.

Source

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.

Source

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.

Source

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.

Source

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 (‘[’, ‘]’).

Source

fn dns_options(&self) -> Vec<GString>

Available on crate feature 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.

Source

fn set_dns_options(&self, dns_options: &[&str])

Available on crate feature 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.

Source

fn set_dns_priority(&self, dns_priority: i32)

Available on crate feature 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.

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).

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

fn set_route_table(&self, route_table: u32)

Available on crate feature 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.

Source

fn routes(&self) -> Vec<IPRoute>

Array of IP routes.

Source

fn set_routes(&self, routes: &[&IPRoute])

Array of IP routes.

Source

fn connect_addresses_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_auto_route_ext_gw_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Available on crate feature v1_42 only.
Source

fn connect_dad_timeout_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Available on crate feature v1_2 only.
Source

fn connect_dhcp_hostname_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_dhcp_send_hostname_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_dhcp_timeout_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_dns_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source

fn connect_dns_options_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Available on crate feature v1_2 only.
Source

fn connect_dns_priority_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Available on crate feature v1_4 only.
Source

fn connect_dns_search_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_gateway_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_ignore_auto_dns_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_ignore_auto_routes_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_may_fail_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_method_notify<F: Fn(&Self) + 'static>(&self, f: F) -> SignalHandlerId

Source

fn connect_never_default_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_route_metric_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Source

fn connect_route_table_notify<F: Fn(&Self) + 'static>( &self, f: F, ) -> SignalHandlerId

Available on crate feature v1_10 only.
Source

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.

Implementors§