V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
spike060
V2EX  ›  互联网

请教下 window 下多网段通信问题

  •  
  •   spike060 · 2022-10-18 15:20:59 +08:00 · 674 次点击
    这是一个创建于 548 天前的主题,其中的信息可能已经有所发展或是发生改变。
    • 设备情况

    一台 window PC 需要访问两个网段 192.168.110.x 和 192.168.1.x ;
    一台 linux 服务器可以访问两个网段 192.168.110.x 和 192.168.1.x ;
    一台设备 IP 地址 192.168.1.x ;

    window PC 和 linux 服务器在 192.168.110.x 网段。
    window PC 可以 ping 通 linux 服务器。
    linux 服务器可以 ping 通 192.168.1.x 设备。

    目前的情况是 PC 没法 ping 通 192.168.1.x 设备。
    但是 PC 同样的配置有几次是可以 Ping 通的。

    • PC ip 配置

    • 使用 PC 追踪路由
    PS C:\Users\cc> Tracert 192.168.1.10
    
    通过最多 30 个跃点跟踪到 192.168.1.10 的路由
    
      1     1 ms     1 ms     1 ms  192.168.110.1
      2     2 ms     2 ms     1 ms  192.168.7.1
      3     4 ms     4 ms     9 ms  175.8.28.1
      4     *        4 ms     5 ms  61.187.9.113
      5     *        *        *     请求超时。
      6     *        *        *     请求超时。
    
    • 使用服务器追踪路由
    xx@xx:~/works $ traceroute  192.168.1.10
    traceroute to 192.168.1.10 (192.168.1.10), 30 hops max, 60 byte packets
     1  192.168.1.10 (192.168.1.10)  0.796 ms  0.385 ms  0.468 ms
    
    2 条回复    2022-10-18 19:52:33 +08:00
    oldshensheep
        1
    oldshensheep  
       2022-10-18 16:36:12 +08:00   ❤️ 1
    两种方案,
    1 ,在 192.168.110.x 网段的网关上 加上 去 192.168.1.x 的路由

    2 ,在 PC 上 加上 去 192.168.1.x 的路由
    route -p ADD 192.168.1.0 MASK 255.255.255.0 [网关 ip] metric 1
    spike060
        2
    spike060  
    OP
       2022-10-18 19:52:33 +08:00
    @oldshensheep 第二个方案应该可以。不过我没挣扎了,在服务器上开了个代理,转一趟能访问了。。。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5691 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 02:24 · PVG 10:24 · LAX 19:24 · JFK 22:24
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.