NM.SettingWired

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

Subclasses:

None

Methods

Inherited:

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

Structs:

GObject.ObjectClass (5)

class

new ()

add_mac_blacklist_item (mac)

add_mac_denylist_item (mac)

add_s390_option (key, value)

clear_mac_blacklist_items ()

clear_mac_denylist_items ()

get_accept_all_mac_addresses ()

get_auto_negotiate ()

get_cloned_mac_address ()

get_duplex ()

get_generate_mac_address_mask ()

get_mac_address ()

get_mac_address_blacklist ()

get_mac_address_denylist ()

get_mac_blacklist_item (idx)

get_mac_denylist_item (idx)

get_mtu ()

get_num_mac_blacklist_items ()

get_num_mac_denylist_items ()

get_num_s390_options ()

get_port ()

get_s390_nettype ()

get_s390_option (idx)

get_s390_option_by_key (key)

get_s390_subchannels ()

get_speed ()

get_valid_s390_options ()

get_wake_on_lan ()

get_wake_on_lan_password ()

remove_mac_blacklist_item (idx)

remove_mac_blacklist_item_by_value (mac)

remove_mac_denylist_item (idx)

remove_mac_denylist_item_by_value (mac)

remove_s390_option (key)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

Inherited:

NM.Setting (1)

Name

Type

Flags

Short Description

accept-all-mac-addresses

NM.Ternary

r/w/en

auto-negotiate

bool

r/w/en

cloned-mac-address

str

r/w

duplex

str

r/w/en

generate-mac-address-mask

str

r/w/en

mac-address

str

r/w/en

mac-address-blacklist

[str]

r/w/en

mac-address-denylist

[str]

r/w/en

mtu

int

r/w/en

port

str

r/w/en

s390-nettype

str

r/w/en

s390-options

GLib.HashTable

r/w

s390-subchannels

[str]

r/w

speed

int

r/w/en

wake-on-lan

int

r/w/en

wake-on-lan-password

str

r/w/en

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class NM.SettingWired(**kwargs)
Bases:

NM.Setting

Abstract:

No

Structure:

NM.SettingWiredClass

Wired Ethernet Settings

classmethod new()
Returns:

the new empty NM.SettingWired object

Return type:

NM.Setting

Creates a new NM.SettingWired object with default values.

add_mac_blacklist_item(mac)
Parameters:

mac (str) – the MAC address string (hex-digits-and-colons notation) to blacklist

Returns:

True if the MAC address was added; False if the MAC address is invalid or was already present

Return type:

bool

Adds a new MAC address to the NM.SettingWired :mac-address-blacklist property.

Deprecated since version 1.48.: Use NM.SettingWired.add_mac_denylist_item() instead.

add_mac_denylist_item(mac)
Parameters:

mac (str) – the MAC address string (hex-digits-and-colons notation) to denylist

Returns:

True if the MAC address was added; False if the MAC address is invalid or was already present

Return type:

bool

Adds a new MAC address to the NM.SettingWired :mac-address-denylist property.

New in version 1.48.

add_s390_option(key, value)
Parameters:
  • key (str) – key name for the option

  • value (str) – value for the option

Returns:

since 1.32 this always returns True.

Return type:

bool

Add an option to the table. If the key already exists, the value gets replaced.

Before 1.32, the function would assert that the key is valid.an invalid key gets silently added but renders the profile as invalid.

New in version then,.

clear_mac_blacklist_items()

Removes all blacklisted MAC addresses.

Deprecated since version 1.48.: Use NM.SettingWired.clear_mac_denylist_items() instead.

clear_mac_denylist_items()

Removes all denylisted MAC addresses.

New in version 1.48.

get_accept_all_mac_addresses()
Returns:

the NM.SettingWired :accept-all-mac-addresses property of the setting

Return type:

NM.Ternary

New in version 1.32.

get_auto_negotiate()
Returns:

the NM.SettingWired :auto-negotiate property of the setting

Return type:

bool

get_cloned_mac_address()
Returns:

the NM.SettingWired :cloned-mac-address property of the setting

Return type:

str

get_duplex()
Returns:

the NM.SettingWired :duplex property of the setting

Return type:

str

get_generate_mac_address_mask()
Returns:

the NM.SettingWired :generate-mac-address-mask property of the setting

Return type:

str

New in version 1.4.

get_mac_address()
Returns:

the NM.SettingWired :mac-address property of the setting

Return type:

str

get_mac_address_blacklist()
Returns:

