2、修改netwlpan文件
1 sudo vim /etc/netplwan/50-cloud-init.yaml
2
3 一下为默认配置文件
4
5 # This file is generated from information provided by
6 # the datasource. Changes to it will not persist across an instance.
7 # To disable cloud-init‘s network configuration capabilities, write a file
8 # /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
9 # network: {config: disabled}
10 network:
11 ethernets:
12 ens33:
13 addresses: []
14 dhcp4: true
15 optional: true
16 version: 2
修改第12行的网卡名称和ifconfig -a中的第一个网卡的名称一样就可以了。
保存退出
1 :wq! 或 :x
2 reboot
重启系统,就可以解决了