The Uncomplicated Firewall is already installed on your Ubuntu machine. It still uses the iptables service, but it offers a vastly simplified set of commands. Perform just one simple command to enable it, and you have a good, preconfigured firewall. There's a graphical frontend for use on desktop machines, but since we're learning about server security, we'll just cover the command-line utility here.
Uncomplicated Firewall for Ubuntu systems
Basic usage of ufw
ufw is disabled by default, so you'll need to enable it:
donnie@ubuntu:~$ sudo ufw enable
Command may disrupt existing ssh connections. Proceed with operation (y|n)? y
Firewall is active and enabled on system startup
donnie@ubuntu:~$
To do this, I logged...