LinuxCommandLibrary

netplan

network configuration utility for Ubuntu and other Linux distributions

TLDR

Apply network configuration permanently

$ sudo netplan apply
copy
Generate backend configuration files
$ sudo netplan generate
copy
Configure interface to use DHCP
$ sudo netplan set ethernets.[interface].dhcp4=true
copy
Try configuration changes with timeout
$ sudo netplan try --timeout [120]
copy
Apply with debug output
$ sudo netplan --debug apply
copy
Display current status
$ netplan status
copy
Get current configuration value
$ netplan get [ethernets]
copy

SYNOPSIS

netplan [--debug] command [options]

DESCRIPTION

netplan is a network configuration utility for Ubuntu and other Linux distributions. It uses YAML files to describe network interfaces and generates configuration for backend renderers like NetworkManager or systemd-networkd.
The abstraction layer allows the same configuration to work with different network management backends, simplifying network setup across environments.

PARAMETERS

--debug

Enable debug output
--root-dir _path_
Use alternate root directory
--timeout _seconds_
Timeout for try command before rollback

CONFIGURATION

Configuration files are stored in **/etc/netplan/*.yaml**
Example YAML:

$ network:
  version: 2
  ethernets:
    eth0:
      dhcp4: true
copy

COMMANDS

apply

Apply network configuration and make persistent
generate
Generate backend-specific configuration files
try
Try configuration changes with automatic rollback
get
Get current configuration values
set
Set configuration values
status
Display current network status
info
Show available features

CAVEATS

YAML syntax errors prevent configuration from applying. The try command requires a timeout or manual confirmation. Backend must be installed (NetworkManager or systemd-networkd). Changes to configuration files require apply to take effect.

HISTORY

netplan was developed by Canonical for Ubuntu, first appearing in Ubuntu 17.10. It was designed to provide a unified network configuration system that works across different network backends while being human-readable.

SEE ALSO

networkctl(1), nmcli(1), ip(8)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community