#!/bin/sh # ------------------------------------- # firewall settings # ver: 00.01 # rev: 30-Nov-2011 # for Ubuntu 11.10 # Jerry borrows for Pogoserv headless weather server // 12 March 2013 ---------------------------- # reset rules # disable firewall sudo ufw disable # reset all firewall rules sudo ufw reset --force # set default rules: deny all incoming traffic, allow all outgoing traffic sudo ufw default deny incoming sudo ufw default allow outgoing # ------------------------------------- # open port for ftp including ftp data for my lcoal network sudo ufw allow from 192.168.1.0/24 to any port 20 proto tcp # open port for ftp including ftp control for my lcoal network sudo ufw allow from 192.168.1.0/24 to any port 21 proto tcp # open port for SSH for my local network sudo ufw allow from 192.168.1.0/24 to any port 22 proto tcp # open port for internet (www // port 80) sudo ufw allow from 192.168.1.0/24 to any port 80 proto tcp # open port for network time protocol (ntpq // port 123) sudo ufw allow from 192.168.1.0/24 to any port 123 proto tcp # open port for Ajenti for my local network sudo ufw allow from 192.168.1.0/24 to any port 8000 proto tcp # open port for webmin for my local network sudo ufw allow from 192.168.1.0/24 to any port 10000 proto tcp # open port for php5-fpm for my local network sudo ufw allow from 192.168.1.0/24 to any port 9000 proto tcp # open port for mysql for my local network sudo ufw allow from 192.168.1.0/24 to any port 3306 proto tcp # # # ------------------------------------- # re-start # enable firewall sudo ufw enable # list all firewall rules sudo ufw status verbose