CentOS7.2虚拟机⽹卡⽆法启动
在开机之后,发现⽹卡没有启动起来,进⾏了如下操作
1、ifup ens33
Bringing up interface ens33: Error: Connection activation failed: No suitable device found for this connection.
2、接着想重启⽹络服务
[root@client01 network-scripts]# systemctl start network
Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.
3、根据提⽰查看报错
[root@client01 network-scripts]# systemctl status network.service
● network.service - LSB: Bring up/down networking
Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled)
Active: failed (Result: exit-code) since Thu 2017-11-02 21:21:15 CST; 4s ago
Docs: man:systemd-sysv-generator(8)
Process: 4550 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)
Nov 02 21:21:15 client01 network[4550]: RTNETLINK answers: File exists
Nov 02 21:21:15 client01 network[4550]: RTNETLINK answers: File exists
Nov 02 21:21:15 client01 network[4550]: RTNETLINK answers: File exists
Nov 02 21:21:15 client01 network[4550]: RTNETLINK answers: File exists
Nov 02 21:21:15 client01 network[4550]: RTNETLINK answers: File exists
Nov 02 21:21:15 client01 network[4550]: RTNETLINK answers: File exists
Nov 02 21:21:15 client01 systemd[1]: network.service: control process exited, code=exited status=1
Nov 02 21:21:15 client01 systemd[1]: Failed to start LSB: Bring up/down networking.
Nov 02 21:21:15 client01 systemd[1]: Unit network.service entered failed state.
Nov 02 21:21:15 client01 systemd[1]: network.service failed.
4、bing搜索报错信息,⼀般可能有两种解决措施exited
4.1、⽹卡配置⽂件中没有添加MAC地址信息,处理过程如下
4.1.1、查看⽹卡对应MAC地址
[root@client01 network-scripts]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN qlen 1000
link/ether 00:0c:29:9b:e7:51 brd ff:ff:ff:ff:ff:ff
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN qlen 1000
link/ether 52:54:00:a7:c4:9b brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN qlen 1000
link/ether 52:54:00:a7:c4:9b brd ff:ff:ff:ff:ff:ff
4.1.2、将MAC地址添加在配置⽂件中
echo "HWADDR=00:0c:29:9b:e7:51" >> /etc/sysconfig/network-scripts/ifcfg-ens33
4.1.3、重启⽹络服务systemctl start network
在尝试了上述⽅法后,问题依然没有解决,尝试第⼆种⽅案
4.2、停⽌NetworkManager服务
停⽌
[root@client01 network-scripts]# systemctl stop NetworkManager
取消开机启动
[root@client01 network-scripts]# systemctl disable NetworkManager
重启⽹络
[root@client01 network-scripts]# service network restart
Restarting network (via systemctl): [ OK ]
⾄此,问题解决
NetworkManager和network的区别
简单说network适合使⽤于⽹路设定后固定不变的服务器,⽽NetworkManager则适合使⽤于笔记型电脑上必须常常在有线及⽆线⽹路环境切换时使⽤,并且这⼆个服务所读取及写⼊的设定档是不同的。
network :读取的设定档路径为「/etc/sysconfig/network-scripts/*」下的设定档。
NetworkManager :读取的设定档路径为「/etc/sysconfig/networking/*」下的设定档。
CentOS7 在预设情况下会启动NetworkManager 服务(包含开机启动),因为个⼈习惯传统的network设定,因此建议将NetworkManager 服务停⽤后再继续后续设定作业,否则在⼆个服务都启动的情况下将会造成互相⼲扰的⿇烦状况。

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。