Created
December 27, 2019 11:56
-
-
Save melissaboiko/a053ca5fc27db563a2810094cda3d70b to your computer and use it in GitHub Desktop.
ufw vpn kill switch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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