UFW stands for uncomplicated firewall. The Ubuntu 22.04 (Jammy Jellyfish) Linux comes with packet filtering called Netfilter. The iptables frontend command used to manage netfilter. However, ufw provides easy to use front-end for netfilter, and it is one of the most popular among Ubuntu and Debian Linux sysadmins and developers.
Firewall rules can be added or omitted from the set of Firewall rules. However, at times, you accidentally add a Firewall rule, or you might not need a certain Firewall rule any longer. In both of these cases, you would feel the need to remove that particular rule.
Here at LinuxAPT, we shall look into how you can remove a UFW rule in Ubuntu.
Method to Delete a UFW Rule in Ubuntu 22.04 (Jammy Jellyfish) ?
To begin with removal of a UFW rule, you need to first add a new rule to our Firewall, which we will remove later. To add a new Firewall rule, you can execute the ufw allow command.
For example, to add TCP port 53, you can run the below command:
$ sudo ufw allow 53/tcp
From the output, you will notice that the specified Firewall rule has been added successfully.
Now in order to remove the just added port 53 from the system's firewall, you can simply execute the below command:
$ sudo ufw delete allow 53/tcp
You will see that the Firewall rule has been removed successfully from examining the output.
[Need help in fixing Ubuntu Linux system issues ? We can help you. ]