NM.SettingIPConfig

g GObject.Object GObject.Object NM.Setting NM.Setting GObject.Object->NM.Setting NM.SettingIPConfig NM.SettingIPConfig NM.Setting->NM.SettingIPConfig

Subclasses:

NM.SettingIP4Config, NM.SettingIP6Config

Methods

Inherited:

NM.Setting (21), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

add_address (address)

add_dhcp_reject_server (server)

add_dns (dns)

add_dns_option (dns_option)

add_dns_search (dns_search)

add_route (route)

add_routing_rule (routing_rule)

clear_addresses ()

clear_dhcp_reject_servers ()

clear_dns ()

clear_dns_options (is_set)

clear_dns_searches ()

clear_routes ()

clear_routing_rules ()

get_address (idx)

get_auto_route_ext_gw ()

get_dad_timeout ()

get_dhcp_dscp ()

get_dhcp_hostname ()

get_dhcp_hostname_flags ()

get_dhcp_iaid ()

get_dhcp_reject_servers ()

get_dhcp_send_hostname ()

get_dhcp_timeout ()

get_dns (idx)

get_dns_option (idx)

get_dns_priority ()

get_dns_search (idx)

get_gateway ()

get_ignore_auto_dns ()

get_ignore_auto_routes ()

get_may_fail ()

get_method ()

get_never_default ()

get_num_addresses ()

get_num_dns ()

get_num_dns_options ()

get_num_dns_searches ()

get_num_routes ()

get_num_routing_rules ()

get_replace_local_rule ()

get_required_timeout ()

get_route (idx)

get_route_metric ()

get_route_table ()

get_routing_rule (idx)

has_dns_options ()

remove_address (idx)

remove_address_by_value (address)

remove_dhcp_reject_server (idx)

remove_dns (idx)

remove_dns_by_value (dns)

remove_dns_option (idx)

remove_dns_option_by_value (dns_option)

remove_dns_search (idx)

remove_dns_search_by_value (dns_search)

remove_route (idx)

remove_route_by_value (route)

remove_routing_rule (idx)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

NM.Setting (1)

Name

Type

Flags

Short Description

addresses

GLib.PtrArray

r/w

auto-route-ext-gw

NM.Ternary

r/w/en

dad-timeout

int

r/w/en

dhcp-dscp

str

r/w/en

dhcp-hostname

str

r/w/en

dhcp-hostname-flags

int

r/w/en

dhcp-iaid

str

r/w/en

dhcp-reject-servers

[str]

r/w/en

dhcp-send-hostname

bool

r/w/en

dhcp-timeout

int

r/w/en

dns

[str]

r/w

dns-options

[str]

r/w/en

dns-priority

int

r/w/en

dns-search

[str]

r/w/en

gateway

str

r/w/en

ignore-auto-dns

bool

r/w/en

ignore-auto-routes

bool

r/w/en

may-fail

bool

r/w/en

method

str

r/w/en

never-default

bool

r/w/en

replace-local-rule

NM.Ternary

r/w/en

required-timeout

int

r/w/en

route-metric

int

r/w/en

route-table

int

r/w/en

routes

GLib.PtrArray

r/w

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class NM.SettingIPConfig(**kwargs)
Bases:

NM.Setting

Abstract:

Yes

Structure:

NM.SettingIPConfigClass

add_address(address)
Parameters:

address (NM.IPAddress) – the new address to add

Returns:

True if the address was added; False if the address was already known.

Return type:

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.

add_dhcp_reject_server(server)
Parameters:

server (str) – the DHCP reject server to add

Adds a new DHCP reject server to the setting.

New in version 1.28.

add_dns(dns)
Parameters:

dns (str) – 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().

Return type:

bool

Adds a new DNS server to the setting.

add_dns_option(dns_option)
Parameters:

dns_option (str) – the DNS option to add

Returns:

True if the DNS option was added; False otherwise

Return type:

bool

Adds a new DNS option to the setting.

New in version 1.2.

Parameters:

dns_search (str) – the search domain to add

