Debian虚拟机无网卡解决方案,debian虚拟机


Debian虚拟机没有网卡无法联网

打开/etc/network/interfaces

\# This file describes the network interfaces available on your system
\# and how to activate them. For more information, see interfaces(5).
\# The loopback network interface
auto lo
iface lo inet loopback

\# The primary network interface
allow-hotplug eth0
auto eth0
iface eth0 inet static
address 192.168.1.199
netmask 255.255.255.0
gatway 192.168.1.1
~                                                                                                             
~

如果dhcp
iface eth0 inet dhcp
网关
/etc/resolv.conf

nameserver 192.168.1.1
nameserver 0.0.0.0  
/etc/init.d/networking restart

失败,查看原因,找不到driver,eth0执行

dmesg | grep eth

才发现

[5.715564] e1000 0000:02:01.0 eth0: (PCI:66MHz:32-bit) 00:0c:29:7d:bf:43
[5.715573] e1000 0000:02:01.0 eth0: Intel(R) PRO/1000 Network Connection
[5.719709] e1000 0000:02:01.0 ens33: renamed from eth0

所以改成ens33就行了

相关内容