Install UFW in Ubuntu
Currently this firewall package is available in Ubuntu
sudo apt-get install ufwThis will complete the installation
Turn firewall on and off (‘disable’ is default ACCEPT)
# ufw enable|disableToggle logging
# ufw logging on|offSet the default policy (ie “mostly open” vs “mostly closed”)
# ufw default allow|denyAccept or drop incoming packets to (can see what services are available with ’status’ (see below)). can be specified via service name in /etc/services, ‘protocol:port’, or via package meta-data. ‘allow’ adds service entry to /etc/ufw/maps and ‘deny’ removes service entry from /etc/ufw/maps. Basic syntax:
# ufw allow|deny [service]Display status of firewall and ports in the listening state, referencing /var/lib/ufw/maps. Numbers in parenthesis are not displayed to user
# ufw statusUFW Examples
Allow port 53
$ sudo ufw allow 53Delete Allow port 53
$ sudo ufw delete allow 53Allow port 80
$ sudo ufw allow 80/tcpDelete Allow port 80
$ sudo ufw delete allow 80/tcpAllow port smtp
$ sudo ufw allow smtpDelete Allow port smtp
$ sudo ufw delete allow smtpAllow fro Particular IP
$ sudo ufw allow from 192.168.254.254Delete the above rule
$ sudo ufw delete allow from 192.168.254.254GUI Tool for UFW
If you want GUI for UFW check this guide
No comments:
Post a Comment