sorasyl

老哥们,请教个网络问题。

  •  
  •   sorasyl · Apr 14, 2021 · 4908 views
    This topic created in 2031 days ago, the information mentioned may be changed or developed.
    现有内网机 windows 一台,linux 服务器一台,linux 能访问外网,windows 能 ssh 连接 linux

    如何让 windows 连接外网?

    有个关键字就可以了,谢谢
    24 replies  •  2021-04-15 11:30:32 +08:00
    coderfox
    coderfox
    Apr 14, 2021
    1
    - SSH tunneling: Forward a specific port (localhost:9999 to example.org:80) along with disabling pseudo-[t]ty allocation and executio[n] of remote commands:
    ssh -L 9999:example.org:80 -N -T username@remote_host
    coderfox
    coderfox
    Apr 14, 2021
    2
    不好意思,刚看错了,应该是这个:

    - SSH tunneling: Dynamic port forwarding (SOCKS proxy on localhost:9999):
    ssh -D 9999 -C username@remote_host
    Jirajine
    Jirajine
    Apr 14, 2021 via Android
    3
    Linux 上开启 ip forward 、masqurade,并让防火墙放行转发包。
    然后 Windows 把默认路由指向 Linux,就可以了。
    mgrddsj
    mgrddsj
    Apr 14, 2021 via Android
    4
    最简单的方法:Linux 上开个 Shadowsocks-libev,Windows 上用支持 ss 的客户端连接上就好了
    seers
    seers
    Apr 14, 2021
    5
    关键字 Linux server as gateway
    tankren
    tankren
    Apr 14, 2021
    6
    linux 开转发 windows 把 linux 设成网关 或者 linux 跑 socks 代理
    你先确定这样做会不会被炒鱿鱼
    sorasyl
    sorasyl
    OP
    Apr 14, 2021
    7
    @tankren 啊这,太黑人了吧
    catchexception
    catchexception
    Apr 14, 2021
    8
    frp ?
    sorasyl
    sorasyl
    OP
    Apr 14, 2021
    9
    感谢各位老哥指点
    我试了下 socks5 代理 windows 只能跑下 http,其他的应用需要单独设置代理,用 ipforwad 做转发更好
    duole
    duole
    Apr 14, 2021
    10
    正向代理?
    wangyaominde
    wangyaominde
    Apr 14, 2021
    11
    l2tp
    huangmingyou
    huangmingyou
    Apr 14, 2021
    12
    windows ssh 到 linux 的时候,可以给 windows 做 socks5 代理。
    nekoneko
    nekoneko
    Apr 14, 2021
    13
    代理的话可以用 v2ray
    linux 上用一件脚本安装一下,然后 windows 上用 v2ray 客户端就行

    https://iyideng.me/black-technology/cgfw/vmess-v2ray-server-building-and-using-tutorial.html
    deviluser
    deviluser
    Apr 14, 2021
    14
    windows 运行:
    ssh -ND 1080 user@remote_ip
    开启本地 1080 端口用作 socket5 代理,流量统统以 ssh 协议通过 remote 出
    然后再配置 internet 属性添加局域网代理

    感觉是布置的作业,你应该自己做才对。
    3dwelcome
    3dwelcome
    Apr 14, 2021
    15
    你们怎么都想到设置代理,难道楼主没有 linux 的 root 权限?
    感觉要求就是把 linux 当成一个软路由,普通的 NAT 转发机器。
    no1xsyzy
    no1xsyzy
    Apr 14, 2021
    16
    @3dwelcome 主要是代理想断就断
    今天倒没有出现 “找网管、不要自己绕过限制” 派人士(
    tankren
    tankren
    Apr 14, 2021
    17
    @sorasyl #7 公家的内网机不要乱搞
    sorasyl
    sorasyl
    OP
    Apr 14, 2021
    18
    @3dwelcome 软路由更符合需求,但是服务器没有公网 ip,折腾了半天始终不能转发数据包
    guanyin8cnq12
    guanyin8cnq12
    Apr 14, 2021
    19
    socks5 就完事了阿,或者装 shadowsocks server 和 client
    itechify
    itechify
    Apr 14, 2021 via Android
    20
    Linux iptables 开转发,window 网关设置为 Linux
    brMu
    brMu
    Apr 14, 2021
    21
    iptables masquerade
    ik
    ik
    Apr 15, 2021 via iPhone
    22
    @sorasyl #18 服务器上 ip 是动态的就指定网卡,不指定 ip
    q197
    q197
    Apr 15, 2021
    23
    @mgrddsj 多了一步 其实 ssh 自带转成 socks 的功能
    smileawei
    smileawei
    Apr 15, 2021
    24
    楼上很多都说什么 ss v2ray
    根本没必要。
    如果 Win 和 Linux 在同一个二层网络内。那么 Linux 开 nat 和 ipforwad 。然后 Windows 把网关设置成 Linux 。关键点在开 NAT 。如果只是 forward 。出口的网络管控设备看到的请求还是你的 win 。那么依旧收到策略管控。
    如果 win 和 linux 不在一个二层网络内。可以试试 VPN 或者 socks5 。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   5734 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 85ms · UTC 02:39 · PVG 10:39 · LAX 18:39 · JFK 21:39
    ♥ Do have faith in what you're doing.