UFW Cheat Sheet - UFW is a firewall configuration tool for iptables / ipfilter firewall that is included with Ubuntu by default, but can also be installed in Debian and other Linux flavors. This cheat sheet-style guide provides a quick reference to UFW commands that will create iptables firewall rules are useful in common, everyday scenarios. This includes UFW examples of allowing and blocking various services by port, network interface, and source IP address.
# installs UFW at the command line
# installs the UFW GUI
# reloads the UFW configuration
# enables the UFW
# disables the UFW
# display's UFW Status
# display's UFW Status numbered
# display's UFW Status in verbose mode
# Allow Incoming SSH to server
# Allow Incoming SSH from Specific IP Address or Subnet
# Allow Incoming HTTP to server
# Allow All Incoming HTTP(80) and HTTPS(443)
# Allow port 443 TCP only
# Allow port 443 UDP only
# Allow From Ports 1714 to 1764 TCP
# Allow From Ports 1714 to 1764 UDP
# Block an IP Address
# Block a Class 24 IP Block
# Block Connections to a Network Interface
# Remove Rule to Allow HTTP
# Remove Rule to Allow SSH Access
# Delete / Remove rule # 15 (*see ufw status numbered)