Netplan Generator

Build Ubuntu Netplan YAML for ethernet or Wi-Fi — DHCP or static IP, DNS, and routes — then copy or download a file you can drop in /etc/netplan/.

Netplan YAML generator

Pick a preset, set DHCP or a static address, and copy a Netplan file for /etc/netplan/. The YAML updates live.

Presets
Renderer
Interfaces

netplan try rolls back if you do not confirm. On cloud images, replace or disable 50-cloud-init.yaml so two files do not both apply. Wi-Fi passwords live in this file — install -m 600 keeps it private.

Runs in your browser. Nothing is uploaded.

Need a Netplan config without hunting through YAML examples? Pick a preset above, set DHCP or a static address, and copy a file for /etc/netplan/. This netplan generator writes current Netplan syntax (routes, not gateway4) and stays in your browser. Part of the Linux tools on TechOpt.io. For file permissions after you drop the YAML in place, see the chmod calculator.

How this netplan generator writes YAML

Netplan is Ubuntu’s network configuration layer. You describe interfaces in YAML; Netplan renders that into systemd-networkd or NetworkManager and applies it, as covered in the Netplan documentation. A typical file starts with network:, version: 2, a renderer, then ethernets: and/or wifis: keyed by interface name.

DHCP is one boolean per address family (dhcp4, dhcp6). Static addresses are CIDR values such as 192.168.1.10/24. DNS sits on the interface under nameservers. The default route is a routes entry with to: default and via set to your gateway.

Where to put the file

Drop the YAML in /etc/netplan/. Ubuntu Server installer images often already have 00-installer-config.yaml. Cloud images use 50-cloud-init.yaml. Two files that both configure the same NIC will fight. Replace or disable the old one (cloud-init network config included) before you apply.

If the file contains a Wi-Fi password, keep it mode 600. The copy-ready commands above use sudo install -m 600 so you do not leave a world-readable secret in /etc/netplan/.

networkd vs NetworkManager

Pick one renderer for the machine. networkd is the usual choice on Ubuntu Server and headless boxes. NetworkManager is the usual choice on Ubuntu Desktop, laptops, and anything you want to manage with the GUI or nmcli. Mixing both on the same host is a common source of “why did my static IP vanish” tickets.

Apply safely with netplan try

sudo netplan generate checks the YAML. sudo netplan apply writes the backend config and activates it immediately. sudo netplan try does the same but rolls back if you do not confirm within 120 seconds — use that on a remote SSH session or any homelab box you cannot walk over to. This generator copies a netplan try command.

FAQ

Where does the Netplan YAML file go?

Place it in /etc/netplan/ with a .yaml extension, for example /etc/netplan/01-netcfg.yaml. Ubuntu Server installer images often already have 00-installer-config.yaml; cloud images use 50-cloud-init.yaml. Replace or disable the old file so two configs do not fight, then run sudo netplan try.

Should I use networkd or NetworkManager?

Use networkd on Ubuntu Server and most headless boxes — that is Netplan’s default renderer. Use NetworkManager on Ubuntu Desktop, laptops, and any host where you want the GUI or nmcli to manage Wi-Fi. The renderer key at the top of the file picks one; do not mix them on the same machine.

What is the difference between netplan try and netplan apply?

sudo netplan apply writes the backend config and activates it immediately. sudo netplan try does the same but rolls back if you do not confirm within 120 seconds, which is the safer way to test a remote or homelab change. This generator copies a netplan try command.

Why does this generator use routes instead of gateway4?

gateway4 and gateway6 are deprecated in Netplan. Current Ubuntu expects a default route under routes, with to: default and via set to your gateway. The YAML above follows that form so netplan generate does not warn.

Does this Netplan generator upload my Wi-Fi password?

No. It runs entirely in your browser. Interface names, addresses, and Wi-Fi passwords never leave your machine.

Looking for more Linux how-tos? Browse the Linux guides or the rest of the tools.