WARP Installation and Configuration in Userspace Mode
"Use WARP in container environments to obtain a Cloudflare egress IP and resolve outbound IP issues in NAT environments."
Install and Configure WARP in Containers for Cloudflare Egress IP
This document will guide you through using WARP in a container environment to obtain a Cloudflare egress IP and create a local SOCKS5 proxy service. This is particularly useful for services that require specific IP geolocation.
Important: If you encounter connection issues after configuration, try using Preferred IPs or replace the
Endpointaddress in the configuration withengage.cloudflareclient.com:2408.
Installation Steps
1. Obtain WARP WireGuard Configuration
Run the following script and select 1, 1, 1 sequentially in the interactive interface:
bash <(wget -qO- https://raw.githubusercontent.com/yonggekkk/warp-yg/main/CFwarp.sh)
After the script executes, it will output a WireGuard configuration. Please copy it in full.
2. Install WireProxy (SOCKS5 Proxy Client)
Download the appropriate WireProxy version for your system architecture:
For AMD64/x86_64:
wget https://github.com/whyvl/wireproxy/releases/download/v1.0.9/wireproxy_linux_amd64.tar.gz
tar -xzvf wireproxy_linux_amd64.tar.gz
mv wireproxy /usr/bin/
chmod +x /usr/bin/wireproxy
For ARM64/aarch64:
wget https://github.com/whyvl/wireproxy/releases/download/v1.0.9/wireproxy_linux_arm64.tar.gz
tar -xzvf wireproxy_linux_arm64.tar.gz
mv wireproxy /usr/bin/
chmod +x /usr/bin/wireproxy
3. Configure WireProxy
Create the configuration directory:
mkdir -p /etc/wireproxy
Paste the WireGuard configuration copied in step 1 into /etc/wireproxy/config.toml, and append the SOCKS5 configuration section at the end:
# ... [Previously copied WireGuard configuration] ...
# New SOCKS5 proxy configuration
[Socks5]
BindAddress = 127.0.0.1:1080
4. (Optional) Use Preferred IPs for Better Connection Quality
If you find the connection unstable, you can use a preferred IP script:
wget -N https://gitlab.com/Misaka-blog/warp-script/-/raw/main/files/warp-yxip/warp-yxip.sh && bash warp-yxip.sh
After running, replace the Endpoint in your configuration with the resulting IP:Port.
5. Configure systemd Service and Start
Create the systemd service file:
cat > /etc/systemd/system/wireproxy.service << EOF
[Unit]
Description=WireProxy SOCKS5 Client
After=network.target
[Service]
Type=simple
WorkingDirectory=/etc/wireproxy
ExecStart=/usr/bin/wireproxy -c config.toml
Restart=always
[Install]
WantedBy=multi-user.target
EOF
Enable and start the service:
systemctl daemon-reload
systemctl enable wireproxy
systemctl start wireproxy
6. Test the Proxy
Use the following command to check your egress IP:
curl -x socks5h://127.0.0.1:1080 ip.sb
If the returned IP address belongs to Cloudflare, the configuration is successful!