the NM.SettingWired :mac-address-blacklist property of the setting

Return type:

[str]

Deprecated since version 1.48.: Use NM.SettingWired.get_mac_address_denylist() instead.

get_mac_address_denylist()
Returns:

the NM.SettingWired :mac-address-denylist property of the setting

Return type:

[str]

New in version 1.48.

get_mac_blacklist_item(idx)
Parameters:

idx (int) – the zero-based index of the MAC address entry

Returns:

the blacklisted MAC address string (hex-digits-and-colons notation) at index idx

Return type:

str

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

Deprecated since version 1.48.: Use NM.SettingWired.get_mac_denylist_item() instead.

get_mac_denylist_item(idx)
Parameters:

idx (int) – the zero-based index of the MAC address entry

Returns:

the denylisted MAC address string (hex-digits-and-colons notation) at index idx

Return type:

str

New in version 1.48.

get_mtu()
Returns:

the NM.SettingWired :mtu property of the setting

Return type:

int

get_num_mac_blacklist_items()
Returns:

the number of blacklisted MAC addresses

Return type:

int

Deprecated since version 1.48.: Use NM.SettingWired.get_num_mac_denylist_items() instead.

get_num_mac_denylist_items()
Returns:

the number of denylisted MAC addresses

Return type:

int

New in version 1.48.

get_num_s390_options()
Returns:

the number of s390-specific device options

Return type:

int

Returns the number of s390-specific options that should be set for this device when it is activated. This can be used to retrieve each s390 option individually using NM.SettingWired.get_s390_option().

get_port()
Returns:

the NM.SettingWired :port property of the setting

Return type:

str

get_s390_nettype()
Returns:

the s390 device type

Return type:

str

Returns the s390 device type this connection should apply to. Will be one of ‘qeth’, ‘lcs’, or ‘ctc’.

get_s390_option(idx)
Parameters:

idx (int) – index of the desired option, from 0 to NM.SettingWired.get_num_s390_options() - 1

Returns:

True on success if the index was valid and an option was found, False if the index was invalid (ie, greater than the number of options currently held by the setting)

out_key:

on return, the key name of the s390 specific option; this value is owned by the setting and should not be modified

out_value:

on return, the value of the key of the s390 specific option; this value is owned by the setting and should not be modified

Return type:

(bool, out_key: str or None, out_value: str or None)

Given an index, return the value of the s390 option at that index. indexes are *not* guaranteed to be static across modifications to options done by NM.SettingWired.add_s390_option() and NM.SettingWired.remove_s390_option(), and should not be used to refer to options except for short periods of time such as during option iteration.

get_s390_option_by_key(key)
Parameters:

key (str) – the key for which to retrieve the value

Returns:

the value, or None if the key/value pair was never added to the setting; the value is owned by the setting and must not be modified

Return type:

str

Returns the value associated with the s390-specific option specified by key, if it exists.

get_s390_subchannels()
Returns:

array of strings, each specifying one subchannel the s390 device uses to communicate to the host.

Return type:

[str]

Return the list of s390 subchannels that identify the device that this connection is applicable to. The connection should only be used in conjunction with that device.

get_speed()
Returns:

the NM.SettingWired :speed property of the setting

Return type:

int

get_valid_s390_options()
Returns:

a None-terminated array of strings of valid s390 options.

Return type:

[str]

Returns a list of valid s390 options.

The self argument is unused and None may be passed instead.

get_wake_on_lan()
Returns:

the Wake-on-LAN options

Return type:

NM.SettingWiredWakeOnLan

Returns the Wake-on-LAN options enabled for the connection

New in version 1.2.

get_wake_on_lan_password()
Returns:

the Wake-on-LAN setting password, or None if there is no password.

Return type:

str

Returns the Wake-on-LAN password. This only applies to NM.SettingWiredWakeOnLan.MAGIC.

New in version 1.2.

remove_mac_blacklist_item(idx)
Parameters:

idx (int) – index number of the MAC address

Removes the MAC address at index idx from the blacklist.

Deprecated since version 1.48.: Use NM.SettingWired.remove_mac_denylist_item() instead.

remove_mac_blacklist_item_by_value(mac)
Parameters:

mac (str) – the MAC address string (hex-digits-and-colons notation) to remove from the blacklist

Returns:

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

Return type:

bool

Removes the MAC address mac from the blacklist.

Deprecated since version 1.48.: Use NM.SettingWired.remove_mac_denylist_item_by_value() instead.

