This shows you the differences between two versions of the page.
— |
ufw [2012/03/24 11:15] (current) mantis created |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== General ====== | ||
+ | ===== Installing ===== | ||
+ | ufw should be installed by default on newer Ubuntu servers. (Although it is most likely disabled) | ||
+ | |||
+ | ===== Enabling ===== | ||
+ | <code bash> | ||
+ | sudo ufw default allow # Careful, uwf by default DENIES all incoming traffic. So I first set it to "allow" here to avoid being locked out of the server | ||
+ | sudo ufw enable | ||
+ | </code> | ||
+ | |||
+ | ===== Checking status ===== | ||
+ | <code bash> | ||
+ | sudo ufw status verbose | ||
+ | </code> | ||
+ | |||
+ | |||
+ | ====== Adding Rules ====== | ||
+ | ===== Block an IP ===== | ||
+ | <code bash> | ||
+ | sudo ufw deny from 10.101.21.228 | ||
+ | </code> | ||
+ | |||
+ | ===== Block a Port ===== | ||
+ | <code bash> | ||
+ | sudo ufw deny 53 | ||
+ | </code> | ||
+ | |||
+ | ====== Removing Rules ====== | ||
+ | <code bash> | ||
+ | sudo ufw delete deny from 10.101.21.228 | ||
+ | </code> | ||
+ | |||
+ | |||
+ | ====== External Links ====== | ||
+ | * https://help.ubuntu.com/community/UFW | ||
+ | * http://1000umbrellas.com/2010/04/29/how-to-set-up-the-firewall-using-ufw-on-ubuntu-lucid-lynx-server | ||
+ | * https://help.ubuntu.com/8.04/serverguide/C/firewall.html | ||