解决校园网流量不足,使用反向代理使实验室服务器互联网访问走客户端互联网出口

JinLonghua    2020-07-06 15:32

本文要解决的问题:
校园网流量不足,而客户端互联网出口无法供服务器使用。
难点:
使用VPN连接服务器后,服务器无法直接访问客户端网络。具体表现为ping VPN分配的客户端IP无法ping通。TCP等连接也无法建立。
解决方式:
使用FRP反向代理工具,进行内网穿透。
网络构架图:

配置:
  1. 在客户端建立一个SOCKS5代理或HTTP代理。
  2. 参照连接中配置(https://github.com/fatedier/frp#access-your-computer-in-lan-by-ssh)分别在客户端以及服务器段修改配置文件中端口(文中的两个端口有可能已经被占用),将本地客户端的local port改为建立的代理的端口
  3. 分别按照上述链接中指南分别在服务器和客户端运行frp
  4. 将需要联网的应用配置代理
    1. conda:https://enterprise-docs.anaconda.com/en/latest/admin/chan-pkg/proxy.html
    2. git:https://stackoverflow.com/questions/15227130/using-a-socks-proxy-with-git-for-the-http-transport
    3. pip:https://stackoverflow.com/a/53894701
  5. 联网使用
  6. 大成功!
Last Modified: 2020-07-06 15:32
Views: 3.4K

[[total]] comments

Post your comment
  1. [[item.time]]
    [[item.user.username]] [[item.floor]]Floor
  2. Click to load more...
  3. Post your comment