remove_mac_denylist_item(idx)
Parameters:

idx (int) – index number of the MAC address

Removes the MAC address at index idx from the denylist.

New in version 1.48.

remove_mac_denylist_item_by_value(mac)
Parameters:

mac (str) – the MAC address string (hex-digits-and-colons notation) to remove from the denylist

Returns:

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

Return type:

bool

Removes the MAC address mac from the denylist.

New in version 1.48.

remove_s390_option(key)
Parameters:

key (str) – key name for the option to remove

Returns:

True if the option was found and removed from the internal option list, False if it was not.

Return type:

bool

Remove the s390-specific option referenced by key from the internal option list.

Property Details

NM.SettingWired.props.accept_all_mac_addresses
Name:

accept-all-mac-addresses

Type:

NM.Ternary

Default Value:

NM.Ternary.DEFAULT

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

When True, setup the interface to accept packets for all MAC addresses. This is enabling the kernel interface flag IFF_PROMISC. When False, the interface will only accept the packets with the interface destination mac address or broadcast.

New in version 1.32.

NM.SettingWired.props.auto_negotiate
Name:

auto-negotiate

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

When True, enforce auto-negotiation of speed and duplex mode. If “speed” and “duplex” properties are both specified, only that single mode will be advertised and accepted during the link auto-negotiation process: this works only for BASE-T 802.3 specifications and is useful for enforcing gigabits modes, as in these cases link negotiation is mandatory. When False, “speed” and “duplex” properties should be both set or link configuration will be skipped.

NM.SettingWired.props.cloned_mac_address
Name:

cloned-mac-address

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

If specified, request that the device use this MAC address instead. This is known as MAC cloning or spoofing.

Beside explicitly specifying a MAC address, the special values “preserve”, “permanent”, “random” and “stable” are supported. “preserve” means not to touch the MAC address on activation. “permanent” means to use the permanent hardware address if the device has one (otherwise this is treated as “preserve”). “random” creates a random MAC address on each connect. “stable” creates a hashed MAC address based on connection.stable-id and a machine dependent key.

If unspecified, the value can be overwritten via global defaults, see manual of NetworkManager.conf. If still unspecified, it defaults to “preserve” (older versions of NetworkManager may use a different default value).

On D-Bus, this field is expressed as “assigned-mac-address” or the deprecated “cloned-mac-address”.

NM.SettingWired.props.duplex
Name:

duplex

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

When a value is set, either “half” or “full”, configures the device to use the specified duplex mode. If “auto-negotiate” is “yes” the specified duplex mode will be the only one advertised during link negotiation: this works only for BASE-T 802.3 specifications and is useful for enforcing gigabits modes, as in these cases link negotiation is mandatory. If the value is unset (the default), the link configuration will be either skipped (if “auto-negotiate” is “no”, the default) or will be auto-negotiated (if “auto-negotiate” is “yes”) and the local device will advertise all the supported duplex modes. Must be set together with the “speed” property if specified. Before specifying a duplex mode be sure your device supports it.

NM.SettingWired.props.generate_mac_address_mask
Name:

generate-mac-address-mask

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

With NM.SettingWired :cloned-mac-address setting “random” or “stable”, by default all bits of the MAC address are scrambled and a locally-administered, unicast MAC address is created. This property allows to specify that certain bits are fixed. Note that the least significant bit of the first MAC address will always be unset to create a unicast MAC address.

If the property is None, it is eligible to be overwritten by a default connection setting. If the value is still None or an empty string, the default is to create a locally-administered, unicast MAC address.

If the value contains one MAC address, this address is used as mask. The set bits of the mask are to be filled with the current MAC address of the device, while the unset bits are subject to randomization. Setting “FE:FF:py:data::FF<NM.SettingWired.props.FF>:00:00:00” means to preserve the OUI of the current MAC address and only randomize the lower 3 bytes using the “random” or “stable” algorithm.

If the value contains one additional MAC address after the mask, this address is used instead of the current MAC address to fill the bits that shall not be randomized. For example, a value of “FE:FF:py:data::FF<NM.SettingWired.props.FF>:00:00:00 68:py:data::F7<NM.SettingWired.props.F7>:28:00:00:00” will set the OUI of the MAC address to 68:py:data::F7<NM.SettingWired.props.F7>:28, while the lower bits are randomized. A value of “02:00:00:00:00:00 00:00:00:00:00:00” will create a fully scrambled globally-administered, burned-in MAC address.

