起因:今天工作要求配置一台dns server用来做无线端配置host测试(当然,你能买到能配host的无线路由器请略过),然后就用debian7.5搭建起dns server,每次配置重启networking(重启网络的命令services networking restart),网卡总是没法启动然后没办法,人肉移步到机房手动(ifup
eth0)启动网卡,但心里不明白为什么会这样子,以前ubuntu都可以直接重启啊,不甘心,于是services networking restart再来一次,果然还是这样子,不能启动eth0
分析:想办法,首先在机房看了下,是有告警的, 但机房server不带浏览器,不能复制。就先把网卡启动起来。然后回到办公位用如下命令获取log,搜索一下子
service networking restart >>log.txt &&ifup eth0
Running /etc/init.d/networking restart is deprecated because it may not re-enable some interfaces … (warning).
Reconfiguring network interfaces…Reloading /etc/samba/smb.conf: smbd only.
done.
google之第一篇就得到答案
http://am-blog.no-ip.org/BlogEngine/post/2013/12/26/Networking-restart-is-deprecated-because-it-may-not-enable-again-some-interfaces.aspx
The reason is that / etc / init.d / networking uses the program “ifup-a”. This starts only network interfaces that are marked with “auto”.
意思是说之前重启网络的命令相当于用ifup-a,而这个命令呢只默认启动interfaces里面带auto字段的网络设备。那么解决方法就有了,把eth0字段加上如下
再来一次,搞定。