5

sing-box联合wireguard,解决Gemini屏蔽VPS IP

IT技术
sing-box联合wireguard,解决Gemini屏蔽VPS IP

碰到机房迁移,新的IP被Gemini给屏蔽掉了。花了整整2天时间,终于解决了。

一早找ChatGPT协助(Gemini被封了),各种方案都不行;

最好临时找了一个机场,想想还是用Gemini死马当活马医吧,最后试了好多个方案终于成功了!!!

值得庆祝一下。也分享一下方案。

个人感觉,每每在这种技术难题面前,Gemini更技胜一筹!就是太讨好人了。。。

“Linux 内核级 WireGuard 隧道 + sing-box 物理接口绑定(bind_interface)”的强强联合路线。

重点技术路线与 SSH 避坑处理如下:

  • 底层网络(避坑核心):由 Linux 内核托管原生 WireGuard 建立 wgwarp 网卡。关键是在配置文件中加入 Table = off 字段,强制关闭全局路由接管,从而保护 VPS 的默认路由表不被破坏,彻底避免了因全局流量被吸入隧道而导致 SSH 22 端口回包断连的“删号级”大坑。
  • 上层分流sing-box 绕过所有版本不兼容的 WireGuard 字段,仅用最基础的 direct 出站协议和 bind_interface: "wgwarp" 参数,将 Gemini 等特定域名的流量精准拨给该网卡,实现了全自动、开机自启的完美分流。

通过 Cloudflare 官方 API 为你申请一个原生的 WireGuard 账号:https://warp-config-generator.vercel.app/

root@lehua:~#lsb_release -a || cat /etc/os-release

No LSB modules are available.

Distributor ID: Ubuntu

Description:    Ubuntu 20.04.6 LTS

Release:        20.04

Codename:       focal

root@lehua:~# sing-box version

sing-box version 1.13.12

Environment: go1.25.9 linux/amd64

Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_utls,with_acme,with_clash_api,with_tailscale,with_ccm,with_ocm,with_naive_outbound,badlinkname,tfogo_checklinkname0,with_purego

Revision: 1086ab2563320e0da0c23b3a491d8dfa0939dff4

CGO: disabled

root@lehua:~#  

Edward

Leave a Reply

Your email address will not be published. Required fields are marked *