Simple UFW/GUFW Firewall Setup Guide for Ubuntu

HomeOther ContentSimple UFW/GUFW Firewall Setup Guide for Ubuntu
Simple UFW/GUFW Firewall Setup Guide for Ubuntu
Simple UFW/GUFW Firewall Setup Guide for Ubuntu
How to install and configure a Simple Firewall (UFW) and its GUI – GUFW in Ubuntu.
Using a firewall in Ubuntu is optional, unlike Windows it does not have many open ports and therefore does not need to restrict access to the system.
If you are using Ubuntu Server or hosting a website from your home computer, a firewall would be a good thing to implement on your system.
If you use torrenting a lot, it might be a good idea to add a firewall.

Installation Instructions
Install GUFW: sudo apt-get install gufw

Configure GUFW
Change status to Enabled
Create a new rule, for example Deny TCP/23
To restart
Test if the firewall is working: sudo ufw status

If the firewall is not working, try the following:
sudo ufw disable
sudo sed -i 's/ENABLEDno/ENABLEDyes/' /etc/ufw/ufw.conf
sudo ufw logout
sudo ufw enable
sudo ufw status

Examples of rules to create:
23/tcp, deny entry, anywhere
6881 (or other torrent port), Allow entry, anywhere
22/tcp, deny entry, 192.168.1.1
137:139/udp, deny entry, 192.168.1.1
139/tcp, deny entry, 192.168.1.1
445/tcp, deny entry, 192.168.1.1
4732/tcp, deny entry, 192.168.1.1
Anywhere, allow entry 192.168.1.0/24
22/tcp, deny entry, anywhere
137:139/udp, deny entry, anywhere
139/tcp, deny entry, anywhere
445/tcp, deny entry, anywhere
4732/tcp, deny entry, anywhere

Some common ports on Ubuntu Home systems:
TCP 22 – SSH (restrict access)
TCP 23 – Telnet (prevent access)
UDP 68 – DHCP (do not block)
UDP 137:138 – Samba (restrict access)
TCP 139 – Samba (restrict access)
TCP 445 – Samba (restrict access)
TCP 4732 – Remina Remote Desktop (restricted access)
UDP 5353 – Avahi service discovery (do not block)

To see open TCP ports
sudo netstat -napt grep LISTEN

To see open UDP ports
sudo netstat -napu

Wallpaper: http://imgur.com/8FrHx

Please take the opportunity to connect and share this video with your friends and family if you find it useful.

No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *