← 返回命令列表

Linux command

netplan 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

Apply

sudo netplan apply

Generate

sudo netplan generate

Example

sudo netplan set ethernets.[interface].dhcp4=true

Try

sudo netplan try --timeout [120]

Example

sudo netplan --debug apply

Example

netplan status

Get

netplan get [ethernets]

说明

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.

参数

--debug
Enable debug output
--root-dir _path_
Use alternate root directory.
--timeout _seconds_
Timeout for try command before rollback default: 120.
--config-file _path_
Use a specific configuration file.

FAQ

What is the netplan command used for?

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.

How do I run a basic netplan example?

Run `sudo netplan apply` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --debug do in netplan?

Enable debug output