NETPLAN-GENERATE(8)
๐ซ NETPLAN-GENERATE(8) ๐ซ
okay bestie, so this is from the System Manager's Manual (section 8, iykyk) โ it's the glow-up guide for turning your Netplan YAML into actual backend config, and no cap, it's kinda iconic.
โจ NAME โจ
netplan-generate โ generate back-end configuration from Netplan YAML files ๐
โจ SYNOPSIS โจ
netplan [--debug] generate -h|--help
netplan [--debug] generate [--root-dir ROOT_DIR] [--mapping MAPPING]
โจ DESCRIPTION โจ
so basically, netplan generate takes your Netplan YAML and converts it into config files that the back ends actually understand โ think systemd-networkd(8) or NetworkManager(8). it does not apply the generated configuration, okay? it's just doing the conversion, not the whole vibe check of actually running it. ๐
you won't normally need to run this directly, because it's already run by netplan apply, netplan try, or at boot. so like, unless you're doing something specific, the main character energy is handled for you. โจ
only if it's executed during the systemd initializing phase (i.e. "Early boot, before basic.target is reached"), will it attempt to start/apply the newly created service units. Requires feature: generate-just-in-time ๐
when called as a systemd.generator(7), all the parsing and validation errors will be ignored by default. if network definitions are skipped due to parsing errors, they might be incomplete โ which means the back end configuration emitted might not be fully valid. ๐ญ (lowkey a red flag, but it's the documented behavior, fr fr)
for details of the configuration file format, see netplan(5). go off, bestie. ๐
โจ OPTIONS โจ
-h,--helpโ Print basic help. simple as that. ๐ซถ--debugโ Print debugging output during the process. for when you need to see the receipts. ๐--root-dir ROOT_DIRโ Instead of looking in/{lib,etc,run}/netplan, look in/ROOT_DIR/{lib,etc,run}/netplan. it's giving "custom root directory realness." ๐๏ธ--mapping MAPPINGโ Instead of generating output files, parse the configuration files and print some internal information about the device specified inMAPPING. it's like a little peek behind the curtain. ๐
๐ HANDLING MULTIPLE FILES ๐
there are 3 locations that netplan generate considers, and the way they stack is honestly such a mood:
/lib/netplan/*.yaml/etc/netplan/*.yaml/run/netplan/*.yaml
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. so like, it's a whole hierarchy of "i'm the main character now." ๐
or, in other words, /run/netplan is top priority, then /etc/netplan, with /lib/netplan having the lowest priority. periodt. ๐ฏ
if there are files with different names, then they are considered in lexicographical order โ regardless of the directory they're in. later files add to or override earlier files. for example, /run/netplan/10-xyz.yaml would be updated by /lib/netplan/20-abc.yaml. it's giving "alphabetical order is the vibe." ๐ค
if you have two files with the same key/setting, the following rules apply โ and yes, you need to know these:
- if the values are YAML boolean or scalar values (numbers and strings) the old value is overwritten by the new value. boom, replaced. ๐ฅ
- if the values are sequences, the sequences are concatenated โ the new values are appended to the old list. it's giving "the more the merrier." ๐
- if the values are mappings, Netplan will examine the elements of the mappings in turn using these rules. recursive realness. ๐
๐ธ SEE ALSO ๐ธ
netplan(5), netplan-apply(8), netplan-try(8), systemd-networkd(8), NetworkManager(8) โ go read those too, bestie. ๐
๐ฆ AUTHORS ๐ฆ
Daniel Axtens (daniel.axtens@canonical.com). we stan. ๐ซถ
this has been your netplan-generate(8) moment โ from the System Manager's Manual, version NETPLAN-GENERATE(8), dated whenever the manual says (iykyk). stay slay, stay configured. ๐
โจ
periodt. ๐๐
๐ฆ where this page comes from
- arch rolling: netplan 1.2.2-1 ยท GPL-3.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms