NM.SettingIP4Config

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

Subclasses:

None

Methods

Inherited:

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

Structs:

GObject.ObjectClass (5)

class

new ()

get_dhcp_client_id ()

get_dhcp_fqdn ()

get_dhcp_vendor_class_identifier ()

get_link_local ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

NM.SettingIPConfig (26), NM.Setting (1)

Name

Type

Flags

Short Description

dhcp-client-id

str

r/w/en

dhcp-fqdn

str

r/w/en

dhcp-vendor-class-identifier

str

r/w/en

link-local

int

r/w/en

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class NM.SettingIP4Config(**kwargs)
Bases:

NM.SettingIPConfig

Abstract:

No

Structure:

NM.SettingIP4ConfigClass

IPv4 Settings

classmethod new()
Returns:

the new empty NM.SettingIP4Config object

Return type:

NM.Setting

Creates a new NM.SettingIP4Config object with default values.

get_dhcp_client_id()
Returns:

the configured Client ID to send to the DHCP server when requesting addresses via DHCP.

Return type:

str

Returns the value contained in the NM.SettingIP4Config :dhcp-client-id property.

get_dhcp_fqdn()
Returns:

the configured FQDN to send to the DHCP server

Return type:

str

Returns the value contained in the NM.SettingIP4Config :dhcp-fqdn property.

New in version 1.2.

get_dhcp_vendor_class_identifier()
Returns:

the vendor class identifier option to send to the DHCP server

Return type:

str

Returns the value contained in the #NMSettingIP4Config:dhcp_vendor_class_identifier property.

New in version 1.28.

Returns:

the link-local configuration

Return type:

NM.SettingIP4LinkLocal

Returns the value contained in the #NMSettingIP4Config:link_local property.

New in version 1.42.

Property Details

NM.SettingIP4Config.props.dhcp_client_id
Name:

dhcp-client-id

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

A string sent to the DHCP server to identify the local machine which the DHCP server may use to customize the DHCP lease and options. When the property is a hex string (‘aa:bb:py:data::cc<NM.SettingIP4Config.props.cc>') it is interpreted as a binary client ID, in which case the first byte is assumed to be the ‘type’ field as per RFC 2132 section 9.14 and the remaining bytes may be an hardware address (e.g. ‘01:py:data::xx<NM.SettingIP4Config.props.xx>:xx:xx:xx:xx:xx' where 1 is the Ethernet ARP type and the rest is a MAC address). If the property is not a hex string it is considered as a non-hardware-address client ID and the ‘type’ field is set to 0.

The special values “mac” and “perm-mac” are supported, which use the current or permanent MAC address of the device to generate a client identifier with type ethernet (01). Currently, these options only work for ethernet type of links.

The special value “ipv6-duid” uses the DUID from “ipv6.dhcp-duid” property as an RFC4361-compliant client identifier. As IAID it uses “ipv4.dhcp-iaid” and falls back to “ipv6.dhcp-iaid” if unset.

The special value “duid” generates a RFC4361-compliant client identifier based on “ipv4.dhcp-iaid” and uses a DUID generated by hashing /etc/machine-id.

The special value “stable” is supported to generate a type 0 client identifier based on the stable-id (see connection.stable-id) and a per-host key. If you set the stable-id, you may want to include the “${DEVICE}” or “${MAC}” specifier to get a per-device key.

The special value “none” prevents any client identifier from being sent. Note that this is normally not recommended.

If unset, a globally configured default from NetworkManager.conf is used. If still unset, the default depends on the DHCP plugin. The internal dhcp client will default to “mac” and the dhclient plugin will try to use one from its config file if present, or won’t sent any client-id otherwise.

NM.SettingIP4Config.props.dhcp_fqdn
Name:

dhcp-fqdn

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

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

New in version 1.2.

NM.SettingIP4Config.props.dhcp_vendor_class_identifier
Name:

dhcp-vendor-class-identifier

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The Vendor Class Identifier DHCP option (60). Special characters in the data string may be escaped using C-style escapes, nevertheless this property cannot contain nul bytes. If the per-profile value is unspecified (the default), a global connection default gets consulted. If still unspecified, the DHCP option is not sent to the server.

New in version 1.28.

Name:

link-local

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Enable and disable the IPv4 link-local configuration independently of the ipv4.method configuration. This allows a link-local address (169.254.x.y/16) to be obtained in addition to other addresses, such as those manually configured or obtained from a DHCP server.

When set to “auto”, the value is dependent on “ipv4.method”. When set to “default”, it honors the global connection default, before falling back to “auto”. Note that if “ipv4.method” is “disabled”, then link local addressing is always disabled too. The default is “default”.

New in version 1.40.