Returns:

True if the DNS search domain was added; False if the search domain was already known

Return type:

bool

Adds a new DNS search domain to the setting.

add_route(route)
Parameters:

route (NM.IPRoute) – the route to add

Returns:

True if the route was added; False if the route was already known.

Return type:

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.

add_routing_rule(routing_rule)
Parameters:

routing_rule (NM.IPRoutingRule) – the NM.IPRoutingRule to add. The address family of the added rule must be compatible with the setting.

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.

New in version 1.18.

clear_addresses()

Removes all configured addresses.

clear_dhcp_reject_servers()

Removes all configured DHCP reject servers.

New in version 1.28.

clear_dns()

Removes all configured DNS servers.

clear_dns_options(is_set)
Parameters:

is_set (bool) – the dns-options can be either empty or unset (default). Specify how to clear the options.

Removes all configured DNS options.

New in version 1.2.

clear_dns_searches()

Removes all configured DNS search domains.

clear_routes()

Removes all configured routes.

clear_routing_rules()

Removes all configured routing rules.

New in version 1.18.

get_address(idx)
Parameters:

idx (int) – index number of the address to return

Returns:

the address at index idx

Return type:

NM.IPAddress

get_auto_route_ext_gw()
Returns:

the NM.SettingIPConfig :auto-route-ext-gw property of the setting

Return type:

NM.Ternary

New in version 1.42.

get_dad_timeout()
Returns:

the NM.SettingIPConfig :dad-timeout property.

Return type:

int

New in version 1.2.

get_dhcp_dscp()
Returns:

the value for the DSCP field for DHCP

Return type:

str

Returns the value contained in the NM.SettingIPConfig :dhcp-dscp property.

New in version 1.46.

get_dhcp_hostname()
Returns:

the configured hostname to send to the DHCP server

Return type:

str

Returns the value contained in the NM.SettingIPConfig :dhcp-hostname property.

get_dhcp_hostname_flags()
Returns:

flags for the DHCP hostname and FQDN

Return type:

NM.DhcpHostnameFlags

Returns the value contained in the NM.SettingIPConfig :dhcp-hostname-flags property.

New in version 1.22.

get_dhcp_iaid()
Returns:

the configured DHCP IAID (Identity Association Identifier)

Return type:

str

Returns the value contained in the NM.SettingIPConfig :dhcp-iaid property.

New in version 1.42.

get_dhcp_reject_servers()
Returns:

A None terminated array of DHCP reject servers. Even if no reject servers are configured, this always returns a non None value.

Return type:

[str]

New in version 1.28.

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

Return type:

bool

Returns the value contained in the NM.SettingIPConfig :dhcp-send-hostname property.

get_dhcp_timeout()
Returns:

the configured DHCP timeout in seconds. 0 = default for the particular kind of device.

Return type:

int

Returns the value contained in the NM.SettingIPConfig :dhcp-timeout property.

New in version 1.2.

get_dns(idx)
Parameters:

idx (int) – index number of the DNS server to return

Returns:

the IP address of the DNS server at index idx

Return type:

str

get_dns_option(idx)
Parameters:

idx (int) – index number of the DNS option

Returns:

the DNS option at index idx

Return type:

str

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

New in version 1.2.

get_dns_priority()
Returns:

the priority of DNS servers

Return type:

int

New in version 1.4.

Parameters:

idx (int) – index number of the DNS search domain to return

Returns:

the DNS search domain at index idx

Return type:

str

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

get_gateway()
Returns:

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

Return type:

str

get_ignore_auto_dns()
Returns:

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

Return type:

bool

Returns the value contained in the NM.SettingIPConfig :ignore-auto-dns property.

get_ignore_auto_routes()
Returns:

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

Return type:

bool

Returns the value contained in the NM.SettingIPConfig :ignore-auto-routes property.

get_may_fail()
Returns:

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

Return type:

bool

Returns the value contained in the NM.SettingIPConfig :may-fail property.

get_method()
Returns:

the NM.SettingIPConfig :method property of the setting; see NM.SettingIP4Config and NM.SettingIP6Config for details of the methods available with each type.

Return type:

str

get_never_default()
Returns:

True if this connection should never be the default connection

Return type:

bool

Returns the value contained in the NM.SettingIPConfig :never-default property.

get_num_addresses()
Returns:

the number of configured addresses

Return type:

int

get_num_dns()
Returns:

the number of configured DNS servers

Return type:

int

get_num_dns_options()
Returns:

the number of configured DNS options

Return type:

int

New in version 1.2.

get_num_dns_searches()
Returns:

the number of configured DNS search domains

Return type:

int

get_num_routes()
Returns:

the number of configured routes

Return type:

int

get_num_routing_rules()
Returns:

the number of configured routing rules

Return type:

int

New in version 1.18.

get_replace_local_rule()
Returns:

the NM.SettingIPConfig :replace-local-rule property of the setting

Return type:

NM.Ternary

New in version 1.44.

get_required_timeout()
Returns:

the required timeout for the address family

Return type:

int

Returns the value contained in the NM.SettingIPConfig :required-timeout property.

New in version 1.34.

get_route(idx)
Parameters:

idx (int) – index number of the route to return

Returns:

the route at index idx

Return type:

NM.IPRoute

get_route_metric()
Returns:

the route metric that is used for routes that don’t explicitly specify a metric. See NM.SettingIPConfig :route-metric for more details.

Return type:

int

Returns the value contained in the NM.SettingIPConfig :route-metric property.

get_route_table()
Returns:

the configured route-table.

Return type:

int

Returns the value contained in the NM.SettingIPConfig :route-table property.

New in version 1.10.

get_routing_rule(idx)
Parameters:

idx (int) – index number of the routing_rule to return

Returns:

the routing rule at index idx

Return type:

NM.IPRoutingRule

New in version 1.18.

has_dns_options()
Returns:

whether DNS options are initialized or left unset (the default).

Return type:

bool

NM.SettingIPConfig 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”.

New in version 1.2.

remove_address(idx)
Parameters:

idx (int) – index number of the address to remove

Removes the address at index idx.

remove_address_by_value(address)
Parameters:

address (NM.IPAddress) – the IP address to remove

Returns:

True if the address was found and removed; False if it was not.

Return type:

bool

Removes the address address.

remove_dhcp_reject_server(idx)
Parameters:

idx (int) – index number of the DHCP reject server

Removes the DHCP reject server at index idx.

New in version 1.28.

remove_dns(idx)
Parameters:

idx (int) – index number of the DNS server to remove

Removes the DNS server at index idx.

remove_dns_by_value(dns)
Parameters:

dns (str) – 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.

Return type:

bool

Removes the DNS server dns.

remove_dns_option(idx)
Parameters:

idx (int) – index number of the DNS option

Removes the DNS option at index idx.

New in version 1.2.

remove_dns_option_by_value(dns_option)
Parameters:

dns_option (str) – the DNS option to remove

Returns:

True if the DNS option was found and removed; False if it was not.

Return type:

bool

Removes the DNS option dns_option.

New in version 1.2.

Parameters:

idx (int) – index number of the DNS search domain

Removes the DNS search domain at index idx.

remove_dns_search_by_value(dns_search)
Parameters:

dns_search (str) – the search domain to remove

Returns:

True if the DNS search domain was found and removed; False if it was not.

Return type:

bool

Removes the DNS search domain dns_search.

remove_route(idx)
Parameters:

idx (int) – index number of the route

Removes the route at index idx.

remove_route_by_value(route)
Parameters:

route (NM.IPRoute) – the route to remove

Returns:

True if the route was found and removed; False if it was not.

Return type:

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.

remove_routing_rule(idx)
Parameters:

idx (int) – index number of the routing_rule

Removes the routing_rule at index idx.

New in version 1.18.

Property Details

NM.SettingIPConfig.props.addresses
Name:

addresses

Type:

GLib.PtrArray

Default Value:

None

Flags:

READABLE, WRITABLE

Array of IP addresses.

NM.SettingIPConfig.props.auto_route_ext_gw
Name:

auto-route-ext-gw

Type:

NM.Ternary

Default Value:

NM.Ternary.DEFAULT

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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.

New in version 1.42.

NM.SettingIPConfig.props.dad_timeout
Name:

dad-timeout

Type:

int

Default Value:

-1

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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.

New in version 1.2.

NM.SettingIPConfig.props.dhcp_dscp
Name:

dhcp-dscp

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Specifies the value for the DSCP field (traffic class) of the IP header. When empty, the global default value is used; if no global default is specified, it is assumed to be “CS0”. Allowed values are: “CS0”, “CS4” and “CS6”.

The property is currently valid only for IPv4, and it is supported only by the “internal” DHCP plugin.

New in version 1.46.

NM.SettingIPConfig.props.dhcp_hostname
Name:

dhcp-hostname

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

If the NM.SettingIPConfig :dhcp-send-hostname property is True, then the specified name will be sent to the DHCP server when acquiring a lease. This property and NM.SettingIP4Config :dhcp-fqdn are mutually exclusive and cannot be set at the same time.

NM.SettingIPConfig.props.dhcp_hostname_flags
Name:

dhcp-hostname-flags

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Flags for the DHCP hostname and FQDN.

Currently, this property only includes flags to control the FQDN flags set in the DHCP FQDN option. Supported FQDN flags are NM.DhcpHostnameFlags.FQDN_SERV_UPDATE, NM.DhcpHostnameFlags.FQDN_ENCODED and NM.DhcpHostnameFlags.FQDN_NO_UPDATE. When no FQDN flag is set and NM.DhcpHostnameFlags.FQDN_CLEAR_FLAGS is set, the DHCP FQDN option will contain no flag. Otherwise, if no FQDN flag is set and NM.DhcpHostnameFlags.FQDN_CLEAR_FLAGS is not set, the standard FQDN flags are set in the request: NM.DhcpHostnameFlags.FQDN_SERV_UPDATE, NM.DhcpHostnameFlags.FQDN_ENCODED for IPv4 and NM.DhcpHostnameFlags.FQDN_SERV_UPDATE for IPv6.

When this property is set to the default value NM.DhcpHostnameFlags.NONE, a global default is looked up in NetworkManager configuration. If that value is unset or also NM.DhcpHostnameFlags.NONE, then the standard FQDN flags described above are sent in the DHCP requests.

New in version 1.22.

NM.SettingIPConfig.props.dhcp_iaid
Name:

dhcp-iaid

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

A string containing the “Identity Association Identifier” (IAID) used by the DHCP client. The string can be a 32-bit number (either decimal, hexadecimal or as colon separated hexadecimal numbers). Alternatively it can be set to the special values “mac”, “perm-mac”, “ifname” or “stable”. When set to “mac” (or “perm-mac”), the last 4 bytes of the current (or permanent) MAC address are used as IAID. When set to “ifname”, the IAID is computed by hashing the interface name. The special value “stable” can be used to generate an IAID based on the stable-id (see connection.stable-id), a per-host key and the interface name. When the property is unset, the value from global configuration is used; if no global default is set then the IAID is assumed to be “ifname”.

For DHCPv4, the IAID is only used with “ipv4.dhcp-client-id” values “duid” and “ipv6-duid” to generate the client-id.

For DHCPv6, note that at the moment this property is only supported by the “internal” DHCPv6 plugin. The “dhclient” DHCPv6 plugin always derives the IAID from the MAC address.

The actually used DHCPv6 IAID for a currently activated interface is exposed in the lease information of the device.

New in version 1.22.

NM.SettingIPConfig.props.dhcp_reject_servers
Name:

dhcp-reject-servers

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Array of servers from which DHCP offers must be rejected. This property is useful to avoid getting a lease from misconfigured or rogue servers.

For DHCPv4, each element must be an IPv4 address, optionally followed by a slash and a prefix length (e.g. “192.168.122.0/24”).

This property is currently not implemented for DHCPv6.

New in version 1.28.

NM.SettingIPConfig.props.dhcp_send_hostname
Name:

dhcp-send-hostname

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

If True, a hostname is sent to the DHCP server when acquiring a lease. Some DHCP servers use this hostname to update DNS databases, essentially providing a static hostname for the computer. If the NM.SettingIPConfig :dhcp-hostname property is None and this property is True, the current persistent hostname of the computer is sent.

NM.SettingIPConfig.props.dhcp_timeout
Name:

dhcp-timeout

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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.

NM.SettingIPConfig.props.dns
Name:

dns

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE

Array of IP addresses of DNS servers.

For DoT (DNS over TLS), the SNI server name can be specified by appending “#example.com” to the IP address of the DNS server. This currently only has effect when using systemd-resolved.

NM.SettingIPConfig.props.dns_options
Name:

dns-options

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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.

New in version 1.2.

NM.SettingIPConfig.props.dns_priority
Name:

dns-priority

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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.

New in version 1.4.

Name:

dns-search

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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

NM.SettingIPConfig.props.gateway
Name:

gateway

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The gateway associated with this configuration. This is only meaningful if NM.SettingIPConfig :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 NM.SettingIPConfig :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 NM.SettingWireGuard :ip4-auto-default-route.

NM.SettingIPConfig.props.ignore_auto_dns
Name:

ignore-auto-dns

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

When NM.SettingIPConfig :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 NM.SettingIPConfig :dns and NM.SettingIPConfig :dns-search properties, if any, are used.

NM.SettingIPConfig.props.ignore_auto_routes
Name:

ignore-auto-routes

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

When NM.SettingIPConfig :method is set to “auto” and this property to True, automatically configured routes are ignored and only routes specified in the NM.SettingIPConfig :routes property, if any, are used.

NM.SettingIPConfig.props.may_fail
Name:

may-fail

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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 NM.SettingIP4Config allows the overall network configuration to succeed if IPv4 configuration fails but IPv6 configuration completes successfully.

NM.SettingIPConfig.props.method
Name:

method

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

IP configuration method.

NM.SettingIP4Config and NM.SettingIP6Config 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 NM.SettingIPConfig :dns and NM.SettingIPConfig :routes specify information that is added on to the information returned from automatic configuration. The NM.SettingIPConfig :ignore-auto-routes and NM.SettingIPConfig :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.

NM.SettingIPConfig.props.never_default
Name:

never-default

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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.

NM.SettingIPConfig.props.replace_local_rule
Name:

replace-local-rule

Type:

NM.Ternary

Default Value:

NM.Ternary.DEFAULT

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Connections will default to keep the autogenerated priority 0 local rule unless this setting is set to True.

New in version 1.44.

NM.SettingIPConfig.props.required_timeout
Name:

required-timeout

Type:

int

Default Value:

-1

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The minimum time interval in milliseconds for which dynamic IP configuration should be tried before the connection succeeds.

This property is useful for example if both IPv4 and IPv6 are enabled and are allowed to fail. Normally the connection succeeds as soon as one of the two address families completes; by setting a required timeout for e.g. IPv4, one can ensure that even if IP6 succeeds earlier than IPv4, NetworkManager waits some time for IPv4 before the connection becomes active.

Note that if NM.SettingIPConfig :may-fail is False for the same address family, this property has no effect as NetworkManager needs to wait for the full DHCP timeout.

A zero value means that no required timeout is present, -1 means the default value (either configuration ipvx.required-timeout override or zero).

New in version 1.34.

NM.SettingIPConfig.props.route_metric
Name:

route-metric

Type:

int

Default Value:

-1

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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.

NM.SettingIPConfig.props.route_table
Name:

route-table

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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.

New in version 1.10.

NM.SettingIPConfig.props.routes
Name:

routes

Type:

GLib.PtrArray

Default Value:

None

Flags:

READABLE, WRITABLE

Array of IP routes.