vpnkillswitch-on 446 Bytes
Newer Older
Jay Ta'ala's avatar
Jay Ta'ala committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash

# Default policies
sudo ufw default deny incoming
sudo ufw default deny outgoing

# Openvpn interface (adjust interface accordingly to your configuration)
sudo ufw allow out on tun0

# Openvpn (adjust port accordingly to your vpn setup)
sudo ufw allow out to any port 1194

# process arguments
while getopts "t:" opt; do
	case ${opt} in
		t)	
			echo "allow outgoing traffic to $OPTARG"
			sudo ufw allow out to $OPTARG;;
	esac
done