openvpn killswitch

you probably don't need a vpn, but still



put everything in a folder

 mkdir ~/vpnstuff && cd ~/vpnstuff 

create a vpn group

 groupadd -r openvpn 

iptables-rules.sh

	iptables-legacy -F

	iptables-legacy -A OUTPUT -j ACCEPT -m owner --gid-owner openvpn

	iptables-legacy -A OUTPUT -j ACCEPT -o lo
	iptables-legacy -A OUTPUT -j ACCEPT -o tun+
	    
	iptables-legacy -A INPUT -j ACCEPT -m state --state ESTABLISHED,RELATED

	iptables-legacy -P OUTPUT DROP
	iptables-legacy -P INPUT DROP
	

start.sh

	sg openvpn -c 'openvpn --config /path/to/openvpn.conf --group openvpn'
	

add to bashrc

	vpn () {
		cd $HOME/vpnstuff
		sudo ./iptables-vpn.sh
		sudo ./start.sh
	}