我对ubuntu很陌生,需要安装ubuntu服务器(16.04)版本才能将MongoDB安装到VirtualBox中。安装后,我试图从dhcp更改为静态ipv4地址。因此,我更改了/etc/网络/接口:
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并重新启动服务器。
# 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: ...(对不起,复制和粘贴不起作用,所以我必须全部输入)
did a reboot once more and tried sudo ifdown and afterwards ifup eth0
# but it gives allways :
Cannot find device "eth0"
Failed to bring up eth0VirtualBox网络适配器设置为仅宿主适配器,我已经在192,168.56.4上运行了另一个带有Debian8的VirtualBox。
有人帮我什么忙吗?
发布于 2017-11-14 10:47:44
您可以通过以下命令找到网络设备逻辑名称:
sudo lshw -C network在我的例子中,我的逻辑网络设备名是enp3s0。因此,我将设备名从eth0替换为enp3s0,这样就可以工作了。
https://askubuntu.com/questions/889880
复制相似问题