some trick configuration for v2ray
cloudflare warp install
- install wireguard
sudo apt install wireguard resolvconf
- install wgcf
curl -fsSL git.io/wgcf.sh | sudo bash
- 通过 wgcf 注册 WARP 账户 (将生成 wgcf-account.toml 文件保存账户信息)
wgcf register
- 通过 wgcf 生成 WireGuard 配置文件 (wgcf-profile.conf)
wgcf generate
- 编辑 WireGuard 配置文件
edit wgcf-profile.conf
从wgcf-profile.conf
文件中获取Endpoint
后的域名进行解析
nslookup engage.cloudflareclient.com
主要修改三个位置
- 默认DNS为1.1.1.1,修改为 DNS = 8.8.8.8,1.1.1.1
- 删除 AllowedIPs = 0.0.0.0/0, 只启用IPv6代理
- 将 engage.cloudflareclient.com 替换为上面nslookup解析到的地址
将 wgcf-account.toml 和 wgcf-profile.conf 这两个文件保存好,以备不时之需。
- 启用 WireGuard 网络接口
sudo cp wgcf-profile.conf /etc/wireguard/wgcf.conf
执行 ip a 命令,能看到名为 wgcf 的网络接口
enable systemd to auto-start
## 启用守护进程
sudo systemctl start wg-quick@wgcf
## 设置开机启动
sudo systemctl enable wg-quick@wgcf
router rules customize
remember, one {} mean one specific rule to match
- match domain: I only let myself account use
ipv6_wgcf
when access these domain.
{
"type": "field",
"inboundTag": "selbst",
"outboundTag": "IP6_wgcf",
"domain": [
"chat.openai.com",
"appleid.apple.com",
"www.pngegg.com",
"www.pngwing.com"
]
}
- match CIDR range: let
192.168.1.0/24
directly access internet.
{
"type": "field",
"outboundTag": "IP4_direct",
"ip": [
"192.168.1.0/24"
]
}