ubuntu设置静态IP出错 because the control process exited

操作步骤

step1:sudo vi /etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
#auto enp2s0
#iface enp2s0 inet dhcp

auto enp2s0
iface enp2s0 inet static
address 192.168.8.136
netmask 255.255.255.0
gateway 192.168.8.255

step2: sudo /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.

处理

sudo ip addr flush dev enp2s0 参考资料