【亿码酷站-编程开发教程】收集全网优质教程及源码资源!
全网优质软件开发、平面设计等教程及精品源码资源一站可得,www.ymkuzhan.com!
问题:
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不能上网,重启网卡报错怎么办
—–文章转载自PHP中文网如有侵权请联系admin#tyuanma.cn删除
建立一个完美的Python项目
转载请注明来源:centos7不能上网,重启网卡报错怎么办_亿码酷站_亿码酷站
本文永久链接地址:https://www.ymkuzhan.com/1388.html
本文永久链接地址:https://www.ymkuzhan.com/1388.html
下载声明:
本站资源如无特殊说明默认解压密码为www.ymkuzhan.com建议使用WinRAR解压; 本站资源来源于用户分享、互换、购买以及网络收集等渠道,本站不提供任何技术服务及有偿服务,资源仅提供给大家学习研究请勿作它用。 赞助本站仅为维持服务器日常运行并非购买程序及源码费用因此不提供任何技术支持,如果你喜欢该程序,请购买正版! 版权声明:
下载本站资源学习研究的默认同意本站【版权声明】若本站提供的资源侵犯到你的权益,请提交版权证明文件至邮箱ymkuzhan#126.com(将#替换为@)站长将会在三个工作日内为您删除。 免责声明:
您好,本站所有资源(包括但不限于:源码、素材、工具、字体、图像、模板等)均为用户分享、互换、购买以及网络收集而来,并未取得原始权利人授权,因此禁止一切商用行为,仅可用于个人研究学习使用。请务必于下载后24小时内彻底删除,一切因下载人使用所引起的法律相关责任,包括但不限于:侵权,索赔,法律责任,刑事责任等相关责任,全部由下载人/使用人,全部承担。以上说明,一经发布视为您已全部阅读,理解、同意以上内容,如对以上内容持有异议,请勿下载,谢谢配合!支持正版,人人有责,如不慎对您的合法权益构成侵犯,请联系我们对相应内容进行删除,谢谢!