Skip to content

Instantly share code, notes, and snippets.

@4piu
Created September 10, 2026 21:18
Show Gist options
  • Select an option

  • Save 4piu/3e05b9b529725950d6b4f085e4b262e4 to your computer and use it in GitHub Desktop.

Select an option

Save 4piu/3e05b9b529725950d6b4f085e4b262e4 to your computer and use it in GitHub Desktop.
Bridge Netbird exit node to Cloudflare WARP in Docker
services:
warp:
image: linuxserver/wireguard:latest
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun:/dev/net/tun
volumes:
- ./wgcf-profile.conf:/config/wg_confs/wg0.conf:ro
sysctls:
- net.ipv4.ip_forward=1
- net.ipv4.conf.all.src_valid_mark=1
restart: unless-stopped
netbird:
image: netbirdio/netbird:latest
network_mode: "service:warp"
cap_add:
- NET_ADMIN
- SYS_ADMIN
- SYS_RESOURCE
volumes:
- /home/netbird-data:/var/lib/netbird
restart: unless-stopped
environment:
- NB_SETUP_KEY=********
[Interface]
PrivateKey = ********
Address = 172.16.0.2/32, 2606:4700:110:840e:9723:7cf9:a106:118b/128
DNS = 1.1.1.1, 1.0.0.1, 2606:4700:4700::1111, 2606:4700:4700::1001
MTU = 1280
Table = off
PostUp = ip route add default dev %i table 51820
PostUp = ip rule add iif wt0 lookup 51820 priority 100
PostUp = ip -6 route add default dev %i table 51820
PostUp = ip -6 rule add iif wt0 lookup 51820 priority 100
PreDown = ip rule del iif wt0 lookup 51820 priority 100
PreDown = ip route del default dev %i table 51820
PreDown = ip -6 rule del iif wt0 lookup 51820 priority 100
PreDown = ip -6 route del default dev %i table 51820
[Peer]
PublicKey = ********
AllowedIPs = 0.0.0.0/0, ::/0
Endpoint = engage.cloudflareclient.com:2408
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment