Skip to content

Instantly share code, notes, and snippets.

@azidanit
Created January 26, 2026 16:11
Show Gist options
  • Select an option

  • Save azidanit/e19da4ee0230e27e18ec11e3af7a91d6 to your computer and use it in GitHub Desktop.

Select an option

Save azidanit/e19da4ee0230e27e18ec11e3af7a91d6 to your computer and use it in GitHub Desktop.
Deploy Egress Tunnel CF
  1. Create LXC
lxc.apparmor.profile: unconfined
lxc.cgroup.devices.allow: c 10:200 rwm
lxc.mount.auto: proc:rw sys:rw
lxc.mount.entry: /dev/net/tun dev/net/tun none bind,create=file
  1. install warp-cli https://developers.cloudflare.com/cloudflare-one/tutorials/warp-on-headless-linux/
  2. set NAT routing
root@rmr-egress-cf:~# iptables -t nat -A POSTROUTING -o CloudflareWARP -j MASQUERADE
root@rmr-egress-cf:~# iptables -A FORWARD -i eth0 -o CloudflareWARP -j ACCEPT
root@rmr-egress-cf:~# iptables -A FORWARD -i CloudflareWARP -o eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT

to make permanent

apt install -y iptables-persistent
netfilter-persistent save
  1. set routing in mikrotik (used as wan)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment