百分百源码网-让建站变得如此简单! 登录 注册 签到领金币!

主页 | 如何升级VIP | TAG标签

当前位置: 主页>网站教程>服务器> centos7不克不及上网,重新启动网卡报错怎么办
分享文章到:

centos7不克不及上网,重新启动网卡报错怎么办

发布时间:09/01 来源:未知 浏览: 关键词:

问题:

VMWare虚拟机安置了CentOS7 ,忽然发明连接不上,进入系统使用ifconfig命令查看网络设备,发明无外网网卡。

(引荐教程:centos教程)

如下:

[root@localhost ~]# ifconfig
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 12  bytes 1068 (1.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 12  bytes 1068 (1.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:f6:af:41  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

重新启动网卡试试看。结果报错了!报错信息如下:

[root@localhost ~]# systemctl status network
● 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 Mon 2020-09-28 09:59:00 CST; 9s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 13344 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)

Sep 28 09:59:00 localhost.localdomain network[13344]: RTNETLINK answers: File...
Sep 28 09:59:00 localhost.localdomain network[13344]: RTNETLINK answers: File...
Sep 28 09:59:00 localhost.localdomain network[13344]: RTNETLINK answers: File...
Sep 28 09:59:00 localhost.localdomain network[13344]: RTNETLINK answers: File...
Sep 28 09:59:00 localhost.localdomain network[13344]: RTNETLINK answers: File...
Sep 28 09:59:00 localhost.localdomain network[13344]: RTNETLINK answers: File...
Sep 28 09:59:00 localhost.localdomain systemd[1]: network.service: control pr...
Sep 28 09:59:00 localhost.localdomain systemd[1]: Failed to start LSB: Bring ...
Sep 28 09:59:00 localhost.localdomain systemd[1]: Unit network.service entere...
Sep 28 09:59:00 localhost.localdomain systemd[1]: network.service failed.
Hint: Some lines were ellipsized, use -l to show in full.

显现此现象的缘由一样是系统的 NetworkManager 治理套件显现了问题

Sep 28 09:59:00 localhost.localdomain systemd[1]: Failed to start LSB: Bring ...

所以我们要休止这个套件的效劳

[root@localhost ~]# systemctl stop NetworkManager

然后重新启动网卡试试

[root@localhost ~]# systemctl restart network.service

没有报错,是不是可以了呢?我们查看网络设备

[root@localhost ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.100.15  netmask 255.255.255.0  broadcast 192.168.100.255
        inet6 fe80::20c:29ff:fe35:e8d7  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:35:e8:d7  txqueuelen 1000  (Ethernet)
        RX packets 9  bytes 626 (626.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 32  bytes 4309 (4.2 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 12  bytes 1068 (1.0 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 12  bytes 1068 (1.0 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:f6:af:41  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

显现外网网卡了,为了防止重新启动后 NetworkManager 再次开启,我们这是不让它开机启动

systemctl disable NetworkManager

完成!

以上就是centos7不克不及上网,重新启动网卡报错如何办的具体内容,更多请关注百分百源码网其它相关文章!

打赏

打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

百分百源码网 建议打赏1~10元,土豪随意,感谢您的阅读!

共有150人阅读,期待你的评论!发表评论
昵称: 网址: 验证码: 点击我更换图片
最新评论

本文标签

广告赞助

能出一分力是一分吧!

订阅获得更多模板

本文标签

广告赞助

订阅获得更多模板