WARP outbound over WireGuard (Without warp-cli)
Setting Up WireGuard with Wgcf (Without warp-cli
)โ
Overviewโ
This guide explains how to configure WireGuard using Wgcf, without relying on warp-cli
. This method is ideal for VPS, proxy nodes, and traffic routing through Cloudflare WARP.
Benefits of this methodโ
- No need to install
warp-cli
on every node. - Easily scalable across multiple services.
1. Download Wgcfโ
Go to: Releases ยท ViRb3/wgcf (GitHub)
Choose the version that matches your system. Example for Linux AMD64:
wget https://github.com/ViRb3/wgcf/releases/download/v2.2.26/wgcf_2.2.26_linux_amd64
2. Move file to system directoryโ
mv wgcf_2.2.26_linux_amd64 /usr/bin/wgcf
3. Make file executableโ
chmod +x /usr/bin/wgcf
4. Register accountโ
This will generate a configuration file:
wgcf register
A file named wgcf-account.toml
will be created.
5. Generate WireGuard profileโ
wgcf generate
A file named wgcf-profile.conf
will appear.
6. Extract keys from configโ
Open the generated file:
cat wgcf-profile.conf
Youโll see two important fields:
PrivateKey
PublicKey
7. Configure outbound in XRAYโ
Add the following to your XRAY config under outbounds
:
{
"tag": "warp",
"protocol": "wireguard",
"settings": {
"secretKey": "YOUR_PRIVATE_KEY_FROM_FILE",
"DNS": "1.1.1.1",
"kernelMode": false,
"address": ["172.16.0.2/32"],
"peers": [
{
"publicKey": "YOUR_PUBLIC_KEY_FROM_FILE",
"endpoint": "engage.cloudflareclient.com:2408"
}
]
}
}
8. Full outbounds
block exampleโ
[
{
"tag": "DIRECT",
"protocol": "freedom",
"settings": {
"domainStrategy": "ForceIPv4"
}
},
{
"tag": "warp",
"protocol": "wireguard",
"settings": {
"secretKey": "MISEK000000000000000000vim6zWY=",
"DNS": "1.1.1.1",
"kernelMode": false,
"address": ["172.16.0.2/32"],
"peers": [
{
"publicKey": "bm00000000000000000Vo510h2wPfgyo=",
"endpoint": "engage.cloudflareclient.com:2408"
}
]
}
},
{
"tag": "BLOCK",
"protocol": "blackhole"
},
{
"tag": "IPv4",
"protocol": "freedom",
"settings": {
"domainStrategy": "ForceIPv4"
}
}
]
9. Add routing rule for specific domainsโ
To route certain domains through WARP, add the following to the routing
section:
{
"outboundTag": "warp",
"domain": [
"geosite:google-gemini",
"openai.com",
"ipinfo.io",
"spotify.com",
"canva.com"
],
"type": "field"
}
โ ๏ธ Security Tipโ
Never publish your
PrivateKey
in public repositories or chat groups โ it can compromise your connection.
Conclusionโ
Using WireGuard with Wgcf is a clean and scalable way to connect to Cloudflare WARP without installing warp-cli
.