Skip to content
linuxsystem-management

Netplan

netplanlinuxnetworking
Plain English

Netplan is where Ubuntu keeps network settings. You describe what you want in a small YAML file and Netplan configures the network for you.

Technical Definition

Netplan reads /etc/netplan/*.yaml and renders config for a backend: systemd-networkd (servers) or NetworkManager (desktops).

  • netplan get shows the merged config.
  • netplan try applies and rolls back after 120 seconds unless confirmed: use it over SSH.
  • netplan apply makes it permanent.
  • Files must be mode 600.

Source: netplan(5)

Netplan in practice

network:
  version: 2
  ethernets:
    enp0s3:
      addresses: [192.168.1.60/24]
      routes:
        - to: default
          via: 192.168.1.1
      nameservers:
        addresses: [1.1.1.1]

$ sudo netplan try
In the Wild

Static IPs for a home server, Pi-hole, or file share are set in Netplan. Use netplan try first so a typo does not lock you out.