Netplan
lastmod 2026-02-05created 2025-11-136 edits
The network configuration abstraction renderer
Netplan is a utility for easily configuring networking on a linux system. You simply create a YAML description of the required network interfaces and what each should be configured to do. From this description Netplan will generate all the necessary configuration for your chosen renderer tool.
Categories
How does it work?
Netplan reads network configuration from /etc/netplan/*.yaml which are written by administrators, installers, cloud image instantiations, or other OS deployments. During early boot, Netplan generates backend specific configuration files in /run to hand off control of devices to a particular networking daemon.
Netplan currently works with these supported renderers
- NetworkManager
- Systemd-networkd
How do I use it?
Configuration
Without configuration, Netplan will not do anything. The simplest configuration snippet (to bring up things via DHCP on workstations) is as follows:
This will make Netplan hand over control to NetworkManager, which will manage all devices in its default way (i.e. any ethernet device will come up with DHCP once carrier is detected).
When individual interface configurations are given, it will not let devices automatically come up using DHCP, but each interface needs to be specified in a file in /etc/netplan/ with its explicit YAML settings for the networkd or NetworkManager backend renderers.
Commands
Netplan uses a set of subcommands to drive its behavior:
-
netplan generate: Use/etc/netplanto generate the required configuration for the renderers. -
netplan apply: Apply all configuration for the renderers, restarting them as necessary. -
netplan try: Apply configuration and wait for user confirmation; will roll back if network is broken or no confirmation is given.
Before Ubuntu 17.10
Ubuntu started using netplan from 17.10. Earlier versions use the /etc/network/interfaces file, based on the ifupdown package. See the Debian:NetworkConfiguration page for details.
Configuration file location
Interfaces can be configured in that location, and two renderers can be used: NetworkManager and networkd.
Use the NetworkManger renderer only in an X Window environment, and use the networkd renderer in all other cases.
How to set a static IP
Open a terminal and edit the Netplan configuration file
2. Modify the file as follows. Refer to the comments to understand the function of each line.
# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager
ethernets:
ens18: # 여기서 ens18은 실제 사용 중인 인터페이스 이름
addresses: # 변경 후 IP 주소:
- 192.168.0.90/24
routes:
- to: 0.0.0.0/0 # 모든 트래픽에 대한 기본 경로
via: 192.168.0.1 # 게이트웨이 IP 주소
nameservers:
addresses: [192.168.0.1, 8.8.8.8, 8.8.4.4]
Check IP after applying IP change
You can check with ip addr or ifconfig.
How to specify DNS addresses manually
- Various methods are summarized in Domain Name System#How to specify DNS addresses manually.
Edit the file:
network:
version: 2
ethernets:
eth0: # 실제 인터페이스 이름으로 변경
dhcp4: true
dhcp4-overrides:
use-dns: false
nameservers:
addresses: [8.8.8.8, 1.1.1.1]
Apply:
Troubleshooting
Netplan configuration should NOT be accessible by others
** (generate:12390): WARNING **: 21:47:13.631: Permissions for /etc/netplan/01-network-manager-all.yaml are too open. Netplan configuration should NOT be accessible by others.
This warning indicates that the permissions on the Netplan configuration file are too broad, which could pose a security risk. Because the Netplan configuration file can contain sensitive information, it's recommended that you restrict read/write permissions for general users and groups. Here's how to modify the permissions. You can change the permissions using the following command in the terminal.
See also
- Debian
- Ubuntu
- Network
- Linux:Network
- Debian:NetworkConfiguration - Debian network configuration
- Ubuntu:NetworkConfiguration - Ubuntu network configuration
- ArchLinux:Network
- ifupdown