Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ufw vpn kill switch
#!/bin/bash
if=tun0
ufw --force reset
ufw default deny incoming
ufw default deny outgoing
ufw allow out on $if from any to any
ufw allow in on $if from any to any
# openvpn conffile needs dns
ufw allow out 53
# openvpn port
ufw allow in 1194/udp
ufw allow out 1194/udp
# legacy/alternative openvpn ports
ufw allow in 443/tcp
ufw allow out 443/tcp
ufw allow in 943/tcp
ufw allow out 943/tcp
ufw allow in 1198/udp
ufw allow out 1198/udp
ufw allow in 5000/udp
ufw allow out 5000/udp
ufw enable
#!/bin/bash
ufw --force reset
ufw default deny incoming
ufw default allow outgoing
ufw enable
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment