netplan-generate - Man Page

generate backend configuration from netplan YAML files


netplan [–debug] generate -h | –help

netplan [–debug] generate [–root-dir ROOT_DIR] [–mapping MAPPING]


netplan generate converts netplan YAML into configuration files understood by the backends (systemd-networkd(8) or NetworkManager(8)). It does not apply the generated configuration.

You will not normally need to run this directly as it is run by netplan apply, netplan try, or at boot.

Only if executed during the systemd initializing phase (i.e. “Early bootup, before is reached”), will it attempt to start/apply the newly created service units. Requires feature: generate-just-in-time

For details of the configuration file format, see netplan(5).


-h, –help

Print basic help.


Print debugging output during the process.

–root-dir ROOT_DIR

Instead of looking in /{lib,etc,run}/netplan, look in /ROOT_DIR/{lib,etc,run}/netplan

–mapping MAPPING

Instead of generating output files, parse the configuration files and print some internal information about the device specified in MAPPING.

Handling Multiple Files

There are 3 locations that netplan generate considers:

If there are multiple files with exactly the same name, then only one will be read. A file in /run/netplan will shadow - completely replace - a file with the same name in /etc/netplan. A file in /etc/netplan will itself shadow a file in /lib/netplan.

Or in other words, /run/netplan is top priority, then /etc/netplan, with /lib/netplan having the lowest priority.

If there are files with different names, then they are considered in lexicographical order - regardless of the directory they are in. Later files add to or override earlier files. For example, /run/netplan/10-foo.yaml would be updated by /lib/netplan/20-abc.yaml.

If you have two files with the same key/setting, the following rules apply:

See Also

netplan(5), netplan-apply(8), netplan-try(8), systemd-networkd(8), NetworkManager(8)


Daniel Axtens (<>).

Referenced By

netplan(5), netplan-apply(8), netplan-try(8).