/etc/init.d/networking restart报错

发布时间:2016-03-18 15:47:07 阅读:1419次

转:http://blog.sina.com.cn/s/blog_71459fbc0101ov3b.html

现象:Debian7使用service networking restart或者/etc/init.d/networking restart 提示etc/init.d/networking restart is deprecated错误,并且eth0与eth1均无法启动。
配置信息:interfaces文件
auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet dhcp
allow-hotplug eth1
iface eth1 inet static
address 192.168.56.223
netmask 255.255.255.0

经过查询,为allow-hotplug这个参数导致,修改成auto即可
auto eth0
auto eth1

问题解决
附上网上搜到的auto和allow-hotplug的区别
原文地址:http://openwares.net/linux/interfaces_auto_allow-hotplug.html

auto

语法:
auto
含义:
在系统启动的时候启动网络接口,无论网络接口有无连接(插入网线),如果该接口配置了DHCP,则无论有无网线,系统都会去执行DHCP,如果没有插入网线,则等该接口超时后才会继续。

allow-hotplug

语法:
allow-hotplug

含义:
只有当内核从该接口检测到热插拔事件后才启动该接口。如果系统开机时该接口没有插入网线,则系统不会启动该接口,系统启动后,如果插入网线,系统会自动启动该接口。也就是将网络接口设置为热插拔模式。

如有问题,可以QQ搜索群1028468525加入群聊,欢迎一起研究技术

支付宝 微信

有疑问联系站长,请联系QQ:QQ咨询

转载请注明:/etc/init.d/networking restart报错 出自老鄢博客 | 欢迎分享