WiredNetworkInterface¶
Description¶
The WiredNetworkInterface object represents one of the wired (ethernet) network interfaces of the device. The mode property allows defining the network configuration method (static/DHCP). When working with static addresses many additional properties allow detailled configuration and customization. Additionally the provided configuration items can be used to make the settings available to generic property-based frontends.
› Inherits: | NetworkInterface |
---|
Overview¶
Properties¶
Methods¶
Signals¶
Properties¶
address¶
This property holds a static IPv4 or IPv6 address for this interface and optionally its subnet prefix length, separated by a /
character, e.g. 192.168.2.19/24
. Multiple addresses (including prefix) can be specified and separated by space.
› Type: | String |
---|---|
› Signal: | addressChanged() |
› Attributes: | Writable |
addressItem¶
This property holds an internal ConfigurationItem instance for the address property.
› Type: | ConfigurationItem |
---|---|
› Attributes: | Readonly |
dhcpServer¶
This property holds an optional DhcpServer object which defines settings for a DHCP server started on this interface. This may be required when TCP/IP-based sensor and I/O modules are connected to this interface and obtain their configuration through DHCP.
› Type: | DhcpServer |
---|---|
› Signal: | dhcpServerChanged() |
› Attributes: | Writable |
dns¶
This property holds a list of DNS servers which should be used for resolving hostnames to IP addresses. Multiple server addresses can be specified and separated by space. Each server address has to be a valid IPv4 or IPv6 address.
› Type: | String |
---|---|
› Signal: | dnsChanged() |
› Attributes: | Writable |
dnsItem¶
This property holds an internal ConfigurationItem instance for the dns property.
› Type: | ConfigurationItem |
---|---|
› Attributes: | Readonly |
domains¶
This property holds a list of DNS search domains which should be resolved using the DNS servers on this interface. See the Domains description in the systemd-networkd manpage for details on syntax and semantics.
› Type: | String |
---|---|
› Signal: | domainsChanged() |
› Attributes: | Writable |
domainsItem¶
This property holds an internal ConfigurationItem instance for the domains property.
› Type: | ConfigurationItem |
---|---|
› Attributes: | Readonly |
gateway¶
This property holds the gateway address for this interface. This is required to communicate with hosts outside of the configured subnet. Multiple gateways can be specified and separated by space. Each gateway address has to be a valid IPv4 or IPv6 address.
› Type: | String |
---|---|
› Signal: | gatewayChanged() |
› Attributes: | Writable |
gatewayItem¶
This property holds an internal ConfigurationItem instance for the gateway property.
› Type: | ConfigurationItem |
---|---|
› Attributes: | Readonly |
index¶
This property holds which physical network interface to configure through a certain instance.
› Type: | Index |
---|---|
› Default: | WiredNetworkInterface.EthernetNone |
› Signal: | indexChanged() |
› Attributes: | Writable |
indexItem¶
This property holds an internal ConfigurationItem instance for the index property.
› Type: | ConfigurationItem |
---|---|
› Attributes: | Readonly |
ipv6AutoConfig¶
This property holds whether to enable IPv6 auto configuration support. When enabled IPv6 Router Advertisements are received and processed and the DHCPv6 client is enabled on this interface. See the IPv6AcceptRA description in the systemd-networkd manpage for details.
› Type: | Boolean |
---|---|
› Default: | true |
› Signal: | ipv6AutoConfigChanged() |
› Attributes: | Writable |
ipv6AutoConfigItem¶
This property holds an internal ConfigurationItem instance for the ipv6AutoConfig property.
› Type: | ConfigurationItem |
---|---|
› Attributes: | Readonly |
linkLocalAddressing¶
This property holds whether to enable link-local address autoconfiguration. See Link-local address for details.
› Type: | Boolean |
---|---|
› Default: | false |
› Signal: | linkLocalAddressingChanged() |
› Attributes: | Writable |
linkLocalAddressingItem¶
This property holds an internal ConfigurationItem instance for the linkLocalAddressing property.
› Type: | ConfigurationItem |
---|---|
› Attributes: | Readonly |
mode¶
This property holds the configuration mode for this network interface. When set to WiredNetworkInterface.ModeStatic at least the address property has to be specified as well. Depending on the desired purpose of the interface, the dns and gateway properties should be configured as well.
› Type: | Mode |
---|---|
› Default: | WiredNetworkInterface.ModeNone |
› Signal: | modeChanged() |
› Attributes: | Writable |
modeItem¶
This property holds an internal ConfigurationItem instance for the mode property.
› Type: | ConfigurationItem |
---|---|
› Attributes: | Readonly |
multicastDNS¶
This property holds whether to enable multicast DNS support on this interface. When enabled, the device can be accessed via System.hostname.local in the network. See Multicast DNS and RFC 6762 for details.
› Type: | Boolean |
---|---|
› Default: | false |
› Signal: | multicastDNSChanged() |
› Attributes: | Writable |
multicastDNSItem¶
This property holds an internal ConfigurationItem instance for the multicastDNS property.
› Type: | ConfigurationItem |
---|---|
› Attributes: | Readonly |
subnetPrefixLength¶
This property holds the subnet prefix length for the static IPv4 or IPv6 address. It is ignored if specified as part of the IP address already. Otherwise it has to be set to a value greater than 0
, e.g. 24
for the IPv4 subnet mask 255.255.255.0
.
This property was introduced in InCore 2.6.
› Type: | SignedInteger |
---|---|
› Default: | 0 |
› Signal: | subnetPrefixLengthChanged() |
› Attributes: | Writable |
subnetPrefixLengthItem¶
This property holds an internal ConfigurationItem instance for the subnetPrefixLength property.
› Type: | ConfigurationItem |
---|---|
› Attributes: | Readonly |
vlan¶
This property holds the name of a VLAN to create on this interface.
› Type: | String |
---|---|
› Signal: | vlanChanged() |
› Attributes: | Writable |
vlanItem¶
This property holds an internal ConfigurationItem instance for the vlan property.
› Type: | ConfigurationItem |
---|---|
› Attributes: | Readonly |
Enumerations¶
Index¶
This enumeration describes indexes for all supported wireless network interfaces.
Name | Value | Description |
---|---|---|
WiredNetworkInterface.EthernetNone |
0 |
The object does not represent a valid wired network interface. |
WiredNetworkInterface.Ethernet1 |
1 |
The object represents the first wired network interface. |
WiredNetworkInterface.Ethernet2 |
2 |
The object represents the second wired network interface. |
Mode¶
This enumeration describes all supported configuration modes for a wired network interface.
Name | Value | Description |
---|---|---|
WiredNetworkInterface.ModeNone |
0 |
Do not configure, i.e. disable the network interface. |
WiredNetworkInterface.ModeStatic |
1 |
Configure one or multiple static addresses and servers. |
WiredNetworkInterface.ModeDHCP |
2 |
Configure the interface automatically via DHCP and IPv6 Router Advertisements. |
Example¶
import InCore.Foundation 2.5
Application {
NetworkConfiguration {
// autoconfigure ethernet interface via DHCP
WiredNetworkInterface {
index: WiredNetworkInterface.Ethernet1
mode: WiredNetworkInterface.ModeDHCP
}
// configure ethernet interface with static settings
WiredNetworkInterface {
index: WiredNetworkInterface.Ethernet2
mode: WiredNetworkInterface.ModeStatic
address: "192.168.2.19/24"
gateway: "192.168.2.254"
dns: "192.168.2.1 192.168.2.2"
domains: "example.org"
ntp: "ntp1.example.org ntp2.example.org"
multicastDNS: true
routes: [
NetworkRoute {
destination: "192.168.3.0/24"
gateway: "192.168.2.253"
}
]
}
}
}