Ubuntu14.04修改配置,重启网卡没有生效,出现如下问题:
service networking restart //重启网络服务stop: Job failed while stoppingstart: Job is already running: networking tail -f /var/log/upstart/networking.log //查看错误日志Stopping or restarting the networking job is not supported.Use ifdown & ifup to reconfigure desired interface.
从以上日志内容可以看出,传统的service重启和停止网络已经不再支持了,需要通过使用ifdown & ifup来实现相应的操作。
- 重启指定网卡
ifdown eth0 && ifup eth0
- 重启除lo网卡的所有网卡
ifdown --exclude=lo -a && sudo ifup --exclude=lo -a
- 配置桥接
# apt-get install bridge-utils# cat /etc/network/interfacesauto loiface lo inet loopbackauto eth0iface eth0 inet manualauto br0iface br0 inet staticaddress 192.168.0.10netmask 255.255.255.0gateway 192.168.0.1bridge_ports eth0bridge_stp offbridge_fd 0bridge_maxwait 0dns-nameservers 192.168.0.1# ifup br0# brctl showbridge name bridge id STP enabled interfacesbr0 8000.02000a0080e1 no eth0