centos7不能上网,重启网卡报错怎么办
生活随笔
收集整理的這篇文章主要介紹了
centos7不能上网,重启网卡报错怎么办
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
問題:
VMWare虛擬機(jī)安裝了CentOS7 ,突然發(fā)現(xiàn)連接不上,進(jìn)入系統(tǒng)使用ifconfig命令查看網(wǎng)絡(luò)設(shè)備,發(fā)現(xiàn)無外網(wǎng)網(wǎng)卡。
(推薦教程: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
重啟網(wǎng)卡試試看。結(jié)果報(bào)錯(cuò)了!報(bào)錯(cuò)信息如下:
[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.
出現(xiàn)此現(xiàn)象的原因一般是系統(tǒng)的 NetworkManager 管理套件出現(xiàn)了問題
Sep 28 09:59:00 localhost.localdomain systemd[1]: Failed to start LSB: Bring ...
所以我們要停止這個(gè)套件的服務(wù)
[root@localhost ~]# systemctl stop NetworkManager
然后重啟網(wǎng)卡試試
[root@localhost ~]# systemctl restart network.service
沒有報(bào)錯(cuò),是不是可以了呢?我們查看網(wǎng)絡(luò)設(shè)備
[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
出現(xiàn)外網(wǎng)網(wǎng)卡了,為了防止重啟后 NetworkManager 再次開啟,我們這是不讓它開機(jī)啟動(dòng)
systemctl disable NetworkManager
完成!
總結(jié)
以上是生活随笔為你收集整理的centos7不能上网,重启网卡报错怎么办的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 大数据架构如何挑选机器.
- 下一篇: 不得不知的黑帽SEO,你了解多少