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

Mac 连接两个 VPN 出现了奇怪的问题

  •  
  •   Aurora0 · 2022-11-07 20:42:09 +08:00 · 2157 次点击
    这是一个创建于 527 天前的主题,其中的信息可能已经有所发展或是发生改变。

    Mac 为 m1 芯片,系统是 macOS 13 ,由于疫情原因,需要远程办公,连接公司的 SSL VPN ,

    而且软件只有 macOS 和 Windows 版本 目前开启 surge 并且打开增强模式,然后连接公司 VPN ,外网谷歌之类的可以访问,凡是走直连的都不能访问了; 但是吧,我在 Windows 上开启 clash 和公司 VPN ,可以正常使用公司内网,和国内外互联网的。

    现在有什么办法可以让我在 Mac 上既能访问公司内网,又能访问国内外互联网吗

    第 1 条附言  ·  2022-11-08 22:26:28 +08:00

    附:目前找到的解决方法 第一种:使用sock5代理模式

    • 先开启代理软件,以surge为例,sock5默认监听 6153端口,打开微信代理:command+p
    • 然后填入服务器地址 127.0.0.1,端口 6153
    • 缺点:不能使用git服务,git服务使用sock5代理失败,会提示curl: (97) Could not resolve host错误

    第二种是我参考Windows上的bat脚本,写的适用于Mac的命令,但是会造成网络异常,有相关经验的欢迎指导

    sudo route -v delete -net 128.0.0.0 -gateway 192.168.10.1
    sudo route -v delete -net 0.0.0.0 -gateway 192.168.10.1
    

    上面的命令可以成功运行,但是不能生效

    19 条回复    2022-11-09 13:07:42 +08:00
    xtinput
        1
    xtinput  
       2022-11-07 20:47:40 +08:00
    不使用增强模式
    xtinput
        2
    xtinput  
       2022-11-07 20:47:56 +08:00
    忽略内网的 ip
    Aurora0
        3
    Aurora0  
    OP
       2022-11-07 21:12:09 +08:00
    @xtinput 关闭增强模式以后 telegram 都上不去了
    Aurora0
        4
    Aurora0  
    OP
       2022-11-07 21:13:40 +08:00
    @xtinput 这个是要忽略所有内网 IP 吗,放在 skip-proxy 里面?
    xtinput
        5
    xtinput  
       2022-11-07 22:07:32 +08:00
    @Aurora0 在 telegram 的代理里面添加一个 socks5 呀
    xtinput
        6
    xtinput  
       2022-11-07 22:10:15 +08:00
    @Aurora0 网络设置里面有个忽略这些主机与域的代理设置,surge 里面不清楚在哪配置,我用 ClashXPro ,有个独立的配置文件进行添加
    Aurora0
        7
    Aurora0  
    OP
       2022-11-07 22:26:40 +08:00
    @xtinput 谢谢,我看一下
    zhangzEric
        8
    zhangzEric  
       2022-11-07 22:49:03 +08:00 via iPhone
    @Aurora0 mac 的 telegram 设置一个代理,连接 mac 的端口号,就可以了~
    Aurora0
        9
    Aurora0  
    OP
       2022-11-08 00:15:28 +08:00
    @zhangzEric 感谢,telegram 已经成功了
    Aurora0
        10
    Aurora0  
    OP
       2022-11-08 00:18:46 +08:00
    @xtinput 好像不太一样,我这个内网会代理所有网络;忽略也没有用。
    现在我下载了 iOS 版本的 VPN ,让我的浏览器可以访问内外网了,app 内还是不可以
    idea ,微信,qq 都不行
    HongTang
        11
    HongTang  
       2022-11-08 10:05:43 +08:00
    关闭增强模式,需要走代理的软件设置手动代理到 surge 对应的端口。
    Aurora0
        12
    Aurora0  
    OP
       2022-11-08 12:02:56 +08:00
    @HongTang git 好像不能走代理啊,有没有支持代理的 git 客户端推荐一下
    Aurora0
        13
    Aurora0  
    OP
       2022-11-08 12:03:40 +08:00
    @HongTang 我想让 git 走 sock 的代理,不然什么都弄不了了
    Lqxc
        14
    Lqxc  
       2022-11-08 12:04:56 +08:00 via Android
    @Aurora0 git 可以设置 Proxy
    Aurora0
        15
    Aurora0  
    OP
       2022-11-08 12:14:49 +08:00
    @Lqxc 设置过,失败了,有相关教程的链接推我一下吧
    我按照小火煎的 github 的 issue 设置的
    alias proxy='export all_proxy=socks5://127.0.0.1:6153'
    alias unproxy='unset all_proxy'

    开启公司 VPN 以后就这样了
    curl cip.cc
    curl: (97) Could not resolve host: cip.cc
    Lqxc
        16
    Lqxc  
       2022-11-08 12:37:02 +08:00 via Android
    Aurora0
        17
    Aurora0  
    OP
       2022-11-08 15:24:25 +08:00
    @Lqxc Could not resolve host: gitlab.com
    和我上面的方法一样的问题
    Lqxc
        18
    Lqxc  
       2022-11-09 12:24:22 +08:00 via Android   ❤️ 1
    @Aurora0 把协议栈都去掉看看?或者设置一下 http_ proxy 和 https_proxy 为 localhost:port?
    Aurora0
        19
    Aurora0  
    OP
       2022-11-09 13:07:42 +08:00
    @Lqxc 已经弄好了,谢谢
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5664 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 22ms · UTC 03:28 · PVG 11:28 · LAX 20:28 · JFK 23:28
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.