Skip to content

Instantly share code, notes, and snippets.

@craig-m
Last active December 12, 2018 13:18
Show Gist options
  • Save craig-m/592531f14624157d4f53f5a1b34fbd6f to your computer and use it in GitHub Desktop.
Save craig-m/592531f14624157d4f53f5a1b34fbd6f to your computer and use it in GitHub Desktop.
simple inbound/outbound UFW for debian linux
#!/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