

You can also check the status of UFW firewall with the following command: You can see a sample output of the above commands in the following screen: To allow incoming connection on UDP port 21 run the following command: You can also specify port number instead service name as shown below: So you will need to allow specific port as per your need.įor example, to allow incoming HTTP connections run the following command: Allow Specific Portīy default UFW is configured to deny all incoming connections. There are several ways to allow incoming connections like, allow specific port, allow specific port range, allow specific IP address, allow specific subnet and allow specific network interface. Now, you can enable the UFW firewall using the following command: If your SSH is configured to listen on a different port (2222 )then run the following command: You can allow incoming SSH connection with the following command: Before activating the UFW firewall, it is recommended to allow incoming SSH connection to access your server from a remote location. Next, you will need to activate the UFW firewall to apply the changes. Now, anyone trying to access your server can not be able to connect your server. You can set the default policy with the following commands: Before started with your UFW firewall, set your UFW firewall rules back to the defaults. You can check all the options available with UFW using the following command:īy default, UFW is configured to allow all outgoing connections and deny all incoming connections.

Once the installation is completed, you can check the status of UFW firewall with the following command:

If not installed, you can install it by running the following command: A root password is configured on your system.īy default, UFW is installed in most Ubuntu operating systems.A server running Ubuntu operating system.In this tutorial, we will show you how to install and use UFW firewall on Linux. UFW may be the appropriate solution for you are looking to secure your network easily. UFW also provides a user-friendly front-end for managing iptables firewall rules. While UFW provides user-friendly syntax that makes it easier to manage your firewall. Generally, iptables is a very advanced tool with powerful functionality, but it’s syntax is very complex and difficult for beginners. It is an alternative program to iptables that simplifies the process of configuring and managing the firewall. UFW stands for “Uncomplicated Firewall” is the default firewall tool for Debian based operating systems.
