Common properties for all device types

Common properties for all device types

renderer (scalar)

Use the given networking backend for this definition. Currently supported are
networkd and NetworkManager. This property can be specified globally
in network:, for a device type (in e. g. ethernets:) or
for a particular device definition. Default is networkd.

(Since 0.99) The renderer property has one additional acceptable value for vlan
objects (i. e. defined in vlans:): sriov. If a vlan is defined with the
sriov renderer for an SR-IOV Virtual Function interface, this causes netplan to
set up a hardware VLAN filter for it. There can be only one defined per VF.

dhcp4 (bool)

Enable DHCP for IPv4. Off by default.

dhcp6 (bool)

Enable DHCP for IPv6. Off by default. This covers both stateless DHCP -
where the DHCP server supplies information like DNS nameservers but not the
IP address - and stateful DHCP, where the server provides both the address
and the other information.

If you are in an IPv6-only environment with completely stateless
autoconfiguration (SLAAC with RDNSS), this option can be set to cause the
interface to be brought up. (Setting accept-ra alone is not sufficient.)
Autoconfiguration will still honour the contents of the router advertisement
and only use DHCP if requested in the RA.

Note that rdnssd(8) is required to use RDNSS with networkd. No extra
software is required for NetworkManager.

ipv6-mtu (scalar) – since 0.98

Set the IPv6 MTU (only supported with networkd backend). Note
that needing to set this is an unusual requirement.

Requires feature: ipv6-mtu

ipv6-privacy (bool)

Enable IPv6 Privacy Extensions (RFC 4941) for the specified interface, and
prefer temporary addresses. Defaults to false - no privacy extensions. There
is currently no way to have a private address but prefer the public address.

link-local (sequence of scalars)

Configure the link-local addresses to bring up. Valid options are ‘ipv4’
and ‘ipv6’, which respectively allow enabling IPv4 and IPv6 link local
addressing. If this field is not defined, the default is to enable only
IPv6 link-local addresses. If the field is defined but configured as an
empty set, IPv6 link-local addresses are disabled as well as IPv4 link-
local addresses.

This feature enables or disables link-local addresses for a protocol, but
the actual implementation differs per backend. On networkd, this directly
changes the behavior and may add an extra address on an interface. When
using the NetworkManager backend, enabling link-local has no effect if the
interface also has DHCP enabled.

Example to enable only IPv4 link-local: link-local: [ ipv4 ]
Example to enable all link-local addresses: link-local: [ ipv4, ipv6 ]
Example to disable all link-local addresses: link-local: [ ]

ignore-carrier (bool) – since 0.104

(networkd backend only) Allow the specified interface to be configured even
if it has no carrier.

critical (bool)

Designate the connection as “critical to the system”, meaning that special
care will be taken by to not release the assigned IP when the daemon is
restarted. (not recognized by NetworkManager)

dhcp-identifier (scalar)

(networkd backend only) Sets the source of DHCPv4 client identifier. If mac
is specified, the MAC address of the link is used. If this option is omitted,
or if duid is specified, networkd will generate an RFC4361-compliant client
identifier for the interface by combining the link’s IAID and DUID.

dhcp4-overrides (mapping)

(networkd backend only) Overrides default DHCP behavior; see the
DHCP Overrides section below.

dhcp6-overrides (mapping)

(networkd backend only) Overrides default DHCP behavior; see the
DHCP Overrides section below.

accept-ra (bool)

Accept Router Advertisement that would have the kernel configure IPv6 by itself.
When enabled, accept Router Advertisements. When disabled, do not respond to
Router Advertisements. If unset use the host kernel default setting.

addresses (sequence of scalars and mappings)

Add static addresses to the interface in addition to the ones received
through DHCP or RA. Each sequence entry is in CIDR notation, i. e. of the
form addr/prefixlen. addr is an IPv4 or IPv6 address as recognized
by inet_pton(3) and prefixlen the number of bits of the subnet.

For virtual devices (bridges, bonds, vlan) if there is no address
configured and DHCP is disabled, the interface may still be brought online,
but will not be addressable from the network.

In addition to the addresses themselves one can specify configuration
parameters as mappings. Current supported options are:

lifetime (scalar) – since 0.100

Default: forever. This can be forever or 0 and corresponds
to the PreferredLifetime option in systemd-networkd’s Address
section. Currently supported on the networkd backend only.

label (scalar) – since 0.100

An IP address label, equivalent to the ip address label
command. Currently supported on the networkd backend only.

Example: addresses: [192.168.14.2/24, "2001:1::1/64"]

Example:

ethernets: eth0: addresses: - 10.0.0.15/24: lifetime: 0 label: “maas” - “2001:1::1/64”

ipv6-address-generation (scalar) – since 0.99

Configure method for creating the address for use with RFC4862 IPv6
Stateless Address Autoconfiguration (only supported with NetworkManager
backend). Possible values are eui64 or stable-privacy.

ipv6-address-token (scalar) – since 0.100

Define an IPv6 address token for creating a static interface identifier for
IPv6 Stateless Address Autoconfiguration. This is mutually exclusive with
ipv6-address-generation.

gateway4, gateway6 (scalar)

Deprecated, see Default routes.
Set default gateway for IPv4/6, for manual address configuration. This
requires setting addresses too. Gateway IPs must be in a form
recognized by inet_pton(3). There should only be a single gateway
per IP address family set in your global config, to make it unambiguous.
If you need multiple default routes, please define them via
routing-policy.

Example for IPv4: gateway4: 172.16.0.1
Example for IPv6: gateway6: "2001:4::1"

nameservers (mapping)

Set DNS servers and search domains, for manual address configuration. There
are two supported fields: addresses: is a list of IPv4 or IPv6 addresses
similar to gateway*, and search: is a list of search domains.

Example:

ethernets:
  id0:
    [...]
    nameservers:
      search: [lab, home]
      addresses: [8.8.8.8, "FEDC::1"]

macaddress (scalar)

Set the device’s MAC address. The MAC address must be in the form
“XX:XX:XX:XX:XX:XX”.

Note: This will not work reliably for devices matched by name
only and rendered by networkd, due to interactions with device
renaming in udev. Match devices by MAC when setting MAC addresses.

Example:

ethernets: id0: match: macaddress: 52:54:00:6b:3c:58 […] macaddress: 52:54:00:6b:3c:59

mtu (scalar)

Set the Maximum Transmission Unit for the interface. The default is 1500.
Valid values depend on your network interface.

Note: This will not work reliably for devices matched by name
only and rendered by networkd, due to interactions with device
renaming in udev. Match devices by MAC when setting MTU.

optional (bool)

An optional device is not required for booting. Normally, networkd will
wait some time for device to become configured before proceeding with
booting. However, if a device is marked as optional, networkd will not wait
for it. This is only supported by networkd, and the default is false.

Example:

ethernets: eth7: # this is plugged into a test network that is often # down - don’t wait for it to come up during boot. dhcp4: true optional: true

ethernets: eth7: # this is plugged into a test network that is often # down - don’t wait for it to come up during boot. dhcp4: true optional: true

optional-addresses (sequence of scalars)

ethernets: eth7: # this is plugged into a test network that is often # down - don’t wait for it to come up during boot. dhcp4: true optional: true

Specify types of addresses that are not required for a device to be
considered online. This changes the behavior of backends at boot time to
avoid waiting for addresses that are marked optional, and thus consider
the interface as “usable” sooner. This does not disable these addresses,
which will be brought up anyway.

Example:

ethernets:
eth7:
    dhcp4: true
    dhcp6: true
    optional-addresses: [ ipv4-ll, dhcp6 ]

activation-mode (scalar) – since 0.103

Allows specifying the management policy of the selected interface. By
default, netplan brings up any configured interface if possible. Using the
activation-mode setting users can override that behavior by either
specifying manual, to hand over control over the interface state to the
administrator or (for networkd backend only) off to force the link
in a down state at all times. Any interface with activation-mode
defined is implicitly considered optional.
Supported officially as of networkd v248+.

Example:

ethernets:
  eth1:
    # this interface will not be put into an UP state automatically
    dhcp4: true
    activation-mode: manual

routes (sequence of mappings)

Configure static routing for the device; see the Routing section below.

routing-policy (sequence of mappings)

Configure policy routing for the device; see the Routing section below.

1 Like