Skip to content

Instantly share code, notes, and snippets.

@gerry
Created August 16, 2016 00:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gerry/c2f7d1d9260b418411679eff8202d30c to your computer and use it in GitHub Desktop.
Save gerry/c2f7d1d9260b418411679eff8202d30c to your computer and use it in GitHub Desktop.
#!/bin/sh -e
DEFAULT_IFACE=enp0s3
LOCAL_NET=$(ip -o -f inet addr show $DEFAULT_IFACE | awk '{print $4}')
HOST_IPS=198.8.80.220,198.8.80.223,198.8.80.33,198.8.80.149,198.8.80.180,198.8.80.221,198.8.80.50,198.8.80.203,198.8.80.162,198.8.80.176,107.152.98.168,198.8.80.222,107.152.98.159
ufw --force reset
ufw default deny outgoing
ufw default deny incoming
ufw allow out on tun0 from any to any
ufw allow in on tun0 from any to any
for IP in $(echo $HOST_IPS | tr , \\n); do
#ufw allow in from $IP to any
ufw allow out from any to $IP
done;
#ufw allow from $LOCAL_NET
ufw allow out 1198/udp
ufw enable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment