Skip to content

Instantly share code, notes, and snippets.

@forestbaker
Created August 29, 2016 20:48
Show Gist options
  • Save forestbaker/ecfe340d1b81acc01b224f7373b593f4 to your computer and use it in GitHub Desktop.
Save forestbaker/ecfe340d1b81acc01b224f7373b593f4 to your computer and use it in GitHub Desktop.
UFW commands
# Check UFW Firewall rules:
ufw status
ufw status numbered
ufw status verbose
# Enable UFW logging:
ufw logging (on|off|low|medium|high|full)
ufw logging on = ufw logging low
# Insert a rule at position 1
ufw insert 1
# Delete a rule at position 1
ufw delete 1
# Check active iptables rules:
iptables -L -nvx --line-numbers
# Backup active firewall rules (easier to read/analyze)
iptables-save > firewall_rules_current.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment