1 2 3 4
| mkdir wgcf cd wgcf wget -O wgcf https://github.com/ViRb3/wgcf/releases/download/v2.2.2/wgcf_2.2.2_linux_amd64 chmod +x wgcf
|
注册用户并生成配置文件:
1 2
| ./wgcf register ./wgcf generate
|
安装wireguard客户端。
centos7可以使用以下命令安装:
1 2 3
| sudo yum install epel-release elrepo-release sudo yum install yum-plugin-elrepo sudo yum install kmod-wireguard wireguard-tools
|
将配置文件中的 engage.cloudflareclient.com 替换为 162.159.192.1,并删除 AllowedIPs = 0.0.0.0/0
1
| sudo cp wgcf-profile.conf /etc/wireguard/wgcf.conf
|
1 2 3 4 5 6 7
| #开启隧道 sudo wg-quick up wgcf #关闭隧道 sudo wg-quick down wgcf # 开机自启 systemctl enable wg-quick@wgcf systemctl start wg-quick@wgcf
|
修改xray的ipv6优先
编辑config.json
替换整个 “outbounds”命令
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| "outbounds": [ { "tag":"IP4_out", "protocol": "freedom", "settings": {} }, { "tag":"IP6_out", "protocol": "freedom", "settings": { "domainStrategy": "UseIPv6" // 指定使用 IPv6 } } ], "routing": { "rules": [ { "type": "field", "outboundTag": "IP6_out", "domain": ["geosite:netflix"] // netflix 走 IPv6 }, { "type": "field", "outboundTag": "IP4_out", "network": "udp,tcp"// 其余走 IPv4 } ] } }
|