我的服务器有一个文件 /etc/netplan/50-cloud-init.yaml ,内容如下:
# This file is generated from information provided by
# the datasource. Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
version: 2
ethernets:
ens3:
dhcp4: true
match:
macaddress: fa:**:**:**:**:**
set-name: ens3
Run Code Online (Sandbox Code Playgroud)
这导致以下接口配置:
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc fq_codel state UP group default qlen 1000
link/ether fa:**:**:**:**:** brd ff:ff:ff:ff:ff:ff
inet 10.0.0.5/24 brd 10.0.0.255 scope global dynamic …
Run Code Online (Sandbox Code Playgroud)