Dns /etc/网络/接口:4:带有空值的选项

Dns /etc/网络/接口:4:带有空值的选项,dns,ubuntu-16.04,ims,Dns,Ubuntu 16.04,Ims,我正在尝试安装并遵循的步骤,在尝试重新启动网络时出现以下错误 root@ubuntu16:~/.test/OpenIMSCore# /etc/init.d/networking restart [....] Restarting networking (via systemctl): networking.serviceJob for networking.service failed because the control process exited with error code. See

我正在尝试安装并遵循的步骤,在尝试重新启动网络时出现以下错误

root@ubuntu16:~/.test/OpenIMSCore# /etc/init.d/networking restart
[....] Restarting networking (via systemctl): networking.serviceJob for networking.service failed because the control process exited with error code. See "systemctl status networking.service" and "journalctl -xe" for details.
 failed!

root@ubuntu16:~/.test/OpenIMSCore# systemctl status networking.service
● networking.service - Raise network interfaces
   Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
  Drop-In: /run/systemd/generator/networking.service.d
           └─50-insserv.conf-$network.conf
   Active: failed (Result: exit-code) since Sat 2018-08-04 01:17:51 IST; 19s ago
     Docs: man:interfaces(5)
  Process: 27064 ExecStop=/sbin/ifdown -a --read-environment --exclude=lo (code=exited, status=1/FAILURE)
  Process: 27167 ExecStart=/sbin/ifup -a --read-environment (code=exited, status=1/FAILURE)
  Process: 27164 ExecStartPre=/bin/sh -c [ "$CONFIGURE_INTERFACES" != "no" ] && [ -n "$(ifquery --read-environment --list --exclude=lo)" ] && udevadm settle (code=ex
 Main PID: 27167 (code=exited, status=1/FAILURE)

Aug 04 01:17:51 ubuntu16 systemd[1]: Starting Raise network interfaces...
Aug 04 01:17:51 ubuntu16 sh[27164]: /etc/network/interfaces:4: option with empty value
Aug 04 01:17:51 ubuntu16 sh[27164]: ifquery: couldn't read interfaces file "/etc/network/interfaces"
Aug 04 01:17:51 ubuntu16 ifup[27167]: /etc/network/interfaces:4: option with empty value
Aug 04 01:17:51 ubuntu16 ifup[27167]: /sbin/ifup: couldn't read interfaces file "/etc/network/interfaces"
Aug 04 01:17:51 ubuntu16 systemd[1]: networking.service: Main process exited, code=exited, status=1/FAILURE
Aug 04 01:17:51 ubuntu16 systemd[1]: Failed to start Raise network interfaces.
Aug 04 01:17:51 ubuntu16 systemd[1]: networking.service: Unit entered failed state.
Aug 04 01:17:51 ubuntu16 systemd[1]: networking.service: Failed with result 'exit-code'.
调试后,我发现问题出在/etc/network/interfaces文件上,当添加以下参数(从设备、HWADDR到PEERDNS)并启动网络时,我得到了上述错误

是否有人在修改接口文件时遇到相同的问题(my/etc/hosts文件和/etc/resolv.conf文件类似于上面链接中提供的文件)

关于这一点的任何参考资料也会有很大帮助


提前谢谢。

你可能会自责,但你的两行字都是一样的。它应该是iface eth0 inet dhcp而不是dchp


如果无法解析文件,ifup和ifdown将崩溃。

在您得到错误的那一刻,真实地显示您的
/etc/network/interfaces
,因为第4行显然有错误。@PatrickMevzek我已在ifconfig中检查了hAddress,并在我的接口文件中添加了相同的地址。。在删除该文件后,还重新启动了网络评论..但我仍然面临同样的错误。。