If the value contains more than one additional MAC addresses, one of them is chosen randomly. For example, “02:00:00:00:00:00 00:00:00:00:00:00 02:00:00:00:00:00” will create a fully scrambled MAC address, randomly locally or globally administered.

NM.SettingWired.props.mac_address
Name:

mac-address

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

If specified, this connection will only apply to the Ethernet device whose permanent MAC address matches. This property does not change the MAC address of the device (i.e. MAC spoofing).

NM.SettingWired.props.mac_address_blacklist
Name:

mac-address-blacklist

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

If specified, this connection will never apply to the Ethernet device whose permanent MAC address matches an address in the list. Each MAC address is in the standard hex-digits-and-colons notation (00:11:22:33:44:55).

NM.SettingWired.props.mac_address_denylist
Name:

mac-address-denylist

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

If specified, this connection will never apply to the Ethernet device whose permanent MAC address matches an address in the list. Each MAC address is in the standard hex-digits-and-colons notation (00:11:22:33:44:55).

NM.SettingWired.props.mtu
Name:

mtu

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

If non-zero, only transmit packets of the specified size or smaller, breaking larger packets up into multiple Ethernet frames.

NM.SettingWired.props.port
Name:

port

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

Specific port type to use if the device supports multiple attachment methods. One of “tp” (Twisted Pair), “aui” (Attachment Unit Interface), “bnc” (Thin Ethernet) or “mii” (Media Independent Interface). If the device supports only one port type, this setting is ignored.

NM.SettingWired.props.s390_nettype
Name:

s390-nettype

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

s390 network device type; one of “qeth”, “lcs”, or “ctc”, representing the different types of virtual network devices available on s390 systems.

NM.SettingWired.props.s390_options
Name:

s390-options

Type:

GLib.HashTable

Default Value:

None

Flags:

READABLE, WRITABLE

Dictionary of key/value pairs of s390-specific device options. Both keys and values must be strings. Allowed keys include “portno”, “layer2”, “portname”, “protocol”, among others. Key names must contain only alphanumeric characters (ie, [a-zA-Z0-9]).

Currently, NetworkManager itself does nothing with this information. However, s390utils ships a udev rule which parses this information and applies it to the interface.

NM.SettingWired.props.s390_subchannels
Name:

s390-subchannels

Type:

[str]

Default Value:

[]

Flags:

READABLE, WRITABLE

Identifies specific subchannels that this network device uses for communication with z/VM or s390 host. Like the NM.SettingWired :mac-address property for non-z/VM devices, this property can be used to ensure this connection only applies to the network device that uses these subchannels. The list should contain exactly 3 strings, and each string may only be composed of hexadecimal characters and the period (.) character.

NM.SettingWired.props.speed
Name:

speed

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

When a value greater than 0 is set, configures the device to use the specified speed. If “auto-negotiate” is “yes” the specified speed will be the only one advertised during link negotiation: this works only for BASE-T 802.3 specifications and is useful for enforcing gigabit speeds, as in this case link negotiation is mandatory. If the value is unset (0, the default), the link configuration will be either skipped (if “auto-negotiate” is “no”, the default) or will be auto-negotiated (if “auto-negotiate” is “yes”) and the local device will advertise all the supported speeds. In Mbit/s, ie 100 == 100Mbit/s. Must be set together with the “duplex” property when non-zero. Before specifying a speed value be sure your device supports it.

NM.SettingWired.props.wake_on_lan
Name:

wake-on-lan

Type:

int

Default Value:

1

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

The NM.SettingWiredWakeOnLan options to enable. Not all devices support all options. May be any combination of NM.SettingWiredWakeOnLan.PHY, NM.SettingWiredWakeOnLan.UNICAST, NM.SettingWiredWakeOnLan.MULTICAST, NM.SettingWiredWakeOnLan.BROADCAST, NM.SettingWiredWakeOnLan.ARP, NM.SettingWiredWakeOnLan.MAGIC or the special values NM.SettingWiredWakeOnLan.DEFAULT (to use global settings) and NM.SettingWiredWakeOnLan.IGNORE (to disable management of Wake-on-LAN in NetworkManager).

New in version 1.2.

NM.SettingWired.props.wake_on_lan_password
Name:

wake-on-lan-password

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE, EXPLICIT_NOTIFY

If specified, the password used with magic-packet-based Wake-on-LAN, represented as an Ethernet MAC address. If None, no password will be required.

New in version 1.2.