我一直在开发一个App要求,要求更改IP方案并重新启动网络服务,以便永久保存更改的IP地址。
每次尝试后,我都会重新启动网络服务并且工作正常,但出于某种原因,它现在正在抛出以下错误。
# /etc/init.d/networking restart
* Running /etc/init.d/networking restart is deprecated because
it may not enable again some interfaces
* Reconfiguring network interfaces... RTNETLINK answers: File exists
Failed to bring up eth0.
也试过
# service networking restart
stop: Unknown instance:
networking stop/waiting
&安培;
# sudo ifdown eth0 && sudo ifup eth0
ifdown: interface eth0 not configured
RTNETLINK answers: File exists
Failed to bring up eth0.
的/ etc /网络/接口
# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
#auto eth0
#iface eth0 inet dhcp
auto eth0
iface eth0 inet static
name Ethernet alias LAN card
address 192.168.0.140
netmask 255.255.252.0
broadcast 192.168.0.245
network 192.168.0.0
gateway 192.168.0.245