Skip to content

Instantly share code, notes, and snippets.

Last active Dec 19, 2020
What would you like to do?
Disconnects from VPN on Linux, killing apps first and reseting the firewall
# Your VPN name on Network Manager, to list all connections you can use: nmcli con
# List of apps you want to kill before disconnecting from the VPN, if you don't kill them, they will leak traffic
KILL_APPS="firefox thunderbird transmission-gtk"
# Killing apps
killall $KILL_APPS
# VPN disconnect
nmcli con down id $VPN_NAME
# Reset Firewall to defaults
sudo ufw --force reset
sudo ufw default deny incoming
sudo ufw default allow outgoing
sudo ufw enable
Copy link

nukeador commented Jul 6, 2017

Use it with to enable the vpn and firewall.

Blog post about these scripts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment