Adjusting the Firewall under Ubuntu
The default firewall configuration tool for Ubuntu is ufw. Developed to ease iptables firewall configuration, ufw provides a user friendly way to create an IPv4 or IPv6 host-based firewall. By default UFW is disabled.
Enable or Disable
To turn UFW on with the default set of rules:
sudo ufw enable
To check the status of UFW:
sudo ufw status verbose
To disable ufw use:
sudo ufw disable
To Allow SSH Connections from a specific or range of IP Addresses:
sudo ufw allow from 123.123.123.123 to any port 22 proto tcp
sudo ufw allow from 123.123.123.0/24 to any port 22 proto tcp