NM.SettingWired¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
- Inherited:
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/en |
|||
r/w/en |
|||
r/w |
|||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
[ |
r/w/en |
||
[ |
r/w/en |
||
r/w/en |
|||
r/w/en |
|||
r/w/en |
|||
r/w |
|||
[ |
r/w |
||
r/w/en |
|||
r/w/en |
|||
r/w/en |
Signals¶
- Inherited:
Fields¶
- Inherited:
Class Details¶
- class NM.SettingWired(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Wired Ethernet Settings
- classmethod new()¶
- Returns:
the new empty
NM.SettingWired
object- Return type:
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:
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:
Adds a new MAC address to the
NM.SettingWired
:mac-address-denylist
property.New in version 1.48.
- add_s390_option(key, value)¶
- Parameters:
- Returns:
since 1.32 this always returns
True
.- Return type:
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:
New in version 1.32.
- get_auto_negotiate()¶
- Returns:
the
NM.SettingWired
:auto-negotiate
property of the setting- Return type:
- get_cloned_mac_address()¶
- Returns:
the
NM.SettingWired
:cloned-mac-address
property of the setting- Return type:
- get_duplex()¶
- Returns:
the
NM.SettingWired
:duplex
property of the setting- Return type:
- get_generate_mac_address_mask()¶
- Returns:
the
NM.SettingWired
:generate-mac-address-mask
property of the setting- Return type:
New in version 1.4.
- get_mac_address()¶
- Returns:
the
NM.SettingWired
:mac-address
property of the setting- Return type:
- 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:
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:
New in version 1.48.
- get_mtu()¶
- Returns:
the
NM.SettingWired
:mtu
property of the setting- Return type:
- get_num_mac_blacklist_items()¶
- Returns:
the number of blacklisted MAC addresses
- Return type:
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:
New in version 1.48.
- get_num_s390_options()¶
- Returns:
the number of s390-specific device options
- Return type:
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:
- get_s390_nettype()¶
- Returns:
the s390 device type
- Return type:
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 toNM.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:
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
() andNM.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:
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:
- get_valid_s390_options()¶
-
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:
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 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:
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:
Removes the MAC address mac from the denylist.
New in version 1.48.
Property Details¶
- NM.SettingWired.props.accept_all_mac_addresses¶
- Name:
accept-all-mac-addresses
- Type:
- Default Value:
- Flags:
When
True
, setup the interface to accept packets for all MAC addresses. This is enabling the kernel interface flag IFF_PROMISC. WhenFalse
, 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:
- Default Value:
- Flags:
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. WhenFalse
, “speed” and “duplex” properties should be both set or link configuration will be skipped.
- NM.SettingWired.props.cloned_mac_address¶
-
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:
- Default Value:
- Flags:
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:
- Default Value:
- Flags:
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 stillNone
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:
- Default Value:
- Flags:
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:
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:
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:
- Default Value:
0
- Flags:
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:
- Default Value:
- Flags:
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:
- Default Value:
- Flags:
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:
- Default Value:
- Flags:
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¶
-
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:
- Default Value:
0
- Flags:
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:
- Default Value:
1
- Flags:
The
NM.SettingWiredWakeOnLan
options to enable. Not all devices support all options. May be any combination ofNM.SettingWiredWakeOnLan.PHY
,NM.SettingWiredWakeOnLan.UNICAST
,NM.SettingWiredWakeOnLan.MULTICAST
,NM.SettingWiredWakeOnLan.BROADCAST
,NM.SettingWiredWakeOnLan.ARP
,NM.SettingWiredWakeOnLan.MAGIC
or the special valuesNM.SettingWiredWakeOnLan.DEFAULT
(to use global settings) andNM.SettingWiredWakeOnLan.IGNORE
(to disable management of Wake-on-LAN in NetworkManager).New in version 1.2.