root@arnold-virtual-machine:~# netplan -h
usage:/usr/sbin/netplan [-h][--debug]...
Network configuration in YAML
optional arguments:-h,--help show this help message and exit
--debug Enable debug messages
Available commands:help Show this help message
apply Apply current netplan config to running system
generate Generate backend specific configuration files from/etc/netplan/*.yaml
get Get a setting by specifying a nested key like "ethernets.eth0.addresses",or"all"
info Show available features
ip Retrieve IP information from the system
set Add new setting by specifying a dotted key=value pair like ethernets.eth0.dhcp4=true
rebind Rebind SR-IOV virtual functions of given physical functions to their driver
try Try to apply a new netplan config to running system,with automatic rollback
root@arnold-virtual-machine:~#
翻译
root@arnold-virtual-machine:~# netplan -h
用法:/usr/sbin/netplan [-h][--debug]...
YAML格式的网络配置
可选参数:
-h,--help 显示帮助信息并退出
--debug 启用调试消息
可用命令:
help 显示此帮助消息
apply 将当前netplan配置应用到运行系统
generate 从/etc/netplan/*.yaml生成特定于后端的配置文件
get 通过指定嵌套键(如"ethernets.eth0.addresses"或"all")获取设置
info 显示可用功能
ip 从系统中检索IP信息
set 通过指定点分键值对(如ethernets.eth0.dhcp4=true)添加新设置
rebind 将给定物理功能的SR-IOV虚拟函数重新绑定到其驱动程序
try 尝试将新的netplan配置应用到运行系统,自动回滚
root@arnold-virtual-machine:~#
root@arnold-virtual-machine:~# netplan apply -h
usage:/usr/sbin/netplan apply[-h][--debug][--sriov-only][--only-ovs-cleanup][--state STATE]
Apply current netplan config to running system
optional arguments:-h,--help show this help message and exit
--debug Enable debug messages
--sriov-only Only apply SR-IOV related configuration and exit
--only-ovs-cleanup Only clean up old OpenVSwitch interfaces and exit
--state STATE Directory containing previous YAML configuration
root@arnold-virtual-machine:~#
root@arnold-virtual-machine:~# netplan generate -h
usage:/usr/sbin/netplan generate [-h][--debug][--root-dir ROOT_DIR][--mapping MAPPING]
Generate backend specific configuration files from/etc/netplan/*.yaml
optional arguments:-h,--help show this help message and exit
--debug Enable debug messages
--root-dir ROOT_DIR Search forand generate configuration files in this root directory instead of /--mapping MAPPING Display the netplan device ID/backend/interface name mapping and exit.
- get:通过指定嵌套键(如ethernets.eth0.addresses或all)获取设置。示例命令:netplan get ethernets.eth0.addresses(注意:这个命令是从/etc/netplan中的yaml文件获取合并的网络信息,而不是当前已生效的网络信息)
netplan get -h
root@arnold-virtual-machine:~# netplan get -h
usage:/usr/sbin/netplan get [-h][--debug][--root-dir ROOT_DIR][key]
Get a setting by specifying a nested key like "ethernets.eth0.addresses",or"all"
positional arguments:
key The nested key in dotted format
optional arguments:-h,--help show this help message and exit
--debug Enable debug messages
--root-dir ROOT_DIR Read configuration files from this root directory instead of /
root@arnold-virtual-machine:~#
root@arnold-virtual-machine:~# netplan info -h
usage:/usr/sbin/netplan info [-h][--debug][--json |--yaml]
Show available features
optional arguments:-h,--help show this help message and exit
--debug Enable debug messages
--json Output version and features in JSON format--yaml Output version and features in YAML format
root@arnold-virtual-machine:~#
root@arnold-virtual-machine:~# netplan info -h
用法:/usr/sbin/netplan info [-h][--debug][--json |--yaml]
显示可用的功能
可选参数:
-h,--help 显示帮助信息并退出
--debug 启用调试消息
--json 以JSON格式输出版本和功能
--yaml 以YAML格式输出版本和功能
root@arnold-virtual-machine:~#
root@arnold-virtual-machine:~# netplan ip -h
usage:/usr/sbin/netplan ip [-h][--debug]...
Retrieve IP information from the system
optional arguments:-h,--help show this help message and exit
--debug Enable debug messages
Available commands:help Show this help message
leases Display IP leases
root@arnold-virtual-machine:~#
root@arnold-virtual-machine:~# netplan ip -h
用法:/usr/sbin/netplan ip [-h][--debug]...
从系统中获取IP信息
可选参数:
-h,--help 显示帮助信息并退出
--debug 启用调试消息
可用命令:
help 显示此帮助消息
leases 显示IP租约
root@arnold-virtual-machine:~#
示例
不知道咋用
- set:通过指定点分键值对(如ethernets.eth0.dhcp4=true)添加新设置。示例命令:netplan set ethernets.eth0.dhcp4=true
netplan set -h
root@arnold-virtual-machine:~# netplan set -h
usage:/usr/sbin/netplan set[-h][--debug][--origin-hint ORIGIN_HINT][--root-dir ROOT_DIR] key_value
Add new setting by specifying a dotted key=value pair like ethernets.eth0.dhcp4=true
positional arguments:
key_value The nested key=value pair in dotted format. Value can be NULL to delete a key.
optional arguments:-h,--help show this help message and exit
--debug Enable debug messages
--origin-hint ORIGIN_HINT
Can be used to help choose a name for the overwrite YAML file. A .yaml suffix will be appended automatically.--root-dir ROOT_DIR Overwrite configuration files in this root directory instead of /
root@arnold-virtual-machine:~#