我正在尝试配置一个ubuntu服务器网络。
编辑我的ifconfig:
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Loopback Local)
RX packets 352 bytes 26160 (26.1KB)
RX erors 0 dropped 0 overruns 0 frame 0
TX packets 352 bytes 26160 (26.1KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0我编辑了/etc/network/interfaces文件,如下所示:
auto lo
auto eth0
iface eth0 inet static
address 192.168.15.141
netmask 255.255.255.0
gateway 192.168.15.1我试图重新启动服务器,并使用:
sudo ifdown --exclude=lo -a && sudo ifup --exclude=lo -a此命令是来自以下链接的答案:如何重新启动网络服务?
我得到了以下错误:
Cannot find device "eth0"
Failed to bring up eth0.我很擅长配置服务器,所以我不知道发生了什么。
有人能帮帮我吗?
发布于 2017-09-05 19:41:06
我建议您修改您的/etc/network/interfaces文件如下:
auto lo
iface lo inet loopback
auto ens160
iface ens160 inet static
address 192.168.15.141
netmask 255.255.255.0
gateway 192.168.15.1
dns-nameservers 192.168.15.1 8.8.8.8重新启动接口:
sudo ifdown ens160 && sudo ifup -v ens160你联系上了吗?
ping -c3 www.ubuntu.comhttps://askubuntu.com/questions/953071
复制相似问题