Netplan YAML Generator
Write a valid /etc/netplan configuration for Ubuntu without hand-editing YAML. Pick a starting
preset — wired DHCP, static IP or WPA2/WPA3 Wi-Fi — fill in your interface details (or paste/upload
an existing netplan file and it will be imported into the form), and get a live config you can copy straight to
the machine. The generator checks the mistakes that actually break netplan setups: Wi-Fi with the wrong renderer,
addresses missing their /prefix, static IPs with no default route, duplicate interface names —
and hands you the exact install commands, including netplan try, which rolls a bad config back
automatically if you lose connectivity.
1 · Starting point
Pick a preset to fill the form with a working baseline. Choosing a preset replaces the current interfaces — everything can be edited afterwards.
2 · Interfaces
3 · Global settings
/etc/netplan/<name>. Files are merged in alphabetical order — later names override earlier ones.Import an existing config (optional)
Paste a netplan file (e.g. from cat /etc/netplan/50-cloud-init.yaml) or upload it — it is parsed in your browser and loaded into the form above. Bonds, bridges and custom routes beyond the default gateway are reported and left out.
Your netplan config
Install it (three commands)
Run on the target machine. Step 3 is the safe way to apply: if the config breaks your connection, netplan rolls it back automatically after 10 seconds.
Useful day-to-day commands
How it works
Since Ubuntu 18.04, network configuration is driven by netplan: you write plain YAML files in /etc/netplan/ and run sudo netplan apply, which pushes the config to one of two backends (the renderer). systemd-networkd is a lightweight daemon aimed at wired links; NetworkManager is the full-featured manager — and the only one that can drive Wi-Fi. Every file must declare version: 2, and all files in the directory are merged, with later filenames overriding earlier ones (which is why cloud VMs' 50-cloud-init.yaml tends to win).
The difference between netplan apply and netplan try matters on servers: try applies the config, waits 10 seconds, and automatically reverts it if you lose connectivity — so a typo in a static IP can't lock you out of a machine over the network.
The mistakes that actually break netplan configs
- Boot stalls ~90 seconds on a headless server. Without
optional: true, systemd-networkd waits for the interface to come up before continuing boot — and an unplugged cable never does. Tick optional on machines you manage remotely. - "invalid YAML" from a tab character. YAML indentation must be spaces (netplan uses 2). Pasting from a word processor or an editor with tabs-on is the usual cause — this generator writes clean 2-space YAML, so import first and re-export.
- Wi-Fi that never connects. Netplan's Wi-Fi support only works with
renderer: networkmanager. Awifis:block under systemd-networkd is silently ignored — the generator flags this as an error. - Your settings keep getting overridden on a cloud VM. cloud-init writes
/etc/netplan/50-cloud-init.yamlon every boot and it sorts after01-*.yaml. Name your file99-*.yaml, or remove the cloud-init file (sudo rm /etc/netplan/50-cloud-init.yaml) once you've taken over networking. - Address without a prefix length.
addresses: [192.168.1.10]is rejected bynetplan generate— the CIDR suffix (/24) is mandatory. Size it with an IP/subnet calculator rather than guessing. - The deprecated
gateway4:key. Older guides use it, but modern netplan wants a route instead:routes: [{to: default, via: 192.168.1.1}]— which is what this generator writes.
Key reference
| Key | What it does |
|---|---|
dhcp4: true | Get an IPv4 address (and usually DNS) from a DHCP server. The default for most home and office networks. |
dhcp6: auto / managed | IPv6 from router advertisements (stateless) or full stateful DHCPv6. Leave out (or none) if you don't use IPv6. |
addresses: | Static addresses in CIDR form, e.g. [192.168.1.10/24]. Multiple entries allowed. |
routes: | Routing table entries. to: default + via: <gateway> is the default route (replaces the old gateway4). |
nameservers: | addresses: lists DNS servers used by this interface. |
optional: true | Don't wait for this interface during boot — the fix for headless-server boot stalls. |
mtu: | Maximum transmission unit. 1500 is standard Ethernet; 9001 enables jumbo frames (switch must agree). |
macaddress: | Force a hardware address — useful for spoofing or when a driver reports the wrong MAC. |
access-points: | Wi-Fi only: maps each SSID to its settings. password: sets the WPA2/WPA3 PSK; omit it for an open network. |
Related tools
Everything else you'll want while reshaping a network:
Suggested
Luke Keam | techgeek.biz