The loss of linux-centos7 network card ens33 leads to network problems

Problem: There is a problem with centos7 booting and it cannot connect to the network. It was normal before.

Executing ifconfig shows that there is no ens33 network card, but the same other virtual machines are in a normal state:

[root@hadoop108 ~]# 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 11496 bytes 900336 (879.2 KiB)
        RX errors 0 dropped 0 overruns 0 frame 0
        TX packets 11496 bytes 900336 (879.2 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:71:26:9e 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

view ip link

[root@hadoop108 ~]# ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: ens33: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 00:0c:29:f2:ae:65 brd ff:ff:ff:ff:ff:ff
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default qlen 1000
    link/ether 52:54:00:71:26:9e brd ff:ff:ff:ff:ff:ff
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN mode DEFAULT group default qlen 1000
    link/ether 52:54:00:71:26:9e brd ff:ff:ff:ff:ff:ff

It shows that the ens33 network card is in the DOWN state,

View network status:

[root@hadoop108 ~]# 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 Wednesday 2023-05-24 09:16:00 CST; 31s ago
Docs: man:systemd-sysv-generator(8)
Process: 9720 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE)

May 24 09:16:00 hadoop108 network[9720]: RTNETLINK answers: File exists
May 24 09:16:00 hadoop108 network[9720]: RTNETLINK answers: File exists
May 24 09:16:00 hadoop108 network[9720]: RTNETLINK answers: File exists
May 24 09:16:00 hadoop108 network[9720]: RTNETLINK answers: File exists
May 24 09:16:00 hadoop108 network[9720]: RTNETLINK answers: File exists
May 24 09:16:00 hadoop108 network[9720]: RTNETLINK answers: File exists
May 24 09:16:00 hadoop108 systemd[1]: network.service: control process exited, code=exited status=1
May 24 09:16:00 hadoop108 systemd[1]: Failed to start LSB: Bring up/down networking.
May 24 09:16:00 hadoop108 systemd[1]: Unit network.service entered failed state.
May 24 09:16:00 hadoop108 systemd[1]: network.service failed.

restart network card

[root@hadoop108 ~]# systemctl restart network
Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details.
[root@hadoop108 ~]# journalctl -xe
May 24 09:41:01 hadoop108 NetworkManager[685]: <info> [1684892461.3726] audit: op="con
May 24 09:41:01 hadoop108 network[5872]: Opening interface ens33: Error: Connection activation failed: No su
May 24 09:41:01 hadoop108 network[5872]: [Failed]
May 24 09:41:01 hadoop108 network[5872]: RTNETLINK answers: File exists
May 24 09:41:01 hadoop108 network[5872]: RTNETLINK answers: File exists
May 24 09:41:01 hadoop108 network[5872]: RTNETLINK answers: File exists
May 24 09:41:01 hadoop108 network[5872]: RTNETLINK answers: File exists
May 24 09:41:01 hadoop108 network[5872]: RTNETLINK answers: File exists
May 24 09:41:01 hadoop108 network[5872]: RTNETLINK answers: File exists
May 24 09:41:01 hadoop108 network[5872]: RTNETLINK answers: File exists
May 24 09:41:01 hadoop108 network[5872]: RTNETLINK answers: File exists
May 24 09:41:01 hadoop108 network[5872]: RTNETLINK answers: File exists
May 24 09:41:01 hadoop108 systemd[1]: network.service: control process exited, code=exi
May 24 09:41:01 hadoop108 systemd[1]: Failed to start LSB: Bring up/down networking.
--Subject: Unit network.service has failed
--Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit network.service has failed.
--
-- The result is failed.
May 24 09:41:01 hadoop108 systemd[1]: Unit network.service entered failed state.
May 24 09:41:01 hadoop108 systemd[1]: network.service failed.
May 24 09:41:01 hadoop108 polkitd[616]: Unregistered Authentication Agent for unix-proc

View logs:

May 24 09:41:01 hadoop108 NetworkManager[685]: <info> [1684892461.3726] audit: op="connection-activate" uuid="b90d3d59-d742-45b5-ba56-f5b47644b948" name ="ens33" result="fail" reason="No suitable device found fo
May 24 09:41:01 hadoop108 network[5872]: Opening interface ens33: Error: Connection activation failed: No suitable device found for this connection (device lo not available because device is strictly unmanaged).
May 24 09:41:01 hadoop108 network[5872]: [Failed]
May 24 09:41:01 hadoop108 network[5872]: RTNETLINK answers: File exists
May 24 09:41:01 hadoop108 network[5872]: RTNETLINK answers: File exists
May 24 09:41:01 hadoop108 network[5872]: RTNETLINK answers: File exists
May 24 09:41:01 hadoop108 network[5872]: RTNETLINK answers: File exists
May 24 09:41:01 hadoop108 network[5872]: RTNETLINK answers: File exists
May 24 09:41:01 hadoop108 network[5872]: RTNETLINK answers: File exists
May 24 09:41:01 hadoop108 network[5872]: RTNETLINK answers: File exists
May 24 09:41:01 hadoop108 network[5872]: RTNETLINK answers: File exists
May 24 09:41:01 hadoop108 network[5872]: RTNETLINK answers: File exists
May 24 09:41:01 hadoop108 systemd[1]: network.service: control process exited, code=exited status=1
May 24 09:41:01 hadoop108 systemd[1]: Failed to start LSB: Bring up/down networking.
--Subject: Unit network.service has failed
--Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
--
-- Unit network.service has failed.
--
-- The result is failed.
May 24 09:41:01 hadoop108 systemd[1]: Unit network.service entered failed state.
May 24 09:41:01 hadoop108 systemd[1]: network.service failed.
May 24 09:41:01 Hadoop108 POLKITD [616]: Unregisterly Authentication Agent For Unix-Process: 5866: 54555 (SYSTEM Bus Name: 1.120, Object Path /Org /Freed ESKTOP/POLICYKIT1/AuthenticationAgent, local zh_cn.utf-8) (di
~
~

Attempt to start the ens33 network interface fails:

[root@hadoop108 ~]# ifup ens33
Error: Connection activation failed: No suitable device found for this connection (device lo not available because device is strictly unmanaged).

Summary of the problem: Other centos7s under the vm virtual machine are normal, and the network abnormality of a single centos7 is not caused by VMware net related services in windows, but caused by a problem with a single centos7. To ensure that the configuration file (/etc/sysconfig/network-scripts/ifcfg-ens33) is normal, you can try the following methods:

  1. Remove the NetworkManager service from the system startup run level to prevent it from running automatically at system startup, manually configure network connections
    [root@hadoop108 ~]# chkconfig NetworkManager off
    NOTE: Requests are being forwarded to "systemctl disable NetworkManager.service".
    Removed symlink /etc/systemd/system/multi-user.target.wants/NetworkManager.service.
    Removed symlink /etc/systemd/system/dbus-org.freedesktop.nm-dispatcher.service.
    Removed symlink /etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service.
    
  2. Make the network service run automatically when the system starts
    [root@hadoop108 ~]# chkconfig network on
  3. Stop the running NetworkManager service
    [root@hadoop108 ~]# service NetworkManager stop
    Redirecting to /bin/systemctl stop NetworkManager.service
    
  4. Start network service
    [root@hadoop108 ~]# service network start
    Starting network (via systemctl): [OK]
  5. Test network connection is normal
    [root@hadoop108 ~]# ifconfig | grep ens33
    ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
    [root@hadoop108 ~]# ping www.baidu.com -c 3
    PING www.a.shifen.com (110.242.68.3) 56(84) bytes of data.
    64 bytes from 110.242.68.3 (110.242.68.3): icmp_seq=1 ttl=128 time=53.6 ms
    64 bytes from 110.242.68.3 (110.242.68.3): icmp_seq=2 ttl=128 time=53.6 ms
    64 bytes from 110.242.68.3 (110.242.68.3): icmp_seq=3 ttl=128 time=53.2 ms
    
    --- www.a.shifen.com ping statistics ---
    3 packets transmitted, 3 received, 0% packet loss, time 3124ms
    rtt min/avg/max/mdev = 53.200/53.494/53.675/0.282 ms