Cloudflare 官方客户端 · 透明代理 · Google 流量自动走 WARP · 无需手动配置
bash <(curl -fsSL https://vpszdm.com/warp-google.sh)
curl -fsSL https://vpszdm.com/warp-google.sh -o warp-google.sh && chmod +x warp-google.sh && bash warp-google.sh
wget -qO warp-google.sh https://vpszdm.com/warp-google.sh && chmod +x warp-google.sh && bash warp-google.sh
| 组件 | 作用 | 说明 |
|---|---|---|
| cloudflare-warp | WARP 客户端 | 在本机 40000 端口建立 SOCKS5 代理,出口 IP 为 Cloudflare WARP 分配的中国 IP |
| redsocks | 透明代理转发 | 监听本机 12345 端口,将收到的 TCP 流量转发至 WARP SOCKS5 |
| iptables NAT | 流量劫持规则 | 将目标地址属于 Google IP 段的 TCP 流量 REDIRECT 到 redsocks 的 12345 端口 |
| IPv6 黑洞路由 | 防 IPv6 泄漏 | 添加 2607:f8b0::/32 黑洞路由,阻止 Google IPv6 直连导致定位偏移 |
| gai.conf | 优先 IPv4 | 设置系统 DNS 解析优先返回 IPv4 地址,配合 IPv6 黑洞路由生效 |
| warp-google.service | 开机自启 | systemd 服务,网络启动后自动拉起 redsocks 和 iptables 规则 |
warp {status|start|stop|restart|test|ip|uninstall}
warp-cli status
Status update: Connectedcurl -x socks5://127.0.0.1:40000 -s ip.sb && curl -s http://ip-api.com/json/$(curl -x socks5://127.0.0.1:40000 -s ip.sb)?lang=zh-CN | grep country
非Chinacurl -s -o /dev/null -w "%{http_code}" https://www.google.com
200 表示透明代理已生效,Google 流量正常走 WARPiptables -t nat -L WARP_GOOGLE -n | head -10
REDIRECT 规则输出,说明 Google IP 劫持规则已就绪cloudflare-warp 软件包。如需保留 WARP 客户端本身,
请手动执行下方步骤而非一键卸载。
warp uninstall
warp stop
iptables -t nat -D OUTPUT -j WARP_GOOGLE; iptables -t nat -F WARP_GOOGLE; iptables -t nat -X WARP_GOOGLE