Last active
October 3, 2018 02:06
-
-
Save whoamiTM/928ac404f31edb08ffcf29be121c76c2 to your computer and use it in GitHub Desktop.
VPN Kill Switch | ChromeOS or Linux | .sh or command line syntax
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
######################################################################### | |
##### VPN Kill Switch Linux | |
######################################################################### | |
# | |
# Set Varibles | |
vpn_ip=55.55.55.55 | |
vpn_interface=tun0 | |
# | |
sudo iptables -F | |
sudo iptables -P INPUT DROP | |
sudo iptables -P FORWARD DROP | |
sudo iptables -P OUTPUT DROP | |
sudo iptables -A INPUT -i lo -j ACCEPT | |
sudo iptables -A INPUT -s $vpn_ip -j ACCEPT | |
sudo iptables -A INPUT -i $vpn_interface -j ACCEPT | |
sudo iptables -A INPUT -j DROP | |
sudo iptables -A OUTPUT -o lo -j ACCEPT | |
sudo iptables -A OUTPUT -d $vpn_ip -j ACCEPT | |
sudo iptables -A OUTPUT -o $vpn_interface -j ACCEPT | |
sudo iptables -A OUTPUT -j DROP | |
sudo ip6tables -F |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment