Skip to content

Instantly share code, notes, and snippets.

@IAmStoxe
Created November 16, 2018 20:31
Show Gist options
  • Save IAmStoxe/174c9e1922a7ab689cb73435510eb095 to your computer and use it in GitHub Desktop.
Save IAmStoxe/174c9e1922a7ab689cb73435510eb095 to your computer and use it in GitHub Desktop.
Easy UWF VPN Killswitch
#!/bin/bash
# Reset ufw and skip the confirmation
sudo ufw --force reset
# Set default to deny any incoming and all outgoing
sudo ufw default deny incoming
sudo ufw default allow outgoing
# Allow all IN/OUT traffic on our tun0 (VPN) adapter
sudo ufw allow in on tun0
sudo ufw allow out on tun0
# Allow internal traffic IN/OUT on our main adapter
# Replace .1. with your network's octet
sudo ufw allow in on eno1 from 192.168.1.0/24
sudo ufw allow out on eno1 to 192.168.1.0/24
# Allow IN/OUT on port 1198, using UDP, to our VPN's IP
# Replace <VPN_IP> (and 1198 if necessary)
sudo ufw allow out on eno1 to <VPN_IP> port 1198 proto udp
sudo ufw allow in on eno1 from <VPN_IP> port 1198 proto udp
# Now we enable our rules
sudo ufw enable
#!/bin/bash
# Reset ufw and skip the confirmation
sudo ufw --force reset
# Set default to deny any incoming and all outgoing
sudo ufw default deny incoming
sudo ufw default allow outgoing
# Allow IN/OUT from our local network
sudo ufw allow from 192.168.1.0/24
sudo ufw allow to 192.168.1.0/24
# Now we enable our rules
sudo ufw enable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment