Ufw

From Dikapedia
Jump to: navigation, search

ufw - Uncomplicated Firewall

https://wiki.ubuntu.com/UncomplicatedFirewall


The following are some examples of how to use ufw: https://ubuntu.com/server/docs/security-firewall


The ufw application is capable of doing anything that iptables can do. This is achieved by using several sets of rules files, which are nothing more than iptables-restore compatible text files. Fine-tuning ufw and/or adding additional iptables commands not offered via the ufw command is a matter of editing various text files1:

   /etc/default/ufw: high level configuration, such as default policies, IPv6 support and kernel modules to use
   /etc/ufw/before[6].rules: rules in these files are evaluated before any rules added via the ufw command
   /etc/ufw/after[6].rules: rules in these files are evaluated after any rules added via the ufw command
   /etc/ufw/sysctl.conf: kernel network tunables
   /var/lib/ufw/user[6].rules or /lib/ufw/user[6].rules (0.28 and later): rules added via the ufw command (should not normally be edited by hand)
   /etc/ufw/ufw.conf: sets whether or not ufw is enabled on boot, and in 9.04 (ufw 0.27) and later, sets the LOGLEVEL
   /etc/ufw/after.init: initialization customization script run after ufw is initialized (ufw 0.34 and later)
   /etc/ufw/before.init: initialization customization script run before ufw is initialized (ufw 0.34 and later) 

After modifying any of the above files, activate the new settings with:

$ sudo ufw disable $ sudo ufw enable