查看正在工作的网卡
ifconfig
发现只有lo
在工作
查看系统中总共安装的网卡(包含未被激活的)
ifconfig -a
发现有ens18
和ens19
两张网卡
编辑/etc/network/interfaces
nano /etc/network/interfaces
修改为一下内容
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
\#ens18为网卡名称
auto ens18
iface ens18 inet dhcp
第二块网卡ens19不用加,否则会出现开机提示“A start job is running for Raise network interface”,造成开机速度慢。
重启networking
服务
systemctl restart networking