{
    "mode": "man",
    "parameter": "netplan-generate",
    "section": "8",
    "url": "https://www.chedong.com/phpMan.php/man/netplan-generate/8/json",
    "generated": "2026-06-02T20:22:49Z",
    "synopsis": "netplan [--debug] generate -h | --help\nnetplan [--debug] generate [--root-dir ROOTDIR] [--mapping MAPPING]",
    "sections": {
        "NAME": {
            "content": "netplan-generate - generate backend configuration from netplan YAML files\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "netplan [--debug] generate -h | --help\n\nnetplan [--debug] generate [--root-dir ROOTDIR] [--mapping MAPPING]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "netplan  generate  converts  netplan YAML into configuration files understood by the backends\n(systemd-networkd(8) or NetworkManager(8)).  It does not apply the generated configuration.\n\nYou will not normally need to run this directly as it is run by netplan apply,  netplan  try,\nor at boot.\n\nOnly  if  executed  during  the  systemd  initializing phase (i.e.  \"Early bootup, before ba‐\nsic.target is reached\"), will it attempt to start/apply the newly created service units.  Re‐‐",
            "subsections": [
                {
                    "name": "quires feature: generate-just-in-time",
                    "content": "For details of the configuration file format, see netplan(5).\n"
                }
            ]
        },
        "OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-h, --help",
                    "content": "Print basic help.\n",
                    "flag": "-h",
                    "long": "--help"
                },
                {
                    "name": "--debug",
                    "content": "Print debugging output during the process.\n\n--root-dir ROOTDIR\nInstead of looking in /{lib,etc,run}/netplan, look in /ROOTDIR/{lib,etc,run}/netplan\n\n--mapping MAPPING\nInstead  of  generating output files, parse the configuration files and print some in‐\nternal information about the device specified in MAPPING.\n",
                    "long": "--debug"
                }
            ]
        },
        "HANDLING MULTIPLE FILES": {
            "content": "There are 3 locations that netplan generate considers:\n\n• /lib/netplan/*.yaml\n\n• /etc/netplan/*.yaml\n\n• /run/netplan/*.yaml\n\nIf there are multiple files with exactly the same name, then only one will be read.   A  file\nin /run/netplan will shadow - completely replace - a file with the same name in /etc/netplan.\nA file in /etc/netplan will itself shadow a file in /lib/netplan.\n\nOr in other words, /run/netplan is top priority, then /etc/netplan, with /lib/netplan  having\nthe lowest priority.\n\nIf  there are files with different names, then they are considered in lexicographical order -\nregardless of the directory they are in.  Later files add to or override earlier files.   For\nexample, /run/netplan/10-foo.yaml would be updated by /lib/netplan/20-abc.yaml.\n\nIf you have two files with the same key/setting, the following rules apply:\n\n• If  the  values  are  YAML  boolean or scalar values (numbers and strings) the old value is\noverwritten by the new value.\n\n• If the values are sequences, the sequences are concatenated - the new values  are  appended\nto the old list.\n\n• If the values are mappings, netplan will examine the elements of the mappings in turn using\nthese rules.\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "netplan(5), netplan-apply(8), netplan-try(8), systemd-networkd(8), NetworkManager(8)\n",
            "subsections": []
        },
        "AUTHORS": {
            "content": "Daniel Axtens (<daniel.axtens@canonical.com>).\n\n\n\nnetplan-generate(8)",
            "subsections": []
        }
    },
    "summary": "netplan-generate - generate backend configuration from netplan YAML files",
    "flags": [
        {
            "flag": "-h",
            "long": "--help",
            "arg": null,
            "description": "Print basic help."
        },
        {
            "flag": "",
            "long": "--debug",
            "arg": null,
            "description": "Print debugging output during the process. --root-dir ROOTDIR Instead of looking in /{lib,etc,run}/netplan, look in /ROOTDIR/{lib,etc,run}/netplan --mapping MAPPING Instead of generating output files, parse the configuration files and print some in‐ ternal information about the device specified in MAPPING."
        }
    ],
    "examples": [],
    "see_also": [
        {
            "name": "netplan",
            "section": "5",
            "url": "https://www.chedong.com/phpMan.php/man/netplan/5/json"
        },
        {
            "name": "netplan-apply",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/netplan-apply/8/json"
        },
        {
            "name": "netplan-try",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/netplan-try/8/json"
        },
        {
            "name": "systemd-networkd",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/systemd-networkd/8/json"
        },
        {
            "name": "NetworkManager",
            "section": "8",
            "url": "https://www.chedong.com/phpMan.php/man/NetworkManager/8/json"
        }
    ]
}