在更改网络配置后,我们需要重启网络服务使更改生效。在centos系统中,我们可以通过以下命令重启网络服务:
/etc/init.d/network restart# orservice network restartUbuntu14.04重启网络服务无效:
service networking restartstop: Job failed while stoppingstart: Job is already running: networking # 查看错误日志tail -f /var/log/upstart/networking.logStopping or restarting the networking job is not supported.Use ifdown & ifup to reconfigure desired interface.从日志看出常规网络服务的停止和重启命令已经不再支持了,需要通过使用ifdown & ifup来实现相应的操作。
重启指定网卡
ifdown eth0 && ifup eth0
重启除lo网卡的所有网卡
ifdown –exclude=lo -a && sudo ifup –exclud快3导师群e ifdown & ifup to reconfigure desired interface.
从日志看出常规网络服务的停止和重启命令已经不再支持了,需要通过使用ifdown & ifup来实现相应的操作。
重启指定网卡
ifdown eth0 && ifup eth0
重启除lo网卡的所有网卡
ifdown –exclude=lo -a && sudo ifup –exclude=lo -a