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 192.168.1.100 and sub/net (CIDR) 

 ufw allow from  94.110.116.58 to any port 22

vim /etc/ufw/user.rules 


### tuple ### allow any 22 0.0.0.0/0 any 94.111.115.2 in

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

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

 

ufw enable 

 



 

Comments