Skip to content

Instantly share code, notes, and snippets.

@bpinto
Created March 22, 2018 00:03
Show Gist options
  • Save bpinto/5afa8b05eec7a8a6e107fd39d12be4f3 to your computer and use it in GitHub Desktop.
Save bpinto/5afa8b05eec7a8a6e107fd39d12be4f3 to your computer and use it in GitHub Desktop.
Wireguard kill-switch ignoring docker
# Adaptation from: https://git.zx2c4.com/WireGuard/about/src/tools/wg-quick.8
PostUp = iptables -I OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL ! -s 172.0.0.0/8 -j REJECT
PreDown = iptables -D OUTPUT ! -o %i -m mark ! --mark $(wg show %i fwmark) -m addrtype ! --dst-type LOCAL ! -s 172.0.0.0/8 -j REJECT
@FiveBoroughs
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment