查看正在工作的网卡

ifconfig

发现只有lo在工作

查看系统中总共安装的网卡(包含未被激活的)

ifconfig -a

发现有ens18ens19两张网卡

编辑/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
最后修改:2022 年 02 月 23 日
如果觉得我的文章对你有用,请随意赞赏