小编Mic*_*Mic的帖子

找不到设备 eth0

我是 ubuntu 的新手,需要安装 ubuntu xenial 服务器(16.04)版本才能将 MongoDB 安装到 VirtualBox 中。安装后,我尝试从 dhcp 更改为静态 ipv4 地址。所以我改变了 /etc/network/interfaces :

auto lo    

iface lo inet loopback    

allow-hotplug eth0    
iface eth0 inet static    
  address 192.168.56.5   
  netmask 255.255.255.0   
  gateway 192.168.56.1
Run Code Online (Sandbox Code Playgroud)

并重新启动服务器

# but ifconfig -a shows only an enp0s3 interface without any IP address
and 

lo Link encap:Local Loopback      
  inet addr:127.0.0.1 Mask:255.0.0.0      
  inet6 addr: ::1/128 Scope:Host

  up loopback running MTU: ...
Run Code Online (Sandbox Code Playgroud)

(对不起,复制和粘贴不起作用,所以我必须全部输入)

did a reboot once more and tried sudo ifdown and afterwards ifup eth0 
# …
Run Code Online (Sandbox Code Playgroud)

networking ifconfig interface ethernet

17
推荐指数
2
解决办法
11万
查看次数

标签 统计

ethernet ×1

ifconfig ×1

interface ×1

networking ×1