/etc/network/interfaces:4: option with empty value

2.6k Views Asked by At

I am trying to install OpenIMSCore and following the steps from this link and I am getting the below error when trying to restart the network,

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'.

After debugging I found that the issue was with the /etc/network/interfaces file, when added the below params (from DEVICE, HWADDR to PEERDNS) and start the network I am getting the above error.

enter image description here

Did anyone face the same issues while modifying the interfaces file (my /etc/hosts file & /etc/resolv.conf file are similar to the once provided in the above link).

Any reference on this would also be of great help !

Thanks in advance.

1

There are 1 best solutions below

0
On

You'll probably kick yourself, but you've got the same typo on two lines. It should be iface eth0 inet dhcp not dchp.

ifup and ifdown will break if they can't parse the file.