Firewall on Ubuntu

From Gruff Goat Wiki
Jump to: navigation, search


On Ubuntu, I use the built in firewall, iptables, and manage the initial setup using UFW - Uncomplicated Firewall.


Initial Settings

ufw default deny          # Default rule
ufw allow ssh             # Allow all ssh traffic on port 22
ufw allow ftp             # Allow all ssh traffic on port 21
ufw allow www             # Allow all ssh traffic on port 80
ufw allow 8080            # Allow JAVA
ufw limit ssh             # Connection rate limiting
ufw allow smtp            # Allow all ssh traffic on port 25
ufw allow pop3            # Allow all ssh traffic on port 110
ufw allow imap2           # Allow all ssh traffic on port 143
ufw allow https           # Allow all ssh traffic on port 443
ufw allow imaps           # Allow all ssh traffic on port 993
ufw allow pop3s           # Allow all ssh traffic on port 995
ufw allow 587             # Allow SMTP Auth Submission
ufw logging on
ufw enable                # Turn the firewall on
ufw status                # Check firewall status