Tuesday 12 February 2013

UFW - UBUNTU FIREWALL

## UFW configuration files
/etc/ufw/

## Install if not installed
apt-get update
apt-get install ufw

## firewall enable or disable
ufw enable | disable

## firewall logging on or off
ufw logging on|off

## check firewall status
ufw status

## allow ssh service from everywhere
ufw allow 22   


ufw allow 22/tcp               

## Allow ssh from 172.168.1.100 to 172.16.10.10 on port 22 using tcp

ufw allow from 172.168.1.100 to 172.16.10.10 port 22 proto tcp    

## To delete the rule
ufw  delete allow from 172.168.1.100 to 172.16.10.10 port 22 proto tcp

## Allow all traffic from local network to an interface
ufw allow from 192.168.1.0/24 to 192.168.1.11
 
## allow ssh from ip and to server
ufw allow from 192.168.79.129 to 192.168.79.128 port 22      

## deny ssh
ufw deny 22

## firewall delete allow rule for port 80 tcp
ufw delete allow 80/tcp

## firewall delete  allow rule for port 53
ufw delete allow 53

## When all required services allowed then let’s shut everything else down
ufw default allow|deny


1 comment: