V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
delikely
V2EX  ›  VMware

ssh 后 NAT 方式连接的虚拟机 无法访问外网

  •  
  •   delikely · May 8, 2017 · 2956 views
    This topic created in 3285 days ago, the information mentioned may be changed or developed.

    在没有连接 ssh 之前,能够上网

    root@ubuntu:~# ping 114.114.114.114
    PING 114.114.114.114 (114.114.114.114) 56(84) bytes of data.
    64 bytes from 114.114.114.114: icmp_seq=1 ttl=128 time=10.2 ms
    64 bytes from 114.114.114.114: icmp_seq=2 ttl=128 time=12.0 ms
    64 bytes from 114.114.114.114: icmp_seq=3 ttl=128 time=9.04 ms
    

    当我用 Xshell 连接上虚拟机之后,外网不能访问了

    root@ubuntu:~# ping 114.114.114.114
    PING 114.114.114.114 (114.114.114.114) 56(84) bytes of data.
    

    就这样一直不动

    这是为什么呢?可以确定不是 VM 的原因,难道是 NAT 本身的限制(猜想)。

    求大神解释!

    Supplement 1  ·  Oct 2, 2017
    发现了问题所在了,NAT 的 IP 设置成 C 类就可以了,之前用的 B 类。
    1 replies    2017-05-08 13:40:32 +08:00
    trepwq
        1
    trepwq  
       May 8, 2017 via iPhone
    ssh 打洞代理了所有浏览?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2460 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 36ms · UTC 00:01 · PVG 08:01 · LAX 17:01 · JFK 20:01
    ♥ Do have faith in what you're doing.