UFW Firewall config

Ubuntu includes its own firewall, known as ufw – short for “uncomplicated firewall.” Ufw is an easier-to-use frontend for the standard Linux iptables commands. You can even control ufw from a graphical interface. Ubuntu's firewall is designed as an easy way to perform basic firewall tasks without learning iptables

apt-get install ufw 

ufw default deny incoming

ufw default allow outgoing


In this example, I am going to configure my server to allow incoming SSH connections but only from IP address and sub/net (CIDR) 

 ufw allow from to any port 22

vim /etc/ufw/user.rules 

### tuple ### allow any 22 any in

-A ufw-user-input -p tcp --dport 22 -s -j ACCEPT

-A ufw-user-input -p udp --dport 22 -s -j ACCEPT


ufw enable