Skip to content

Instantly share code, notes, and snippets.

@stueja
Created July 20, 2020 20:30
Show Gist options
  • Save stueja/033101611ca1c5ed52956c90e2e69242 to your computer and use it in GitHub Desktop.
Save stueja/033101611ca1c5ed52956c90e2e69242 to your computer and use it in GitHub Desktop.
Use wireguard udp via web sockets using wstunnel
[Interface]
Address = 1.2.3.4/24
ListenPort = 12345
PrivateKey = xyz=
PostUp = iptables -A INPUT -i eth0 -p tcp --dport 443 -j ACCEPT
PostUp = iptables -A OUTPUT -o eth0 -p tcp --sport 443 -j ACCEPT
PostUp = iptables -A INPUT -i wg-wss -j ACCEPT
PostUp = iptables -A OUTPUT -o wg-wss -j ACCEPT
PostUp = /usr/local/bin/wstunnel --server wss://public.ip.of.server -r 127.0.0.1:12345 &
PostDown = iptables -D INPUT -i eth0 -p tcp --dport 443 -j ACCEPT
PostDown = iptables -D OUTPUT -o eth0 -p tcp --sport 443 -j ACCEPT
PostDown = iptables -D INPUT -i wg-wss -j ACCEPT
PostDown = iptables -D OUTPUT -o wg-wss -j ACCEPT
PostDown = pkill wstunnel
[Peer]
# Name = one-arch
PublicKey = zyx=
AllowedIPs = 1.2.3.5/32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment