Last active
December 12, 2018 13:18
-
-
Save craig-m/592531f14624157d4f53f5a1b34fbd6f to your computer and use it in GitHub Desktop.
simple inbound/outbound UFW for debian linux
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 | |
apt-get install -y ufw; | |
# default | |
ufw default deny outgoing | |
ufw default deny incoming | |
# inbound | |
ufw allow 8080/tcp | |
ufw allow from 192.168.1.1 to any port 22 proto tcp | |
# outbound ports | |
ufw allow out 80,443/tcp # http/s | |
ufw allow out 53,123/tcp # dns, ntp | |
ufw allow out 53,123/udp # dns, ntp | |
ufw allow out 67,68/udp # dhcp | |
ufw enable | |
ufw logging on | |
ufw status |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment