如何解决VMware虚拟机ens33网卡丢失的情况?

  • ifconfig后只有lo和virbr0网卡,没有ens33网卡
[root@python ~]# 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 84  bytes 8010 (7.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 84  bytes 8010 (7.8 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:67:a5:e0  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
  • 配置文件/etc/sysconfig/network-scripts/ifcfg-ens33 还在
[root@python ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33 
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=ens33
UUID=8a4ab3d3-1f68-4099-b78d-0ac3348d9029
DEVICE=ens33
ONBOOT=yes
DNS1=114.114.114.114
IPV6_PRIVACY=no
IPADDR=192.168.1.10
PREFIX=24
GATEWAY=192.168.1.254
  • 修改ens33IP配置文件,重启network报错,命令行图形化配置IP报错,重启无效。

解决方案一:

  • Windows下操作:

    • 使用管理员的身份登录命令提示符界面,输入netsh winsock reset (重置网络)
  • Linux下操作:

查看全部接口信息
ifconfig -a 查看所有网卡信息 发现ens33没有静态IP信息
chkconfig network off      
chkconfig network on  
service NetworkManager stop
service NetworkManager start
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