ethernets:
modems:
wifis:
bridges:
bonds:
tunnels:
vlans:
nm-devices:
Distribution installers, cloud instantiation, image builds for particular devices, or any other way to deploy an operating system put its desired network configuration into YAML configuration file(s). During early boot, the netplan “network renderer” runs which reads /{lib,etc,run}/netplan/*.yaml and writes configuration to /run to hand off control of devices to the specified networking daemon.
/{lib,etc,run}/netplan/*.yaml
/run
virbr0
lxdbr0
netplan’s configuration files use the YAML format. All /{lib,etc,run}/netplan/*.yaml are considered. Lexicographically later files (regardless of in which directory they are) amend (new mapping keys) or override (same mapping keys) previous ones. A file in /run/netplan completely shadows a file with same name in /etc/netplan, and a file in either of those directories shadows a file with the same name in /lib/netplan.
/run/netplan
/etc/netplan
/lib/netplan
The top-level node in a netplan configuration file is a network: mapping that contains version: 2 (the YAML currently being used by curtin, MaaS, etc. is version 1), and then device definitions grouped by their type, such as ethernets:, modems:, wifis:, or bridges:. These are the types that our renderer can understand and are supported by our backends.
network:
version: 2
Each type block contains device definitions as a map where the keys (called “configuration IDs”) are defined as below.
The key names below the per-device-type definition maps (like ethernets:) are called “ID”s. They must be unique throughout the entire set of configuration files. Their primary purpose is to serve as anchor names for composite devices, for example to enumerate the members of a bridge that is currently being defined.
(Since 0.97) If an interface is defined with an ID in a configuration file; it will be brought up by the applicable renderer. To not have netplan touch an interface at all, it should be completely omitted from the netplan configuration files.
There are two physically/structurally different classes of device definitions, and the ID field has a different interpretation for each:
(Examples: ethernet, modem, wifi) These can dynamically come and go between reboots and even during runtime (hotplugging). In the generic case, they can be selected by match: rules on desired properties, such as name/name pattern, MAC address, driver, or device paths. In general these will match any number of devices (unless they refer to properties which are unique such as the full path or MAC address), so without further knowledge about the hardware these will always be considered as a group.
match:
It is valid to specify no match rules at all, in which case the ID field is simply the interface name to be matched. This is mostly useful if you want to keep simple cases simple, and it’s how network device configuration has been done for a long time.
If there are match: rules, then the ID field is a purely opaque name which is only being used for references from definitions of compound devices in the config.
match
(Examples: veth, bridge, bond) These are fully under the control of the config file(s) and the network stack. I. e. these devices are being created instead of matched. Thus match: and set-name: are not applicable for these, and the ID field is the name of the created virtual device.
set-name:
Note: Some options 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 options like: wakeonlan or *-offload.
wakeonlan
*-offload
This selects a subset of available physical devices by various hardware properties. The following configuration will then apply to all matching devices, as soon as they appear. All specified properties must match.
name
NetworkManager
macaddress
driver
DRIVER
Examples:
all cards on second PCI bus:
match: name: enp2*
fixed MAC address:
match: macaddress: 11:22:33:AA:BB:FF
first card of driver ixgbe:
ixgbe
match: driver: ixgbe name: en*s0
first card with a driver matching bcmgenet or smsc*:
bcmgenet
smsc*
match: driver: ["bcmgenet", "smsc*"] name: en*
set-name
When matching on unique properties such as path or MAC, or with additional assumptions such as “there will only ever be one wifi device”, match rules can be written so that they only match one device. Then this property can be used to give that device a more specific/desirable/nicer name than the default from udev’s ifnames. Any additional device that satisfies the match rules will then fail to get renamed and keep the original kernel name (and dmesg will show an error).
Enable wake on LAN. Off by default.
emit-lldp
(networkd backend only) Whether to emit LLDP packets. Off by default.
receive-checksum-offload
(networkd backend only) If set to true (false), the hardware offload for checksumming of ingress network packets is enabled (disabled). When unset, the kernel’s default will be used.
transmit-checksum-offload
(networkd backend only) If set to true (false), the hardware offload for checksumming of egress network packets is enabled (disabled). When unset, the kernel’s default will be used.
tcp-segmentation-offload
(networkd backend only) If set to true (false), the TCP Segmentation Offload (TSO) is enabled (disabled). When unset, the kernel’s default will be used.
tcp6-segmentation-offload
(networkd backend only) If set to true (false), the TCP6 Segmentation Offload (tx-tcp6-segmentation) is enabled (disabled). When unset, the kernel’s default will be used.
generic-segmentation-offload
(networkd backend only) If set to true (false), the Generic Segmentation Offload (GSO) is enabled (disabled). When unset, the kernel’s default will be used.
generic-receive-offload
(networkd backend only) If set to true (false), the Generic Receive Offload (GRO) is enabled (disabled). When unset, the kernel’s default will be used.
large-receive-offload
(networkd backend only) If set to true (false), the Large Receive Offload (LRO) is enabled (disabled). When unset, the kernel’s default will be used.
openvswitch
This provides additional configuration for the network device for openvswitch. If openvswitch is not available on the system, netplan treats the presence of openvswitch configuration as an error.
Any supported network device that is declared with the openvswitch mapping (or any bond/bridge that includes an interface with an openvswitch configuration) will be created in openvswitch instead of the defined renderer. In the case of a vlan definition declared the same way, netplan will create a fake VLAN bridge in openvswitch with the requested vlan properties.
vlan
external-ids
other-config
lacp
active
passive
off
fail-mode
secure
standalone
mcast-snooping
protocols
OpenFlow10
OpenFlow11
OpenFlow12
OpenFlow13
OpenFlow14
OpenFlow15
OpenFlow16
rstp
controller
Valid for bridge interfaces. Specify an external OpenFlow controller.
addresses
[tcp:127.0.0.1:6653, "ssl:[fe80::1234%eth0]:6653"]
connection-mode
in-band
out-of-band
ports
OpenvSwitch patch ports. Each port is declared as a pair of names which can be referenced as interfaces in dependent virtual devices (bonds, bridges).
Example:
openvswitch: ports: - [patch0-1, patch1-0]
ssl
Valid for global openvswitch settings. Options for configuring SSL server endpoint for the switch.
ca-cert
certificate
private-key
renderer
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.
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.
sriov
dhcp4
Enable DHCP for IPv4. Off by default.
dhcp6
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.
rdnssd
ipv6-mtu
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
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
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: [ ]
link-local: [ ipv4 ]
link-local: [ ipv4, ipv6 ]
link-local: [ ]
ignore-carrier
(networkd backend only) Allow the specified interface to be configured even if it has no carrier.
critical
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
(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.
mac
duid
dhcp4-overrides
(networkd backend only) Overrides default DHCP behavior; see the DHCP Overrides section below.
DHCP Overrides
dhcp6-overrides
accept-ra
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.
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.
addr/prefixlen
addr
inet_pton
prefixlen
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
forever
0
PreferredLifetime
systemd-networkd
label
ip address label
Example: addresses: [192.168.14.2/24, "2001:1::1/64"]
addresses: [192.168.14.2/24, "2001:1::1/64"]
ethernets: eth0: addresses: - 10.0.0.15/24: lifetime: 0 label: "maas" - "2001:1::1/64"
ipv6-address-generation
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.
eui64
stable-privacy
ipv6-address-token
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
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.
Default routes
routing-policy
Example for IPv4: gateway4: 172.16.0.1 Example for IPv6: gateway6: "2001:4::1"
gateway4: 172.16.0.1
gateway6: "2001:4::1"
nameservers
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.
addresses:
gateway*
search:
ethernets: id0: [...] nameservers: search: [lab, home] addresses: [8.8.8.8, "FEDC::1"]
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.
ethernets: id0: match: macaddress: 52:54:00:6b:3c:58 [...] macaddress: 52:54:00:6b:3c:59
mtu
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
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.
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
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.
ethernets: eth7: dhcp4: true dhcp6: true optional-addresses: [ ipv4-ll, dhcp6 ]
activation-mode
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+.
manual
ethernets: eth1: # this interface will not be put into an UP state automatically dhcp4: true activation-mode: manual
routes
Configure static routing for the device; see the Routing section below.
Routing
Configure policy routing for the device; see the Routing section below.
Several DHCP behavior overrides are available. Most currently only have any effect when using the networkd backend, with the exception of use-routes and route-metric.
use-routes
route-metric
Overrides only have an effect if the corresponding dhcp4 or dhcp6 is set to true.
true
If both dhcp4 and dhcp6 are true, the networkd backend requires that dhcp4-overrides and dhcp6-overrides contain the same keys and values. If the values do not match, an error will be shown and the network configuration will not be applied.
When using the NetworkManager backend, different values may be specified for dhcp4-overrides and dhcp6-overrides, and will be applied to the DHCP client processes as specified in the netplan YAML.
The dhcp4-overrides and dhcp6-overrides mappings override the default DHCP behavior.
use-dns
use-ntp
send-hostname
use-hostname
use-mtu
false
hostname
use-domains
Takes a boolean, or the special value “route”. When true, the domain name received from the DHCP server will be used as DNS search domain over this link, similar to the effect of the Domains= setting. If set to “route”, the domain name received from the DHCP server will be used for routing DNS queries only, but not for searching, similar to the effect of the Domains= setting when the argument is prefixed with “~”.
Requires feature: dhcp-use-domains
Complex routing is possible with netplan. Standard static routes as well as policy routing using routing tables are supported via the networkd backend.
These options are available for all types of interfaces.
The most common need for routing concerns the definition of default routes to reach the wider Internet. Those default routes can only defined once per IP family and routing table. A typical example would look like the following:
eth0: [...] routes: - to: default # could be 0/0 or 0.0.0.0/0 optionally via: 10.0.0.1 metric: 100 on-link: true - to: default # could be ::/0 optionally via: cf02:de:ad:be:ef::2 eth1: [...] routes: - to: default via: 172.134.67.1 metric: 100 on-link: true table: 76 # Not on the main routing table, does not conflict with the eth0 default route
The routes block defines standard static routes for an interface. At least to must be specified. If type is local or nat a default scope of host is assumed. If type is unicast and no gateway (via) is given or type is broadcast, multicast or anycast a default scope of link is assumend. Otherwise, a global scope is the default setting.
to
local
nat
host
unicast
via
broadcast
multicast
anycast
link
global
For from, to, and via, both IPv4 and IPv6 addresses are recognized, and must be in the form addr/prefixlen or addr.
from
on-link
metric
type
scope
table
/etc/iproute2/rt_tables
congestion-window
advertised-receive-window
The routing-policy block defines extra routing policy for a network, where traffic may be handled specially based on the source IP, firewall marking, etc.
For from, to, both IPv4 and IPv6 addresses are recognized, and must be in the form addr/prefixlen or addr.
priority
mark
type-of-service
Netplan supports advanced authentication settings for ethernet and wifi interfaces, as well as individual wifi networks, by means of the auth block.
auth
Specifies authentication settings for a device of type ethernets:, or an access-points: entry on a wifis: device.
access-points:
The auth block supports the following properties:
key-management
none
psk
eap
802.1x
password
The following properties can be used if key-management is eap or 802.1x:
method
tls
peap
ttls
identity
anonymous-identity
ca-certificate
client-certificate
client-key
client-key-password
phase2-auth
Ethernet device definitions, beyond common ones described above, also support some additional properties that can be used for SR-IOV devices.
(SR-IOV devices only) The link property declares the device as a Virtual Function of the selected Physical Function device, as identified by the given netplan id.
ethernets: enp1: {...} enp1s16f1: link: enp1
virtual-function-count
(SR-IOV devices only) In certain special cases VFs might need to be configured outside of netplan. For such configurations virtual-function-count can be optionally used to set an explicit number of Virtual Functions for the given Physical Function. If unset, the default is to create only as many VFs as are defined in the netplan configuration. This should be used for special cases only.
Requires feature: sriov
embedded-switch-mode
(SR-IOV devices only) Change the operational mode of the embedded switch of a supported SmartNIC PCI device (e.g. Mellanox ConnectX-5). Possible values are switchdev or legacy, if unspecified the vendor’s default configuration is used.
switchdev
legacy
Requires feature: eswitch-mode
delay-virtual-functions-rebind
(SR-IOV devices only) Delay rebinding of SR-IOV virtual functions to its driver after changing the embedded-switch-mode setting to a later stage. Can be enabled when bonding/VF LAG is in use. Defaults to false.
GSM/CDMA modem configuration is only supported for the NetworkManager backend. systemd-networkd does not support modems.
Requires feature: modems
apn
Set the carrier APN (Access Point Name). This can be omitted if auto-config is enabled.
auto-config
Specify whether to try and autoconfigure the modem by doing a lookup of the carrier against the Mobile Broadband Provider database. This may not work for all carriers.
device-id
Specify the device ID (as given by the WWAN management service) of the modem to match. This can be found using mmcli.
mmcli
network-id
Specify the Network ID (GSM LAI format). If this is specified, the device will not roam networks.
number
The number to dial to establish the connection to the mobile broadband network. (Deprecated for GSM)
Specify the password used to authenticate with the carrier network. This can be omitted if auto-config is enabled.
pin
Specify the SIM PIN to allow it to operate if a PIN is set.
sim-id
Specify the SIM unique identifier (as given by the WWAN management service) which this connection applies to. If given, the connection will apply to any device also allowed by device-id which contains a SIM card matching the given identifier.
sim-operator-id
Specify the MCC/MNC string (such as “310260” or “21601”) which identifies the carrier that this connection should apply to. If given, the connection will apply to any device also allowed by device-id and sim-id which contains a SIM card provisioned by the given operator.
username
Specify the username used to authentiate with the carrier network. This can be omitted if auto-config is enabled.
Note that systemd-networkd does not natively support wifi, so you need wpasupplicant installed if you let the networkd renderer handle wifi.
access-points
This provides pre-configured connections to NetworkManager. Note that users can of course select other access points/SSIDs. The keys of the mapping are the SSIDs, and the values are mappings with the following supported properties:
Enable WPA2 authentication and set the passphrase for it. If neither this nor an auth block are given, the network is assumed to be open. The setting
password: "S3kr1t"
is equivalent to
auth: key-management: psk password: "S3kr1t"
mode
infrastructure
ap
adhoc
bssid
band
5GHz
2.4GHz
channel
hidden
wakeonwlan
This enables WakeOnWLan on supported devices. Not all drivers support all options. May be any combination of any, disconnect, magic_pkt, gtk_rekey_failure, eap_identity_req, four_way_handshake, rfkill_release or tcp (NetworkManager only). Or the exclusive default flag (the default).
any
disconnect
magic_pkt
gtk_rekey_failure
eap_identity_req
four_way_handshake
rfkill_release
tcp
default
interfaces
All devices matching this ID list will be added to the bridge. This may be an empty list, in which case the bridge will be brought online with no member interfaces.
ethernets: switchports: match: {name: "enp2*"} [...] bridges: br0: interfaces: [switchports]
parameters
Customization parameters for special bridging options. Time intervals may need to be expressed as a number of seconds or milliseconds: the default value type is specified below. If necessary, time intervals can be qualified using a time suffix (such as “s” for seconds, “ms” for milliseconds) to allow for more control over its behavior.
ageing-time
65535
port-priority
63
forward-delay
hello-time
max-age
path-cost
stp
All devices matching this ID list will be added to the bond.
ethernets: switchports: match: {name: "enp2*"} [...] bonds: bond0: interfaces: [switchports]
Customization parameters for special bonding options. Time intervals may need to be expressed as a number of seconds or milliseconds: the default value type is specified below. If necessary, time intervals can be qualified using a time suffix (such as “s” for seconds, “ms” for milliseconds) to allow for more control over its behavior.
balance-rr
active-backup
balance-xor
802.3ad
balance-tlb
balance-alb
balance-tcp
balance-slb
lacp-rate
slow
fast
mii-monitor-interval
min-links
transmit-hash-policy
layer2
layer3+4
layer2+3
encap2+3
encap3+4
ad-select
stable
bandwidth
count
all-slaves-active
arp-interval
arp-ip-targets
arp-validate
backup
all
arp-all-targets
up-delay
down-delay
fail-over-mac-policy
follow
gratuitous-arp
Specify how many ARP packets to send after failover. Once a link is up on a new slave, a notification is sent and possibly repeated if this value is set to a number greater than 1. The default value is 1 and valid values are between 1 and 255. This only affects active-backup mode.
1
255
For historical reasons, the misspelling gratuitious-arp is also accepted and has the same function.
gratuitious-arp
packets-per-slave
primary-reselect-policy
always
better
failure
resend-igmp
In modes balance-rr, active-backup, balance-tlb and balance-alb, a failover can switch IGMP traffic from one slave to another.
This parameter specifies how many IGMP membership reports are issued on a failover event. Values range from 0 to 255. 0 disables sending membership reports. Otherwise, the first membership report is sent on failover and subsequent reports are sent at 200ms intervals.
learn-packet-interval
0x7fffffff
primary
Tunnels allow traffic to pass as if it was between systems on the same local network, although systems may be far from each other but reachable via the Internet. They may be used to support IPv6 traffic on a network where the ISP does not provide the service, or to extend and “connect” separate local networks. Please see https://en.wikipedia.org/wiki/Tunneling_protocol for more general information about tunnels.
Defines the tunnel mode. Valid options are sit, gre, ip6gre, ipip, ipip6, ip6ip6, vti, vti6 and wireguard. Additionally, the networkd backend also supports gretap and ip6gretap modes. In addition, the NetworkManager backend supports isatap tunnels.
sit
gre
ip6gre
ipip
ipip6
ip6ip6
vti
vti6
wireguard
gretap
ip6gretap
isatap
Defines the address of the local endpoint of the tunnel.
remote
Defines the address of the remote endpoint of the tunnel.
ttl
Defines the TTL of the tunnel.
key
Define keys to use for the tunnel. The key can be a number or a dotted quad (an IPv4 address). For wireguard it can be a base64-encoded private key or (as of networkd v242+) an absolute path to a file, containing the private key (since 0.100). It is used for identification of IP transforms. This is only required for vti and vti6 when using the networkd backend, and for gre or ip6gre tunnels when using the NetworkManager backend.
This field may be used as a scalar (meaning that a single key is specified and to be used for input, output and private key), or as a mapping, where you can further specify input/output/private.
input
output
private
keys
Alternate name for the key field. See above.
tunnels: tun0: mode: gre local: ... remote: ... keys: input: 1234 output: 5678 tunnels: tun0: mode: vti6 local: ... remote: ... key: 59568549 tunnels: wg0: mode: wireguard addresses: [...] peers: - keys: public: rlbInAj0qV69CysWPQY7KEBnKxpYCpaWqOs/dLevdWc= shared: /path/to/shared.key ... key: mNb7OIIXTdgW4khM7OFlzJ+UPs7lmcWHV7xjPgakMkQ= tunnels: wg0: mode: wireguard addresses: [...] peers: - keys: public: rlbInAj0qV69CysWPQY7KEBnKxpYCpaWqOs/dLevdWc= ... keys: private: /path/to/priv.key
WireGuard specific keys:
Firewall mark for outgoing WireGuard packets from this interface, optional.
port
UDP port to listen at or auto. Optional, defaults to auto.
auto
peers
A list of peers, each having keys documented below.
tunnels: wg0: mode: wireguard key: /path/to/private.key mark: 42 port: 5182 peers: - keys: public: rlbInAj0qV69CysWPQY7KEBnKxpYCpaWqOs/dLevdWc= allowed-ips: [0.0.0.0/0, "2001:fe:ad:de:ad:be:ef:1/24"] keepalive: 23 endpoint: 1.2.3.4:5 - keys: public: M9nt4YujIOmNrRmpIRTmYSfMdrpvE7u6WkG8FY8WjG4= shared: /some/shared.key allowed-ips: [10.10.10.20/24] keepalive: 22 endpoint: 5.4.3.2:1
endpoint
Remote endpoint IPv4/IPv6 address or a hostname, followed by a colon and a port number.
allowed-ips
A list of IP (v4 or v6) addresses with CIDR masks from which this peer is allowed to send incoming traffic and to which outgoing traffic for this peer is directed. The catch-all 0.0.0.0/0 may be specified for matching all IPv4 addresses, and ::/0 may be specified for matching all IPv6 addresses.
keepalive
An interval in seconds, between 1 and 65535 inclusive, of how often to send an authenticated empty packet to the peer for the purpose of keeping a stateful firewall or NAT mapping valid persistently. Optional.
Define keys to use for the WireGuard peers.
This field can be used as a mapping, where you can further specify the public and shared keys.
public
shared
id
VLAN ID, a number between 0 and 4094.
netplan ID of the underlying device definition on which this VLAN gets created.
ethernets: eno1: {...} vlans: en-intra: id: 1 link: eno1 dhcp4: yes en-vpn: id: 2 link: eno1 addresses: ...
The nm-devices device type is for internal use only and should not be used in normal configuration files. It enables a fallback mode for unsupported settings, using the passthrough mapping.
nm-devices
passthrough
In addition to the other fields available to configure interfaces, some backends may require to record some of their own parameters in netplan, especially if the netplan definitions are generated automatically by the consumer of that backend. Currently, this is only used with NetworkManager.
networkmanager
Keeps the NetworkManager-specific configuration parameters used by the daemon to recognize connections.
uuid
stable-id
device
Configure an ethernet device with networkd, identified by its name, and enable DHCP:
network: version: 2 ethernets: eno1: dhcp4: true
This is an example of a static-configured interface with multiple IPv4 addresses and multiple gateways with networkd, with equal route metric levels, and static DNS nameservers (Google DNS for this example):
network: version: 2 renderer: networkd ethernets: eno1: addresses: - 10.0.0.10/24 - 11.0.0.11/24 nameservers: addresses: - 8.8.8.8 - 8.8.4.4 routes: - to: 0.0.0.0/0 via: 10.0.0.1 metric: 100 - to: 0.0.0.0/0 via: 11.0.0.1 metric: 100
This is a complex example which shows most available features:
network: version: 2 # if specified, can only realistically have that value, as networkd cannot # render wifi/3G. renderer: NetworkManager ethernets: # opaque ID for physical interfaces, only referred to by other stanzas id0: match: macaddress: 00:11:22:33:44:55 wakeonlan: true dhcp4: true addresses: - 192.168.14.2/24 - 192.168.14.3/24 - "2001:1::1/64" nameservers: search: [foo.local, bar.local] addresses: [8.8.8.8] routes: - to: default via: 192.168.14.1 - to: default via: "2001:1::2" - to: 0.0.0.0/0 via: 11.0.0.1 table: 70 on-link: true metric: 3 routing-policy: - to: 10.0.0.0/8 from: 192.168.14.2/24 table: 70 priority: 100 - to: 20.0.0.0/8 from: 192.168.14.3/24 table: 70 priority: 50 # only networkd can render on-link routes and routing policies renderer: networkd lom: match: driver: ixgbe # you are responsible for setting tight enough match rules # that only match one device if you use set-name set-name: lom1 dhcp6: true switchports: # all cards on second PCI bus unconfigured by # themselves, will be added to br0 below match: name: enp2* mtu: 1280 wifis: all-wlans: # useful on a system where you know there is # only ever going to be one device match: {} access-points: "Joe's home": # mode defaults to "infrastructure" (client) password: "s3kr1t" # this creates an AP on wlp1s0 using hostapd # no match rules, thus the ID is the interface name wlp1s0: access-points: "guest": mode: ap # no WPA config implies default of open bridges: # the key name is the name for virtual (created) interfaces # no match: and set-name: allowed br0: # IDs of the components; switchports expands into multiple interfaces interfaces: [wlp1s0, switchports] dhcp4: true