zoukankan      html  css  js  c++  java
  • 【Vmware】NAT模式下网络无法连接

    虚拟机无法ping通主机ip,看了网上的一些教程,重置了虚拟网络编辑器,但是还是连不上,虚拟机上查看网络IP如下:

    a@ubuntu:~$ 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  (本地环回)
            RX packets 289  bytes 21301 (21.3 KB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 289  bytes 21301 (21.3 KB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

    那就是没有获取ip,所以从网上看到dhclient -v命令获取ip,使用后结果如下:

    root@ubuntu:~# ifconfig
    ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 192.168.32.128  netmask 255.255.255.0  broadcast 192.168.32.255
            inet6 fe80::20c:29ff:fe4d:81bc  prefixlen 64  scopeid 0x20<link>
            ether 00:0c:29:4d:81:bc  txqueuelen 1000  (以太网)
            RX packets 615  bytes 742729 (742.7 KB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 323  bytes 34986 (34.9 KB)
            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  (本地环回)
            RX packets 2505  bytes 191141 (191.1 KB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 2505  bytes 191141 (191.1 KB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

    dhclient命令的作用是:使用动态主机配置协议动态的配置网络接口的网络参数,也支持BOOTP协议。

    虽然对该命令不是非常了解,但是完美解决了我的问题。

  • 相关阅读:
    如何用js判断一个对象是不是Array
    js实现数组去重怎么实现?
    点击一个ul的五个li元素,分别弹出他们的序号,怎么做?
    盒子模型
    13. 查看网络端口、配置网络
    12. 查看系统硬件配置
    11. 系统状态管理
    9. iptables 配置
    10. 编译软件包
    8. 管理软件包
  • 原文地址:https://www.cnblogs.com/lhdb/p/13910488.html
Copyright © 2011-2022 走看看