Skip to content

Instantly share code, notes, and snippets.

@Gonzih
Last active April 10, 2018 22:07
Show Gist options
  • Save Gonzih/adaa2ea09da14324649dfec1fc0ace99 to your computer and use it in GitHub Desktop.
Save Gonzih/adaa2ea09da14324649dfec1fc0ace99 to your computer and use it in GitHub Desktop.
PIA/Privateinternetaccess iptables kill switch with enabled incoming SSH
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT DROP [0:10]
-A FORWARD -i tun+ -j ACCEPT
-A FORWARD -j DROP
-A INPUT -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -i tun+ -j ACCEPT
-I INPUT -p tcp --dport 22 -j ACCEPT
-A OUTPUT -o lo -j ACCEPT
-A OUTPUT -p tcp --sport 22 -j ACCEPT
-A OUTPUT -d 209.222.18.222/32 -j ACCEPT
-A OUTPUT -d 209.222.18.218/32 -j ACCEPT
-A OUTPUT -p udp -m udp --dport 1198 -j ACCEPT
-A OUTPUT -p udp -m udp --dport 53 -j ACCEPT
-A OUTPUT -o tun+ -j ACCEPT
-A OUTPUT -j REJECT --reject-with icmp-net-unreachable
COMMIT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment